diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bca707dc3..3c93f3424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: push: branches: [ master ] pull_request: + branches: [ master ] workflow_dispatch: schedule: - cron: '0 0 1 * *' @@ -20,11 +21,17 @@ jobs: python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + + - name: Install uv + uses: astral-sh/setup-uv@v4 with: python-version: ${{ matrix.python }} - - run: python -m pip install --upgrade setuptools pip tox virtualenv + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt + - run: uv tool install tox --with tox-uv # Run tox only for the installed py version on the runner as outlined in the python matrix # Ensures the correct py version is installed and tested as opposed to 'tox' which attempts to run for all py versions in tox.ini - - run: tox -e py - - run: tox -e mypy + - run: uv run tox -e py + - run: uv run tox -e mypy diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0f4c082a7..f4e9036c9 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,7 +9,6 @@ on: - v* jobs: - tox: runs-on: ${{ matrix.os }} strategy: @@ -18,14 +17,19 @@ jobs: python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 with: python-version: ${{ matrix.python }} - - run: python -m pip install --upgrade setuptools pip tox virtualenv + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt + - run: uv tool install tox --with tox-uv # Run tox only for the installed py version on the runner as outlined in the python matrix # Ensures the correct py version is installed and tested as opposed to 'tox' which attempts to run for all py versions in tox.ini - - run: tox -e py - - run: tox -e mypy + - run: uv run tox -e py + - run: uv run tox -e mypy deploy: # Run tests beforing deploying to pypi @@ -33,14 +37,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 with: - python-version: 3.13 + python-version: '3.13' + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt - name: Install dependencies - run: pip install wheel + run: uv pip --system --upgrade install wheel - name: Build package - run: python setup.py sdist bdist_wheel + run: uv run python setup.py sdist bdist_wheel - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: