Skip to content

Commit 7326752

Browse files
committed
Update copier template
1 parent de58428 commit 7326752

File tree

13 files changed

+80
-45
lines changed

13 files changed

+80
-45
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v0.11.0
2+
_commit: v0.12.3
33
_src_path: gl:openscm/copier-core-python-repository
44
conda_release: false
55

.github/workflows/ci.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182
run: |
183183
pip install --upgrade pip wheel
184184
pip install .
185-
pip install -r requirements-only-tests-locked.txt
185+
pip install -r requirements-only-tests-min-locked.txt
186186
- name: Run tests
187187
run: |
188188
pytest tests -r a -vv tests
@@ -198,12 +198,17 @@ jobs:
198198
steps:
199199
- name: Check out repository
200200
uses: actions/checkout@v4
201-
- uses: ./.github/actions/setup
201+
- name: Set up Python "${{ matrix.python-version }}"
202+
id: setup-python
203+
uses: actions/setup-python@v4
202204
with:
203-
python-version: ${{ matrix.python-version }}
204-
uv-dependency-install-flags: "--no-dev" # no extras is default
205+
python-version: "${{ matrix.python-version }}"
206+
- name: Install
207+
run: |
208+
pip install --upgrade pip wheel
209+
pip install .
205210
- name: Check importable without extras
206-
run: uv run python scripts/test-install.py
211+
run: python scripts/test-install.py
207212

208213
check-build:
209214
strategy:
@@ -220,6 +225,15 @@ jobs:
220225
with:
221226
version: "0.5.21"
222227
python-version: ${{ matrix.python-version }}
228+
- name: Setup PDM
229+
uses: pdm-project/[email protected]
230+
with:
231+
python-version: ${{ matrix.python-version }}
232+
- name: Generate pdm.lock
233+
# Required for building the locked version of the package
234+
# with pdm-build-locked (see pyproject.toml)
235+
run: |
236+
pdm lock --group :all --strategy inherit_metadata
223237
- name: Build package
224238
run: |
225239
uv build

.github/workflows/deploy.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ jobs:
3434
with:
3535
version: "0.5.21"
3636
python-version: ${{ matrix.python-version }}
37+
- name: Setup PDM
38+
uses: pdm-project/[email protected]
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Generate pdm.lock
42+
# Required for building the locked version of the package
43+
# with pdm-build-locked (see pyproject.toml)
44+
run: |
45+
pdm lock --group :all --strategy inherit_metadata
3746
- name: Publish to PyPI
3847
run: |
3948
uv build

