-
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 #4 from openscm/switch-to-uv
Switch to uv
- Loading branch information
Showing
16 changed files
with
3,416 additions
and
3,385 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-60-gcf659d9 | ||
_commit: v0.4.1-62-gf6156ea | ||
_src_path: ../copier-core-python-repository | ||
conda_release: false | ||
email: [email protected] | ||
include_cli: false | ||
name: Zebedee Nicholls | ||
notebook_based_docs: true | ||
package_manager: pdm | ||
package_manager: uv | ||
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,45 +1,29 @@ | ||
name: "Setup Python and pdm" | ||
description: "setup Python and pdm with caches" | ||
name: "Setup Python and uv" | ||
description: "setup Python and uv" | ||
|
||
inputs: | ||
python-version: | ||
description: "Python version to use" | ||
required: true | ||
pdm-dependency-install-flags: | ||
description: "Flags to pass to pdm when running `pdm install`" | ||
uv-dependency-install-flags: | ||
description: "Flags to pass to uv when running `uv install`" | ||
required: true | ||
run-pdm-install: | ||
description: "Should we run the pdm install steps" | ||
run-uv-install: | ||
description: "Should we run the uv install steps" | ||
required: false | ||
default: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- 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] | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
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-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' }} | ||
if: ${{ (inputs.run-uv-install == 'true') }} | ||
run: | | ||
pdm install ${{ inputs.pdm-dependency-install-flags }} | ||
pdm run which python | ||
pdm run python --version # Check python version just in case | ||
uv sync ${{ inputs.uv-dependency-install-flags }} |
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,10 +20,10 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
pdm-dependency-install-flags: "--group :all --group dev --dev" | ||
uv-dependency-install-flags: "--all-extras --group dev" | ||
- name: mypy | ||
run: | | ||
MYPYPATH=stubs pdm run mypy src | ||
MYPYPATH=stubs uv run mypy src | ||
docs: | ||
if: ${{ !github.event.pull_request.draft }} | ||
|
@@ -34,19 +34,19 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.11" | ||
pdm-dependency-install-flags: "--group :all --group docs --dev" | ||
uv-dependency-install-flags: "--all-extras --group docs" | ||
- name: docs | ||
run: | | ||
pdm run mkdocs build --strict | ||
uv run mkdocs build --strict | ||
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.11" | ||
pdm-dependency-install-flags: "--group :all --group docs --group dev --dev" | ||
uv-dependency-install-flags: "--all-extras --group docs --group dev" | ||
- name: docs-with-changelog | ||
run: | | ||
# Check CHANGELOG will build too | ||
pdm run towncrier build --yes | ||
pdm run mkdocs build --strict | ||
uv run towncrier build --yes | ||
uv run mkdocs build --strict | ||
# Just in case, undo the staged changes | ||
git restore --staged . && git restore . | ||
|
@@ -76,11 +76,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. | ||
pdm-dependency-install-flags: "--group :all --group tests --dev" | ||
uv-dependency-install-flags: "--all-extras --group tests" | ||
- name: Run tests | ||
run: | | ||
pdm run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml | ||
pdm run coverage report | ||
uv run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml | ||
uv run coverage report | ||
- name: Upload coverage reports to Codecov with GitHub Action | ||
uses: codecov/[email protected] | ||
env: | ||
|
@@ -99,22 +99,24 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
pdm-dependency-install-flags: "--prod --without :all" | ||
uv-dependency-install-flags: "--no-dev" # no extras is default | ||
- name: Check importable without extras | ||
run: pdm run python scripts/test-install.py | ||
run: uv run python scripts/test-install.py | ||
|
||
check-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/[email protected] | ||
- name: Setup uv | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "0.5.11" | ||
python-version: "3.9" | ||
- name: Build package | ||
run: | | ||
pdm build | ||
uv build | ||
- name: Check build | ||
run: | | ||
tar -tvf dist/continuous_timeseries-*.tar.gz --wildcards '*continuous_timeseries/py.typed' | ||
|
@@ -128,11 +130,11 @@ jobs: | |
- uses: ./.github/actions/setup | ||
with: | ||
python-version: "3.9" | ||
pdm-dependency-install-flags: "--group dev --dev" | ||
uv-dependency-install-flags: "--group dev" | ||
- name: Check licences of dependencies | ||
shell: bash | ||
run: | | ||
TEMP_FILE=$(mktemp) | ||
pdm export --prod > $TEMP_FILE | ||
pdm run liccheck -r $TEMP_FILE -R licence-check.txt | ||
uv export --no-dev > $TEMP_FILE | ||
uv 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
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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Switched to uv for environment management. |
Oops, something went wrong.