From 408e18d58422dc2dc0047d6a6f36e8a77a581a70 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Thu, 21 Nov 2024 23:43:24 -0600 Subject: [PATCH 1/4] turn on github actions caching of pip environments --- .github/workflows/isort.yml | 3 ++- .github/workflows/mypy.yml | 3 ++- .github/workflows/pylint.yml | 3 ++- .github/workflows/python-package.yml | 2 ++ .github/workflows/safety.yml | 2 ++ .github/workflows/test-future.yml | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) 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..a77f107b4 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -13,7 +13,8 @@ jobs: uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.x' + cache: 'pip' - run: | uv pip install --system -U \ black \ diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 7005eb088..a10398bd3 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -13,7 +13,8 @@ jobs: uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.x' + cache: 'pip' - 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 96e4cd6e5..d76fb05bc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -23,6 +23,8 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + with: + cache: 'pip' - name: Build wheel distribution run: uv build --wheel - name: Upload wheel for other jobs diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 1d4d567c0..2dbdd669b 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -12,6 +12,8 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v3 - uses: actions/setup-python@v5 + with: + cache: 'pip' - 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-future.yml b/.github/workflows/test-future.yml index 189f097e8..da56b2453 100644 --- a/.github/workflows/test-future.yml +++ b/.github/workflows/test-future.yml @@ -19,6 +19,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.x' + cache: 'pip' - name: Install dependencies run: | # strict dependency resolution added in pip 20.3 From 3223f243f920ea661cc9814429aa090c067dc561 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Thu, 21 Nov 2024 23:46:28 -0600 Subject: [PATCH 2/4] add change entry for pip caching --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 8f7bbb1b2..05d907d92 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,7 @@ These features will be included in the next release: Added ----- +- CI workflow, enable caching of packages - 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. From e4dfceae4827a3f56b198215e394ea96a6458f5c Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Mon, 25 Nov 2024 11:43:35 -0600 Subject: [PATCH 3/4] fix to use uv caching per pr comments --- .github/workflows/mypy.yml | 3 ++- .github/workflows/pylint.yml | 3 ++- .github/workflows/python-package.yml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index a77f107b4..c601123a4 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -11,10 +11,11 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: python-version: '3.x' - cache: 'pip' - run: | uv pip install --system -U \ black \ diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a10398bd3..767788cf6 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -11,10 +11,11 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 + with: + enable-cache: true - uses: actions/setup-python@v5 with: python-version: '3.x' - cache: 'pip' - 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 d76fb05bc..5c5302f2d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,9 +22,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 - - uses: actions/setup-python@v5 with: - cache: 'pip' + enable-cache: true + - uses: actions/setup-python@v5 - name: Build wheel distribution run: uv build --wheel - name: Upload wheel for other jobs From 61aeb88c6a135761629869a7103ea05861aedf24 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Mon, 25 Nov 2024 11:44:13 -0600 Subject: [PATCH 4/4] add one missed --- .github/workflows/safety.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 2dbdd669b..1642f919c 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -11,9 +11,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v3 - - uses: actions/setup-python@v5 with: - cache: 'pip' + enable-cache: true + - uses: actions/setup-python@v5 - 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