Skip to content

Commit

Permalink
New build style: uv, justfile, ruff, drop unused (#1)
Browse files Browse the repository at this point in the history
* Use uv for dependencies and clean up tooling we are not using now

* Add Justfile

* Update package description with more accurate classifiers as well as other pyproject.toml changes

* Add link to upstream readme
  • Loading branch information
erewok authored Sep 3, 2024
1 parent 58bb804 commit 45374e4
Show file tree
Hide file tree
Showing 13 changed files with 1,372 additions and 2,353 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Tests
on:
pull_request:
branches:
- master
- main
paths-ignore:
- 'docs/**'
Expand All @@ -29,30 +28,21 @@ jobs:
with:
tool: just
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
- name: Set up Poetry cache for Python dependencies
uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-async-simple-sf
- name: "Install poetry"
run: "pip install poetry"
- name: "Configure poetry"
run: "poetry config virtualenvs.create false --local"
- name: "Run poetry install deps"
run: "just bootstrap"
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Set up environment and run code quality checks
- name: "Run install deps"
run: "just bootstrap ${{ matrix.python-version }}"
- name: "Run code quality checks"
run: "just check"
- name: "Run code quality checks"
# Enable when passing
# - name: "Run code quality checks"
# run: "just check-types"
- name: "Run tests"
run: "just ci-test ${COVERAGE_DIR}"

# Publish code coverage results
- name: Code Coverage Report
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }}
uses: irongut/[email protected]
with:
filename: coverage.xml
Expand All @@ -66,15 +56,15 @@ jobs:
thresholds: '70 80'

- name: Add Coverage PR Comment
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md

# Publish junit test result
- name: Publish Test Report
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }}
uses: mikepenz/action-junit-report@v4
with:
report_paths: ${{ format('/tmp/coverage/{0}/*junit.xml', github.run_id) }}
23 changes: 10 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,22 @@ jobs:
name: "Publish release"
runs-on: "ubuntu-latest"

environment:
name: PyPi
environment: release

steps:
- uses: taiki-e/install-action@v2
with:
tool: just
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: 3.11
- name: "Install poetry"
run: "pip install poetry"
- name: "Configure poetry"
run: "poetry config virtualenvs.create false --local"
- name: "Run poetry install deps"
run: "poetry install --no-root"
python-version: 3.12
- name: "Install uv"
run: "pip install uv"
- name: "Run install deps"
run: "just bootstrap"
- name: "Build and release"
run: |
poetry build
python -m twine check dist/*
python -m twine upload dist/*
run: "just release"
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
273 changes: 0 additions & 273 deletions .pylintrc

This file was deleted.

Loading

0 comments on commit 45374e4

Please sign in to comment.