Skip to content

Commit 84ae814

Browse files
Merge pull request #549 from ImperialCollegeLondon/release/0.1.1a5
Release/0.1.1a5
2 parents c4a281c + a6ea336 commit 84ae814

File tree

289 files changed

+29705
-11055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+29705
-11055
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ Fixes # (issue)
2121

2222
- [ ] Code is commented, particularly in hard-to-understand areas
2323
- [ ] Tests added that prove fix is effective or that feature works
24+
- [ ] Relevant documentation reviewed and updated

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Test and build
22

3-
on: [push, pull_request, release]
3+
# When does this run - new, reopened or updated PRs, pushes to main or develop and when
4+
# the workflow is called by another workflow, such as the publishing actions.
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
push:
9+
branches: [main, develop]
10+
workflow_call:
411

512
jobs:
613
qa:
@@ -19,7 +26,7 @@ jobs:
1926
fail-fast: false
2027
matrix:
2128
os: [ ubuntu-latest, macos-latest, windows-latest ]
22-
python-version: [ "3.10", "3.11" ]
29+
python-version: [ "3.10", "3.11", "3.12"]
2330

2431
steps:
2532
- uses: actions/checkout@v4
@@ -63,9 +70,6 @@ jobs:
6370
- name: Install dependencies
6471
run: poetry install
6572

66-
- name: Set ipython kernel
67-
run: poetry run python -m ipykernel install --user --name=vr_python3
68-
6973
- name: Build docs using sphinx
7074
run: |
7175
cd docs

.github/workflows/publish.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Publishing
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
# First, run the standard test suite - for this to work correctly, the workflow needs
9+
# to inherit the organisation secrets used to authenticate to CodeCov.
10+
# https://github.com/actions/runner/issues/1413
11+
test:
12+
uses: ./.github/workflows/ci.yml
13+
secrets: inherit
14+
15+
# Next, build the package wheel and source releases and add them to the release assets
16+
build-wheel:
17+
needs: test
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
# Build the package - this could use `poetry build` directly but pyproject.toml
23+
# already has the build-system configured to use poetry so `pip` should pick that
24+
# up automatically.
25+
- name: Build sdist
26+
run: |
27+
python -m pip install --upgrade build
28+
python -m build
29+
30+
# Upload the build outputs as job artifacts - these will be two files with x.y.z
31+
# version numbers:
32+
# - virtual_ecosystem-x.y.z-py3-none-any.whl
33+
# - virtual_ecosystem-x.y.z.tar.gz
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
path: dist/virtual_ecosystem*
37+
38+
# Add the built files to the release assets, alongside the repo archives
39+
# automatically added by GitHub. These files should then match exactly to the
40+
# published files on PyPI.
41+
- uses: softprops/action-gh-release@v1
42+
with:
43+
files: dist/virtual_ecosystem*
44+
45+
# Now attempt to publish the package to the TestPyPI site, where the virtual_ecosystem
46+
# project has been configured to allow trusted publishing from this repo and workflow.
47+
#
48+
# The skip-existing option allows the publication step to pass even when the release
49+
# files already exists on PyPI. That suggests something has gone wrong with the
50+
# release or the build file staging and the release should not be allowed to continue
51+
# to publish on PyPI.
52+
53+
publish-TestPyPI:
54+
needs: build-wheel
55+
name: Publish virtual_ecosystem to TestPyPI
56+
runs-on: ubuntu-latest
57+
permissions:
58+
id-token: write
59+
60+
steps:
61+
# Download the built package files from the job artifacts
62+
- name: Download sdist artifact
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: artifact
66+
path: dist
67+
68+
# Information step to show the contents of the job artifacts
69+
- name: Display structure of downloaded files
70+
run: ls -R dist
71+
72+
# Use trusted publishing to release the files downloaded into dist to TestPyPI
73+
- name: Publish package distributions to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/
77+
# skip-existing: true
78+
79+
# The final job in the workflow is to publish to the real PyPI as long as the release
80+
# name does not contain the tag 'test-pypi-only'
81+
publish-PyPI:
82+
if: ${{ ! contains(github.event.release.name, 'test-pypi-only')}}
83+
needs: publish-TestPyPI
84+
name: Publish virtual_ecosystem to PyPI
85+
runs-on: ubuntu-latest
86+
permissions:
87+
id-token: write
88+
89+
steps:
90+
# Download the built package files from the job artifacts
91+
- name: Download sdist artifact
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: artifact
95+
path: dist
96+
97+
# Information step to show the contents of the job artifacts
98+
- name: Display structure of downloaded files
99+
run: ls -R dist
100+
101+
# Use trusted publishing to release the files downloaded into dist to PyPI
102+
- name: Publish package distributions to PyPI
103+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ venv.bak/
122122

