-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from openscm/copier-update-test-pdm
Update copier and try pdm again
- Loading branch information
Showing
17 changed files
with
3,410 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: v0.4.1-63-gd4970ec | ||
_src_path: ../copier-core-python-repository | ||
_commit: v0.7.0 | ||
_src_path: gl:znicholls/copier-core-python-repository | ||
conda_release: false | ||
email: [email protected] | ||
include_cli: false | ||
name: Zebedee Nicholls | ||
notebook_based_docs: true | ||
package_manager: uv | ||
package_manager: pdm | ||
pandas_doctests: false | ||
plot_dependencies: true | ||
project_description_short: Representation of continuous timeseries. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,45 @@ | ||
name: "Setup Python and uv" | ||
description: "setup Python and uv" | ||
name: "Setup Python and pdm" | ||
description: "setup Python and pdm with caches" | ||
|
||
inputs: | ||
python-version: | ||
description: "Python version to use" | ||
required: true | ||
uv-dependency-install-flags: | ||
description: "Flags to pass to uv when running `uv install`" | ||
pdm-dependency-install-flags: | ||
description: "Flags to pass to pdm when running `pdm install`" | ||
required: true | ||
run-uv-install: | ||
description: "Should we run the uv install steps" | ||
run-pdm-install: | ||
description: "Should we run the pdm install steps" | ||
required: false | ||
default: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
- name: Write file with install flags | ||
shell: bash | ||
run: | | ||
echo "${{ inputs.pdm-dependency-install-flags }}" > pdm-install-flags.txt | ||
- name: Setup PDM | ||
id: setup-pdm | ||
uses: pdm-project/[email protected] | ||
with: | ||
version: "0.5.11" | ||
python-version: ${{ inputs.python-version }} | ||
cache: true | ||
cache-dependency-path: | | ||
./pdm.lock | ||
./pdm-install-flags.txt | ||
- name: Install dependencies | ||
shell: bash | ||
if: ${{ (inputs.run-uv-install == 'true') }} | ||
if: ${{ (inputs.run-pdm-install == 'true') && (steps.setup-pdm.outputs.cache-hit != 'true') }} | ||
run: | | ||
pdm install --no-self ${{ inputs.pdm-dependency-install-flags }} | ||
# Now run same command but let the package install too | ||
- name: Install package | ||
shell: bash | ||
# To ensure that the package is always installed, this step is run even if the cache was hit | ||
if: ${{ inputs.run-pdm-install == 'true' }} | ||
run: | | ||
uv sync ${{ inputs.uv-dependency-install-flags }} | ||
pdm install ${{ inputs.pdm-dependency-install-flags }} | ||
pdm run which python | ||
pdm run python --version # Check python version just in case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,33 +20,37 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
uv-dependency-install-flags: "--all-extras --group dev" | ||
pdm-dependency-install-flags: "--group :all --group dev --dev" | ||
- name: mypy | ||
run: | | ||
MYPYPATH=stubs uv run mypy src | ||
MYPYPATH=stubs pdm run mypy src | ||
docs: | ||
if: ${{ !github.event.pull_request.draft }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.11" ] | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.11" | ||
uv-dependency-install-flags: "--all-extras --group docs" | ||
python-version: ${{ matrix.python-version }} | ||
pdm-dependency-install-flags: "--group :all --group docs --dev" | ||
- name: docs | ||
run: | | ||
uv run mkdocs build --strict | ||
pdm run mkdocs build --strict | ||
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.11" | ||
uv-dependency-install-flags: "--all-extras --group docs --group dev" | ||
pdm-dependency-install-flags: "--group :all --group docs --group dev --dev" | ||
- name: docs-with-changelog | ||
run: | | ||
# Check CHANGELOG will build too | ||
uv run towncrier build --yes | ||
uv run mkdocs build --strict | ||
pdm run towncrier build --yes | ||
pdm run mkdocs build --strict | ||
# Just in case, undo the staged changes | ||
git restore --staged . && git restore . | ||
|
@@ -76,11 +80,11 @@ jobs: | |
# when people try to run without installing optional dependencies, | ||
# we should add a CI step that runs the tests without optional dependencies too. | ||
# We don't have that right now, because we're not sure this pain point exists. | ||
uv-dependency-install-flags: "--all-extras --group tests" | ||
pdm-dependency-install-flags: "--group :all --group tests --dev" | ||
- name: Run tests | ||
run: | | ||
uv run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml | ||
uv run coverage report | ||
pdm run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml | ||
pdm run coverage report | ||
- name: Upload coverage reports to Codecov with GitHub Action | ||
uses: codecov/[email protected] | ||
env: | ||
|
@@ -99,42 +103,48 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
uv-dependency-install-flags: "--no-dev" # no extras is default | ||
pdm-dependency-install-flags: "--prod --without :all" | ||
- name: Check importable without extras | ||
run: uv run python scripts/test-install.py | ||
run: pdm run python scripts/test-install.py | ||
|
||
check-build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.11" ] | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/[email protected] | ||
with: | ||
version: "0.5.11" | ||
python-version: "3.9" | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build package | ||
run: | | ||
uv build | ||
pdm build | ||
- name: Check build | ||
run: | | ||
tar -tvf dist/continuous_timeseries-*.tar.gz --wildcards '*continuous_timeseries/py.typed' | ||
tar -tvf dist/continuous_timeseries-*.tar.gz --wildcards 'continuous_timeseries-*/LICENCE' | ||
check-dependency-licences: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.11" ] | ||
runs-on: "${{ matrix.os }}" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.9" | ||
uv-dependency-install-flags: "--group dev" | ||
python-version: ${{ matrix.python-version }} | ||
pdm-dependency-install-flags: "--group dev --dev" | ||
- name: Check licences of dependencies | ||
shell: bash | ||
run: | | ||
TEMP_FILE=$(mktemp) | ||
uv export --no-dev > $TEMP_FILE | ||
uv run liccheck -r $TEMP_FILE -R licence-check.txt | ||
pdm export --prod > $TEMP_FILE | ||
pdm run liccheck -r $TEMP_FILE -R licence-check.txt | ||
cat licence-check.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.9" ] | ||
python-version: [ "3.11" ] | ||
runs-on: "${{ matrix.os }}" | ||
permissions: | ||
# this permission is mandatory for trusted publishing with PyPI | ||
|
@@ -28,13 +28,10 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/[email protected] | ||
with: | ||
version: "0.5.11" | ||
python-version: ${{ matrix.python-version }} | ||
- name: Publish to PyPI | ||
run: | | ||
uv build | ||
uv publish | ||
pdm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,26 +21,24 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/[email protected] | ||
with: | ||
version: "0.5.11" | ||
python-version: ${{ matrix.python-version }} | ||
- name: Add version to environment | ||
run: | | ||
PROJECT_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml` | ||
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | ||
- name: Build package for PyPI | ||
run: | | ||
uv build | ||
pdm build | ||
- name: Generate Release Notes | ||
run: | | ||
echo "" >> ".github/release_template.md" | ||
echo "## Changelog" >> ".github/release_template.md" | ||
echo "" >> ".github/release_template.md" | ||
uv add typer | ||
uv run python scripts/changelog-to-release-template.py >> ".github/release_template.md" | ||
pdm add typer | ||
pdm run python scripts/changelog-to-release-template.py >> ".github/release_template.md" | ||
echo "" >> ".github/release_template.md" | ||
echo "## Changes" >> ".github/release_template.md" | ||
echo "" >> ".github/release_template.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.