Skip to content

Commit 777fcc3

Browse files
Try custom lockfile approach for now.
1 parent a2f0d66 commit 777fcc3

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ jobs:
1111
- name: Checkout code
1212
uses: actions/checkout@v2
1313

14-
- name: Setup uv and Handle Its Cache
15-
uses: hynek/setup-cached-uv@v2.0.0
14+
- name: Setup uv and handle its cache
15+
uses: hynek/setup-cached-uv@49a39f911c85c6ec0c9aadd5a426ae2761afaba2 # v2.0.0
1616

17-
- name: Install Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: ${{ matrix.python-version }}
17+
- name: Setup dependencies
18+
run: |
19+
uv pip install --system -r ./requirements/{{ matrix.python-version }}-{{ runner.os }}.txt
20+
uv pip install --system pytest pytest-md pytest-emoji
2121
22-
- name: Install Dependencies
23-
run: uv sync --python-preference system
24-
2522
- name: Run pytest
26-
uses: pavelzw/pytest-action@v2.2.0
23+
uses: pavelzw/pytest-action@510c5e90c360a185039bea56ce8b3e7e51a16507 # v2.2.0
2724
with:
2825
custom-arguments: tests
2926
strategy:

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.PHONY requirements:
2+
requirements:
3+
uv pip compile "pyproject.toml" --quiet --generate-hashes --python-version 3.12 --python-platform linux --output-file .requirements/3.12-linux.txt
4+
uv pip compile "pyproject.toml" --quiet --generate-hashes --python-version 3.12 --python-platform macos --output-file .requirements/3.12-macos.txt
5+
uv pip compile "pyproject.toml" --quiet --generate-hashes --python-version 3.12 --python-platform windows --output-file .requirements/3.12-windows.txt

doc/philosophy/introspection.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ necessarily listed chronologically):
1717
## Toolset decisions
1818

1919
- Use GitHub Actions for CI.
20+
- Always use the hash to pin the version of a GitHub action `uses:`
2021
- Use uv for package management.
2122

2223
## Repo configuration
@@ -25,10 +26,13 @@ necessarily listed chronologically):
2526
- Created a develop branch.
2627
- Set up sensible rulesets for branches.
2728
- Created a template for GitHub issues that are development tasks.
29+
- Created a Makefile.
30+
- Created a `make requirements` command to make platform-specific requirements files.
2831
- Ran `uv init --name usethis`.
2932
- Ran `uv python pin 3.12.4`.
33+
- Created a `.requirements` directory with Python version and OS specific files.
3034

31-
## Add GitHub actions CI
35+
## Add GitHub Actions CI
3236

3337
- Create a GitHub workflow file for CI manually in `.github/workflows/ci.yml`.
3438
- Use the following configuration to support GitFlow-style branch management:
@@ -42,9 +46,9 @@ on:
4246
pull_request:
4347
```
4448
45-
- Add <https://github.com/hynek/setup-cached-uv> to set up uv in CI.
49+
- Add <https://github.com/hynek/setup-cached-uv>.
4650
- Add <https://github.com/actions/checkout>.
47-
- Set up the GitHub actions matrix to use Ubuntu, Windows and MacOS
51+
- Set up the GitHub actions matrix to use Ubuntu, Windows and MacOS.
4852
- Set up the GitHub actions to use different Python versions.
4953
- Set up logic to use uv in GitHub actions.
5054
@@ -56,10 +60,12 @@ on:
5660

5761
## Set up tests
5862

59-
- Ran `uv add pytest`.
63+
- Ran `uv add --dev pytest`.
6064
- Created a tests folder.
6165
- Added a trivial test module `test_nothing.py`.
6266
- Add a trivial test `test_pass` to the test module.
67+
- Add step to CI to install pytest
68+
- Add step to CI to install pytest-md and pytest-emoji (used by Action).
6369
- Confirm pytest is working with `pytest tests` in the CLI.
6470
- Add <https://github.com/pavelzw/pytest-action> to set up pytest in CI, using the
6571
correct CLI args to pytest.

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name = "usethis"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = ">=3.11"
7-
dependencies = [
8-
"pytest>=8.3.2",
9-
]
6+
requires-python = ">=3.12"
7+
dependencies = []
108

119
[build-system]
1210
requires = ["hatchling"]
1311
build-backend = "hatchling.build"
12+
13+
[tool.uv]
14+
dev-dependencies = ["pytest>=8.3.2"]

uv.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)