123123
# mkdocs documentation
124124
/site
125+
docs/source/variables.rst
126+
docs/jupyter_execute/*.png
125127

126128
# mypy
127129
.mypy_cache/
@@ -134,6 +136,5 @@ dmypy.json
134136
# Mac DS Store files
135137
.DS_Store
136138

137-
# PYPI credentials
139+
# Local PyPI authentication tokens
138140
.pypirc
139-

.pre-commit-config.yaml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: check-merge-conflict
66
- id: debug-statements
7-
- repo: https://github.com/PyCQA/isort
8-
rev: "5.13.2"
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.6.2
99
hooks:
10-
- id: isort
11-
additional_dependencies: [toml]
12-
- repo: https://github.com/psf/black
13-
rev: "24.2.0"
14-
hooks:
15-
- id: black
16-
- repo: https://github.com/PyCQA/flake8
17-
rev: 7.0.0
18-
hooks:
19-
- id: flake8
20-
additional_dependencies: [flake8-docstrings]
10+
- id: ruff # Run the linter.
11+
args: [--fix, --exit-non-zero-on-fix]
12+
- id: ruff-format # Run the formatter.
2113
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: "v1.8.0"
14+
rev: "v1.11.2"
2315
hooks:
2416
- id: mypy
25-
additional_dependencies: [types-jsonschema, xarray]
17+
additional_dependencies: [types-jsonschema, xarray, types-tabulate, numpy]
2618
- repo: https://github.com/igorshubovych/markdownlint-cli
27-
rev: v0.39.0
19+
rev: v0.41.0
2820
hooks:
2921
- id: markdownlint
30-
- repo: https://github.com/asottile/pyupgrade
31-
rev: v3.15.1
32-
hooks:
33-
- id: pyupgrade
34-
args: [--py310-plus]
22+

.readthedocs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ build:
2222
# VIRTUAL_ENV needs to be set manually for now.
2323
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
2424
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
25-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry run python -m ipykernel install --user --name=vr_python3
2625

2726
# Build documentation in the docs/ directory with Sphinx
2827
sphinx:

.vscode/extensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"recommendations": [
33
"Gruntfuggly.todo-tree",
44
"ms-python.python",
5-
"ms-python.vscode-pylance",
65
"ms-toolsai.jupyter",
76
"ms-toolsai.jupyter-keymap",
87
"ms-toolsai.jupyter-renderers",
98
"ms-vsliveshare.vsliveshare",
10-
"stkb.rewrap"
9+
"stkb.rewrap",
10+
"charliermarsh.ruff"
1111
]
1212
}

.vscode/settings.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"python.linting.flake8Enabled": true,
3-
"python.linting.mypyEnabled": true,
4-
"python.linting.enabled": true,
5-
"python.formatting.provider": "none",
62
"editor.formatOnSave": true,
73
"editor.rulers": [
84
88
@@ -18,8 +14,7 @@
1814
"workbench.editorAssociations": {
1915
"*.ipynb": "jupyter-notebook"
2016
},
21-
"cSpell.words": [],
2217
"[python]": {
23-
"editor.defaultFormatter": "ms-python.black-formatter"
18+
"editor.defaultFormatter": "charliermarsh.ruff"
2419
},
2520
}
233 KB
Loading
15.6 MB
Loading

0 commit comments

Comments
 (0)