.github/workflows/release.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ jobs:
2727
with:
2828
version: "0.5.21"
2929
python-version: ${{ matrix.python-version }}
30+
- name: Setup PDM
31+
uses: pdm-project/[email protected]
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Generate pdm.lock
35+
# Required for building the locked version of the package
36+
# with pdm-build-locked (see pyproject.toml)
37+
run: |
38+
pdm lock --group :all --strategy inherit_metadata
3039
- name: Add version to environment
3140
run: |
3241
PROJECT_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`

.pre-commit-config.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44
autoupdate_schedule: quarterly
55
autoupdate_branch: pre-commit-autoupdate
66
# Currently network access isn't supported in the pre-commit CI product.
7-
skip: [uv-sync, uv-lock, uv-export, pdm-lock-check]
7+
skip: [uv-sync, uv-lock, uv-export]
88

99
# See https://pre-commit.com/hooks.html for more hooks
1010
repos:
@@ -60,19 +60,3 @@ repos:
6060
args: ["-o", "requirements-only-tests-locked.txt", "--no-hashes", "--no-dev", "--no-emit-project", "--only-group", "tests"]
6161
# # Not released yet
6262
# - id: uv-sync
63-
- repo: https://github.com/pdm-project/pdm
64-
rev: 2.22.1
65-
hooks:
66-
# Update the `pdm.lock` file if needed.
67-
# We need the pdm lock file too
68-
# so that we can build the locked version of the package.
69-
- name: pdm-lock
70-
id: pdm-lock-check
71-
# Overwrite the hook's standard entry point to get the behaviour we want
72-
entry: pdm lock
73-
args: ["--group", ":all", "--strategy", "inherit_metadata"]
74-
files: ^pyproject.toml$
75-
pass_filenames: false
76-
# Double check that the `pdm.lock` file is up to date.
77-
- id: pdm-lock-check
78-
args: ["--group", ":all", "--strategy", "inherit_metadata"]

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ruff-fixes: ## fix the code using ruff
3838

3939
.PHONY: test
4040
test: ## run the tests
41-
uv run pytest src tests -r a -v --doctest-modules --cov=src
41+
uv run pytest src tests -r a -v --doctest-modules --doctest-report ndiff --cov=src
4242

4343
# Note on code coverage and testing:
4444
# You must specify cov=src.
@@ -77,11 +77,6 @@ licence-check: ## Check that licences of the dependencies are suitable
7777
uv run liccheck -r $(TEMP_FILE) -R licence-check.txt
7878
rm -f $(TEMP_FILE)
7979

80-
.PHONY: pdm-lock
81-
pdm-lock: pdm.lock ## create/update the `pdm.lock` file
82-
83-
pdm.lock: pyproject.toml
84-
pdm lock --group :all --strategy inherit_metadata
8580

8681
.PHONY: virtual-environment
8782
virtual-environment: ## update virtual environment, create a new one if it doesn't already exist

docs/NAVIGATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ See https://oprypin.github.io/mkdocs-literate-nav/
1010
- [Run code in a notebook](how-to-guides/run-code-in-a-notebook.py)
1111
- [Tutorials](tutorials/index.md)
1212
- [Further background](further-background/index.md)
13+
- [Dependency pinning and testing](further-background/dependency-pinning-and-testing.md)
1314
- [Development](development.md)
1415
- [API reference](api/gcages/)
1516
- [Changelog](changelog.md)

docs/development.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The steps required are the following:
7474
else
7575

7676
1. Enjoy the newly available version
77+
[TODO: add in conda release instructions]
7778

7879
#### Further details
7980

@@ -82,8 +83,8 @@ while [uv figures out how it wants to support building](https://github.com/astra
8283
This gives us the added benefit that we can use
8384
[pdm-build-locked](https://pdm-build-locked.readthedocs.io/en/stable/)
8485
to build locked versions of our package.
85-
It is for these reasons that we have a pdm pre-commit hook
86-
and a `pdm.lock` file in our repository.
86+
It is for these reasons that we create a `pdm.lock` file
87+
before any step related to building the package in the CI.
8788

8889
## Read the Docs
8990

docs/further-background/dependency-pinning-and-testing.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ In the majority of cases, new releases do not cause issues
2424
so pinning simply forces users to workaround overly strict pins[^1]
2525
(which can be done, see
2626
[working around incorrectly set pins][working-around-incorrectly-set-pins]).
27-
The tradeoff with this approach is
28-
This does run the risk that,
27+
The tradeoff with this approach is that you run the risk that,
2928
if a dependency releases a breaking change,
3029
the function provided by our package may break too.
3130

@@ -128,12 +127,12 @@ Finally, we also check the installation of the locked versions of the package,
128127
i.e. installation with `pip install 'gcages[locked]'`.
129128
These tests give us the greatest coverage of Python versions and operating systems
130129
and help alert us to places where users may face issues.
131-
Having said that, these tests do require 30 separate CI runs,
130+
Having said that, these tests do require 30 separate jobs,
132131
which is why we don't run them in CI.
133132

134133
Through this combination of CI testing and installation testing,
135134
we get a pretty good coverage of the different ways in which our package can be used.
136135
It is not perfect, largely because the combinatorics don't allow for testing everything.
137136
If we find a particular, key, use case failing often,
138137
then we would happily discuss whether this should be included in the CI too,
139-
to catch issues earlier than at user time.
138+
to catch issues in advance of use.

mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ plugins:
8787
- https://docs.scipy.org/doc/scipy/objects.inv
8888
- https://scitools-iris.readthedocs.io/en/stable/objects.inv
8989
- https://scmdata.readthedocs.io/en/stable/objects.inv
90+
# # Not available for tqdm
91+
# # https://github.com/tqdm/tqdm/issues/705
92+
# - https://tqdm.github.io/objects.inv
9093
- https://validators.readthedocs.io/en/stable/objects.inv
9194
- http://xarray.pydata.org/en/stable/objects.inv
9295
options:
@@ -111,6 +114,7 @@ plugins:
111114
markdown_extensions:
112115
# https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#attribute-lists
113116
- attr_list
117+
- footnotes
114118
# https://squidfunk.github.io/mkdocs-material/reference/math/#katex-mkdocsyml
115119
- pymdownx.arithmatex:
116120
generic: true

0 commit comments

Comments
 (0)