Skip to content

Commit

Permalink
Install uv in CI when available (#11805)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Oct 21, 2024
1 parent 8f3aac1 commit 5e82862
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
# pypy3-3.8 and pypy3-3.9 -- both of them show up as 7.3.11.
key: ${{ matrix.PYTHON.VERSION }}-${{ steps.setup-python.outputs.python-version }}-${{ matrix.PYTHON.NOXSESSION }}-${{ env.OPENSSL_HASH }}

- run: python -m pip install -c ci-constraints-requirements.txt 'nox' 'tomli; python_version < "3.11"'
- run: python -m pip install -c ci-constraints-requirements.txt 'nox' 'nox[uv]; python_version >= "3.8"' 'tomli; python_version < "3.11"'
- name: Create nox environment
run: |
nox -v --install-only
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
- run: |
echo "OPENSSL_FORCE_FIPS_MODE=1" >> $GITHUB_ENV
if: matrix.IMAGE.FIPS
- run: /venv/bin/python -m pip install -c ci-constraints-requirements.txt 'nox' 'tomli; python_version < "3.11"'
- run: /venv/bin/python -m pip install -c ci-constraints-requirements.txt 'nox' 'nox[uv]; python_version >= "3.8"' 'tomli; python_version < "3.11"'
- run: '/venv/bin/nox -v --install-only'
env:
CARGO_TARGET_DIR: ${{ format('{0}/src/rust/target/', github.workspace) }}
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
timeout-minutes: 3
- run: rustup component add llvm-tools-preview

- run: python -m pip install -c ci-constraints-requirements.txt 'nox' 'tomli; python_version < "3.11"'
- run: python -m pip install -c ci-constraints-requirements.txt 'nox' 'nox[uv]; python_version >= "3.8"' 'tomli; python_version < "3.11"'

- name: Clone test vectors
timeout-minutes: 2
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
timeout-minutes: 2
with:
key: ${{ matrix.PYTHON.NOXSESSION }}-${{ matrix.WINDOWS.ARCH }}-${{ steps.setup-python.outputs.python-version }}
- run: python -m pip install -c ci-constraints-requirements.txt "nox" "tomli; python_version < '3.11'"
- run: python -m pip install -c ci-constraints-requirements.txt "nox" "nox[uv]; python_version >= '3.8'" "tomli; python_version < '3.11'"

- uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
Expand Down
2 changes: 2 additions & 0 deletions ci-constraints-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ urllib3==2.0.7 ; python_full_version < '3.8'
# via requests
urllib3==2.2.3 ; python_full_version >= '3.8'
# via requests
uv==0.4.24 ; python_full_version >= '3.8'
# via nox
virtualenv==20.26.6 ; python_full_version < '3.8'
# via nox
virtualenv==20.27.0 ; python_full_version >= '3.8'
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def tests(session: nox.Session) -> None:

if session.name != "tests-nocoverage":
[rust_so] = glob.glob(
f"{session.virtualenv.location}/**/cryptography/hazmat/bindings/_rust.*",
f"{session.virtualenv.location}/lib/**/cryptography/hazmat/bindings/_rust.*",
recursive=True,
)
process_rust_coverage(session, [rust_so], prof_location)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ changelog = "https://cryptography.io/en/latest/changelog/"
ssh = ["bcrypt >=3.1.5"]

# All the following are used for our own testing.
nox = ["nox"]
nox = ["nox", "nox[uv] >=2024.03.02; python_version >= '3.8'"]
test = [
"cryptography_vectors",
"pytest >=6.2.0",
Expand Down

0 comments on commit 5e82862

Please sign in to comment.