Skip to content

Commit

Permalink
Switch to uv export for requirements generation. (#11)
Browse files Browse the repository at this point in the history
* Switch to uv export for requirements generation.

* Remove requirements file

* Use correct matrix variable in CI
  • Loading branch information
nathanjmcdougall authored Sep 1, 2024
1 parent 1eea39b commit 957fb23
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 23 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:

- name: Setup dependencies
run: |
uv pip install --system --break-system-packages -r ./.requirements/${{ matrix.python-version }}-${{ runner.os }}.txt
uv pip install --system --break-system-packages pytest pytest-md pytest-emoji
uv export --resolution ${{ matrix.resolution }} > requirements.txt
uv pip install --system --break-system-packages -r requirements.txt
- name: Run pytest
uses: pavelzw/pytest-action@510c5e90c360a185039bea56ce8b3e7e51a16507 # v2.2.0
Expand All @@ -32,3 +32,4 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.12]
resolution: [highest, lowest-direct]
2 changes: 0 additions & 2 deletions .requirements/3.12-Linux.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .requirements/3.12-Windows.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .requirements/3.12-macOS.txt

This file was deleted.

5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

6 changes: 1 addition & 5 deletions doc/philosophy/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ necessarily listed chronologically):
- Created a develop branch.
- Set up sensible rulesets for branches.
- Created a template for GitHub issues that are development tasks.
- Created a Makefile.
- Created a `make requirements` command to make platform-specific requirements files.
- Ran `uv init --name usethis`.
- Ran `uv python pin 3.12.4`.
- Created a `.requirements` directory with Python version and OS specific files.

## Add GitHub Actions CI

Expand Down Expand Up @@ -64,8 +61,7 @@ on:
- Created a tests folder.
- Added a trivial test module `test_nothing.py`.
- Add a trivial test `test_pass` to the test module.
- Add step to CI to install pytest
- Add step to CI to install pytest-md and pytest-emoji (used by Action).
- Add pytest, pytest-md and pytest-emoji as dev deependencies.
- Confirm pytest is working with `pytest tests` in the CLI.
- Add <https://github.com/pavelzw/pytest-action> to set up pytest in CI, using the
correct CLI args to pytest.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = ["pytest>=8.3.2"]
dev-dependencies = [
"pytest>=8.3.2",
"pytest-md>=0.2.0",
"pytest-emoji>=0.2.0",
]
43 changes: 39 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 957fb23

Please sign in to comment.