Skip to content

Commit

Permalink
Use tox-uv (#182)
Browse files Browse the repository at this point in the history
Speedup our environment creation by using `uv` instead of `pip` via
`tox-uv`.

The following times were obtained on my local machine by creating
environments via `tox --devenv toxenv -e audit-py39` (since `audit`
installs all `dev` dependencies):
* tox: 64s
* tox-uv (no cache): 29s
* tox-uv (cached): 4s
  • Loading branch information
AdrianSosic authored Apr 22, 2024
2 parents 7188689 + f5f6c4f commit 725dca5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run linting
run: |
pip install tox
pip install tox-uv
tox -e lint-${{ matrix.py-version.tox }}
build-docs:
Expand All @@ -81,7 +81,7 @@ jobs:
with: {python-version: "3.12"}
- name: Build Docs
run: |
pip install tox
pip install tox-uv
tox -e docs-py312 -- -e
typecheck:
Expand All @@ -99,7 +99,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run type check
run: |
pip install tox
pip install tox-uv
tox -e mypy-${{ matrix.py-version.tox }}
audit:
Expand All @@ -117,7 +117,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run pip-audit
run: |
pip install tox
pip install tox-uv
tox -e audit-${{ matrix.py-version.tox }}
coretest:
Expand All @@ -139,7 +139,7 @@ jobs:
key: coretest-${{ matrix.py-version.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}
- name: Run core tests
run: |
pip install tox
pip install tox-uv
tox -e coretest-${{ matrix.py-version.tox }}
fulltest:
Expand All @@ -161,7 +161,7 @@ jobs:
key: fulltest-${{ matrix.py-version.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}
- name: Run full tests
run: |
pip install tox
pip install tox-uv
tox -e fulltest-${{ matrix.py-version.tox }} -- --cov-report=xml
- name: "Assert Overall Coverage"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with: {python-version: "3.9"}
- name: Build Docs
run: |
pip install tox
pip install tox-uv
tox -e docs-py39
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/regular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with: {python-version: "3.9"}
- name: Build Docs
run: |
pip install tox
pip install tox-uv
tox -e docs-py39
lint:
Expand All @@ -64,7 +64,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run linting
run: |
pip install tox
pip install tox-uv
tox -e lint-${{ matrix.py-version.tox }}
typecheck:
Expand All @@ -86,7 +86,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run type check
run: |
pip install tox
pip install tox-uv
tox -e mypy-${{ matrix.py-version.tox }}
audit:
Expand All @@ -108,7 +108,7 @@ jobs:
python-version: ${{ matrix.py-version.semantic }}
- name: Run pip-audit
run: |
pip install tox
pip install tox-uv
tox -e audit-${{ matrix.py-version.tox }}
coretest:
Expand All @@ -134,7 +134,7 @@ jobs:
key: coretest-${{ matrix.py-version.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}
- name: Run core tests
run: |
pip install tox
pip install tox-uv
tox -e coretest-${{ matrix.py-version.tox }}
fulltest:
Expand All @@ -160,7 +160,7 @@ jobs:
key: fulltest-${{ matrix.py-version.tox }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}
- name: Run full tests
run: |
pip install tox
pip install tox-uv
tox -e fulltest-${{ matrix.py-version.tox }} -- --cov-report=xml
- name: "Assert Overall Coverage"
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bumped `onnx` version to fix vulnerability
- Increased threshold for low-dimensional GP priors
- Replaced `fit_gpytorch_mll_torch` with `fit_gpytorch_mll`
- Use `tox-uv` in pipelines

### Fixed
- `telemetry` dependency is no longer a group (enables Poetry installation)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dev = [
"baybe[simulation]",
"baybe[test]",
"pip-audit>=2.5.5",
"tox>=4.10.0",
"tox-uv>=1.7.0",
]

docs = [
Expand Down

0 comments on commit 725dca5

Please sign in to comment.