Skip to content

Commit 5dfde92

Browse files
committed
Update copier version
1 parent 3e323de commit 5dfde92

29 files changed

Lines changed: 6542 additions & 4162 deletions

.copier-answers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v0.4.0
2+
_commit: v0.14.4
33
_src_path: gl:znicholls/copier-core-python-repository
4+
conda_release: false
45
email: zebedee.nicholls@climate-energy-college.org
56
include_cli: false
67
name: Zebedee Nicholls
78
notebook_based_docs: true
9+
package_manager: uv
810
pandas_doctests: true
911
plot_dependencies: true
1012
project_description_short: Calibration tools for simple climate models (with potential

.github/actions/setup/action.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,29 @@
1-
name: "Setup Python and pdm"
2-
description: "setup Python and pdm with caches"
1+
name: "Setup Python and uv"
2+
description: "setup Python and uv"
33

44
inputs:
55
python-version:
66
description: "Python version to use"
77
required: true
8-
pdm-dependency-install-flags:
9-
description: "Flags to pass to pdm when running `pdm install`"
8+
uv-dependency-install-flags:
9+
description: "Flags to pass to uv when running `uv install`"
1010
required: true
11-
run-pdm-install:
12-
description: "Should we run the pdm install steps"
11+
run-uv-install:
12+
description: "Should we run the uv install steps"
1313
required: false
1414
default: true
1515

1616
runs:
1717
using: "composite"
1818
steps:
19-
- name: Write file with install flags
20-
shell: bash
21-
run: |
22-
echo "${{ inputs.pdm-dependency-install-flags }}" > pdm-install-flags.txt
23-
- name: Setup PDM
24-
id: setup-pdm
25-
uses: pdm-project/setup-pdm@v4.1
19+
- name: Setup uv
20+
id: setup-uv
21+
uses: astral-sh/setup-uv@v4
2622
with:
23+
version: "0.8.8"
2724
python-version: ${{ inputs.python-version }}
28-
# cache: true
29-
# cache-dependency-path: |
30-
# ./pdm.lock
31-
# ./pdm-install-flags.txt
3225
- name: Install dependencies
3326
shell: bash
34-
if: ${{ (inputs.run-pdm-install == 'true') && (steps.setup-pdm.outputs.cache-hit != 'true') }}
35-
run: |
36-
pdm install --no-self ${{ inputs.pdm-dependency-install-flags }}
37-
# Now run same command but let the package install too
38-
- name: Install package
39-
shell: bash
40-
# To ensure that the package is always installed, this step is run even if the cache was hit
41-
if: ${{ inputs.run-pdm-install == 'true' }}
27+
if: ${{ (inputs.run-uv-install == 'true') }}
4228
run: |
43-
pdm install ${{ inputs.pdm-dependency-install-flags }}
44-
pdm run which python
45-
pdm run python --version # Check python version just in case
29+
uv sync ${{ inputs.uv-dependency-install-flags }}

.github/workflows/bump.yaml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,28 @@ on:
55
inputs:
66
bump_rule:
77
type: choice
8-
description: How to bump the project's version (see https://github.com/carstencodes/pdm-bump#usage)
8+
description: How to bump the project's version (see https://docs.astral.sh/uv/reference/cli/#uv-version)
99
options:
10-
- no-pre-release
11-
# no micro because we always sit on a pre-release in main,
12-
# so we would always use no-pre-release instead of micro
13-
# - micro
10+
- patch
1411
- minor
1512
- major
16-
- "pre-release --pre alpha"
17-
- "pre-release --pre beta"
18-
- "pre-release --pre release-candidate"
13+
- stable
14+
- alpha
15+
- beta
16+
- rc
17+
- post
18+
- dev
1919
required: true
2020

2121
jobs:
2222
bump_version:
2323
name: "Bump version and create changelog"
2424
if: "!startsWith(github.event.head_commit.message, 'bump:')"
25-
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
os: [ "ubuntu-latest" ]
28+
python-version: [ "3.11" ]
29+
runs-on: "${{ matrix.os }}"
2630
env:
2731
CI_COMMIT_EMAIL: "ci-runner@openscm-calibration.invalid"
2832
steps:
@@ -32,36 +36,27 @@ jobs:
3236
fetch-depth: 0
3337
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
3438

35-
- name: Setup PDM
36-
uses: pdm-project/setup-pdm@v4
37-
with:
38-
python-version: "3.9"
39-
40-
- name: Install pdm-bump
41-
run: |
42-
pdm self add pdm-bump
43-
4439
- uses: ./.github/actions/setup
4540
with:
4641
python-version: ${{ matrix.python-version }}
47-
pdm-dependency-install-flags: "-G dev"
42+
uv-dependency-install-flags: "--all-extras --group dev"
4843

4944
- name: Create bump and changelog
5045
run: |
5146
git config --global user.name "$GITHUB_ACTOR"
5247
git config --global user.email "$CI_COMMIT_EMAIL"
5348
54-
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
49+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.post]*\)"/\1/p' pyproject.toml`
5550
echo "Bumping from version $BASE_VERSION"
5651
5752
# Bump
58-
pdm bump ${{ github.event.inputs.bump_rule }}
53+
uv version --bump ${{ github.event.inputs.bump_rule }}
5954
60-
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
55+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
6156
echo "Bumping to version $NEW_VERSION"
6257
6358
# Build CHANGELOG
64-
pdm run towncrier build --yes --version v$NEW_VERSION
59+
uv run towncrier build --yes --version v$NEW_VERSION
6560
6661
# Commit, tag and push
6762
git commit -a -m "bump: version $BASE_VERSION -> $NEW_VERSION"
@@ -70,12 +65,12 @@ jobs:
7065
7166
# Bump to alpha (so that future commits do not have the same
7267
# version as the tagged commit)
73-
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
68+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
7469
7570
# Bump to pre-release of next version
76-
pdm bump pre-release --pre alpha
71+
uv version --bump post
7772
78-
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
73+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.post]*\)"/\1/p' pyproject.toml`
7974
echo "Bumping version $BASE_VERSION > $NEW_VERSION"
8075
8176
# Commit and push

0 commit comments

Comments
 (0)