diff --git a/.github/workflows/help-in-readme.yml b/.github/workflows/help-in-readme.yml index 2b70097fc..e7fba3511 100644 --- a/.github/workflows/help-in-readme.yml +++ b/.github/workflows/help-in-readme.yml @@ -7,6 +7,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Verify that README contains output of darker --help run: uvx --from '.[flynt,isort]' darker --verify-readme diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml index 49fcf95a7..107758a35 100644 --- a/.github/workflows/isort.yml +++ b/.github/workflows/isort.yml @@ -11,7 +11,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.x' + cache: 'pip' - run: pip install 'isort>=5.0.1' - uses: akaihola/lint-action@master with: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index dd60081f6..6c5bc8a9a 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -9,11 +9,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - run: | uv pip install --system -U \ black \ diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 6a543d691..681ce0bd7 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -9,11 +9,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Install dependencies for running Pylint run: | uv pip install --system -U \ diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fa13f8767..6fa29ae61 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -20,9 +20,16 @@ jobs: wheel-path: ${{ steps.get-darker-version.outputs.wheel-path }} steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Build wheel distribution run: uv build --wheel - name: Upload wheel for other jobs diff --git a/.github/workflows/pyupgrade.yml b/.github/workflows/pyupgrade.yml index 96b8a86b3..1d3f9dea5 100644 --- a/.github/workflows/pyupgrade.yml +++ b/.github/workflows/pyupgrade.yml @@ -11,9 +11,16 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Ensure modern Python style using pyupgrade run: | uvx \ diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 1d4d567c0..b9445bdca 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -9,9 +9,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - run: uvx --from pip-tools pip-compile setup.cfg - name: Check dependencies for known security vulnerabilities using Safety run: uvx safety check --file requirements.txt diff --git a/.github/workflows/test-bump-version.yml b/.github/workflows/test-bump-version.yml index d02b0af4e..bc5d9e59e 100644 --- a/.github/workflows/test-bump-version.yml +++ b/.github/workflows/test-bump-version.yml @@ -9,9 +9,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Make sure that `darkgray_bump_version` still finds all version strings and that there's a future milestone on GitHub Issues. diff --git a/.github/workflows/test-future.yml b/.github/workflows/test-future.yml index 90bcd4376..9488a5bbb 100644 --- a/.github/workflows/test-future.yml +++ b/.github/workflows/test-future.yml @@ -15,24 +15,29 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: 'master' fetch-depth: 0 - uses: actions/setup-python@v5 with: python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + cache-dependency-glob: | + **/setup.cfg + **/pyproject.toml - name: Install dependencies run: | # strict dependency resolution added in pip 20.3 # CVE-2021-3572 fixed in pip 21.1 - python -m pip install --upgrade 'pip>=21.1' - pip install \ + uv pip install \ --constraint=constraints-future.txt \ --upgrade \ - --upgrade-strategy=eager \ -e '.[test]' + uv python install - name: Test with pytest run: | - pytest + uv run pytest - name: Note a possible Black incompatibility and required actions if: failure() shell: python diff --git a/CHANGES.rst b/CHANGES.rst index 3ca5bca1f..d56c3f3fb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,9 @@ These features will be included in the next release: Added ----- +- CI workflow, enable caching of packages +- Dependabot configuration for automatically opening prs for package version + upgrades - New exit codes 2 for file not found, 3 for invalid command line arguments, 4 for missing dependencies and 123 for unknown failures. - Display exit code in parentheses after error message.