Skip to content

Commit

Permalink
ci(tests,docs): poetry -> uv
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Aug 24, 2024
1 parent c80d290 commit 237b6f9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ jobs:
if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV

- name: Install poetry
- name: Install uv
if: env.PUBLISH == 'true'
run: pipx install "poetry==1.8.3"
run: pip install "uv==0.3.3"

- name: Set up Python ${{ matrix.python-version }}
if: env.PUBLISH == 'true'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache: 'pip'

- name: Install dependencies [w/ docs]
if: env.PUBLISH == 'true'
run: poetry install --with=docs,lint
run: uv pip install --editable .[docs,lint]

- name: Build documentation
if: env.PUBLISH == 'true'
run: |
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd
pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd
- name: Push documentation to S3
if: env.PUBLISH == 'true'
Expand Down
28 changes: 15 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,40 @@ jobs:
python-version: ['3.9', '3.12']
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install "poetry==1.8.3"

- name: Install uv
run: pip install "uv==0.3.3"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache: 'pip'

- name: Install dependencies
run: poetry install --with=docs,test,coverage,lint
run: uv pip install --editable .[docs,test,coverage,lint]

- name: Lint with ruff check
run: poetry run ruff check .
run: uv run ruff check .

- name: Format with ruff
run: poetry run ruff format . --check
run: uv run ruff format . --check

- name: Lint with mypy
run: poetry run mypy .
run: uv run mypy .

- name: Print python versions
run: |
python -V
poetry run python -V
uv run python -V
- name: Test with pytest
run: poetry run py.test --cov=./ --cov-append --cov-report=xml
run: uv run py.test --cov=./ --cov-append --cov-report=xml
env:
COV_CORE_SOURCE: .
COV_CORE_CONFIG: .coveragerc
COV_CORE_DATAFILE: .coverage.eager

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -67,18 +69,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install "poetry==1.8.3"
- name: Install uv
run: pip install "uv==0.3.3"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache: 'pip'

- name: Build package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: poetry build
run: uv build

- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
Expand Down

0 comments on commit 237b6f9

Please sign in to comment.