Skip to content

Commit 2d21aae

Browse files
committed
Update with upstream
2 parents 87cfca8 + 1d305e1 commit 2d21aae

38 files changed

+1042
-603
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.2
2+
current_version = 1.0.3
33
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?
44
serialize =
55
{major}.{minor}.{patch}

.github/workflows/deploy-release.yml

+45-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: Deploy Python Distribution
22

33
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
48
release:
59
types: [published]
610
workflow_dispatch:
711

812
jobs:
9-
build-n-publish:
10-
name: Build and publish Python distribution
13+
build:
14+
name: Build Python distribution
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@master
@@ -21,14 +25,46 @@ jobs:
2125
- name: Build a wheel and a source tarball
2226
run: |
2327
python -m build --sdist --wheel --outdir dist/
24-
- name: Publish distribution to Test PyPI
25-
if: ${{ github.event_name == 'release' }}
26-
uses: pypa/gh-action-pypi-publish@release/v1
28+
- name: Upload artifact
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: gt4py-dist
32+
path: ./dist/**
33+
publish-pypi:
34+
name: Publish Python distribution to pypi.org
35+
runs-on: ubuntu-latest
36+
needs: build
37+
if: ${{ github.event_name == 'workflow_dispatch' }} # the action was triggered manually
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/project/gt4py
41+
permissions:
42+
id-token: write
43+
steps:
44+
- name: Download wheel
45+
uses: actions/download-artifact@v3
2746
with:
28-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
29-
repository_url: https://test.pypi.org/legacy/
47+
name: gt4py-dist
48+
path: dist
3049
- name: Publish distribution to PyPI
31-
if: ${{ github.event_name == 'workflow_dispatch' }}
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
publish-test-pypi:
52+
name: Publish Python distribution to test.pypi.org
53+
runs-on: ubuntu-latest
54+
needs: build
55+
if: ${{ github.event_name == 'release' }} # triggered by releasing on github, test first before manually triggering the deployment to PyPI (see release documentation)
56+
environment:
57+
name: testpypi
58+
url: https://test.pypi.org/project/gt4py/
59+
permissions:
60+
id-token: write
61+
steps:
62+
- name: Download wheel
63+
uses: actions/download-artifact@v3
64+
with:
65+
name: gt4py-dist
66+
path: dist
67+
- name: Publish distribution to Test PyPI
3268
uses: pypa/gh-action-pypi-publish@release/v1
3369
with:
34-
password: ${{ secrets.PYPI_API_TOKEN }}
70+
repository-url: https://test.pypi.org/legacy/

.pre-commit-config.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ repos:
6767
hooks:
6868
- id: black
6969

70+
# - repo: https://github.com/charliermarsh/ruff-pre-commit
71+
# ##[[[cog
72+
# ## import re
73+
# ## version = re.search('ruff==([0-9\.]*)', open("constraints.txt").read())[1]
74+
# ## print(f"# rev: 'v{version}' # version from constraints.txt")
75+
# ##]]]
76+
# rev: 'v0.2.0' # version from constraints.txt
77+
# ##[[[end]]]
78+
# hooks:
79+
# - id: ruff
80+
# # args: [ --fix, --exit-non-zero-on-fix ]
81+
7082
- repo: https://github.com/PyCQA/isort
7183
##[[[cog
7284
## import re
@@ -153,9 +165,13 @@ repos:
153165
- id: mypy
154166
additional_dependencies: # versions from constraints.txt
155167
##[[[cog
156-
## import re, tomli
168+
## import re, sys
169+
## if sys.version_info >= (3, 11):
170+
## import tomllib
171+
## else:
172+
## import tomli as tomllib
157173
## constraints = open("constraints.txt").read()
158-
## project = tomli.loads(open("pyproject.toml").read())
174+
## project = tomllib.loads(open("pyproject.toml").read())
159175
## packages = [re.match('^([\w-][\w\d-]*)', r)[1] for r in project["project"]["dependencies"] if r.strip()]
160176
## for pkg in packages:
161177
## print(f"- {pkg}==" + str(re.search(f'\n{pkg}==([0-9\.]*)', constraints)[1]))

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44

5+
## [1.0.3] - 2024-02-07
6+
7+
### General
8+
9+
- Support for Python 3.11 and updated dependencies
10+
11+
### Testing
12+
13+
- Testing of Jupyter notebooks in CI
14+
15+
### Next
16+
17+
See commit history.
18+
519
## [1.0.2] - 2024-01-24
620

721
### Cartesian

ci/cscs-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stages:
1919
- test
2020

2121
build py38 baseimage:
22-
extends: .container-builder
22+
extends: .container-builder-cscs-zen2
2323
stage: baseimage
2424
# we create a tag that depends on the SHA value of ci/base.Dockerfile, this way
2525
# a new base image is only built when the SHA of this file changes
@@ -52,7 +52,7 @@ build py310 baseimage:
5252
<<: *py310
5353

5454
build py38 image:
55-
extends: .container-builder
55+
extends: .container-builder-cscs-zen2
5656
needs: ["build py38 baseimage"]
5757
stage: image
5858
variables:

constraints.txt

+26-21
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is autogenerated by pip-compile with Python 3.8
33
# by the following command:
44
#
5-
# "tox run -e requirements-common"
5+
# "tox run -e requirements-base"
66
#
77
aenum==3.1.15 # via dace
88
alabaster==0.7.13 # via sphinx
@@ -17,7 +17,7 @@ boltons==23.1.1 # via gt4py (pyproject.toml)
1717
build==1.0.3 # via pip-tools
1818
cached-property==1.5.2 # via gt4py (pyproject.toml)
1919
cachetools==5.3.2 # via tox
20-
certifi==2023.11.17 # via requests
20+
certifi==2024.2.2 # via requests
2121
cffi==1.16.0 # via cryptography
2222
cfgv==3.4.0 # via pre-commit
2323
chardet==5.2.0 # via tox
@@ -29,7 +29,7 @@ cogapp==3.3.0 # via -r requirements-dev.in
2929
colorama==0.4.6 # via tox
3030
comm==0.2.1 # via ipykernel
3131
contourpy==1.1.1 # via matplotlib
32-
coverage==7.4.1 # via -r requirements-dev.in, coverage, pytest-cov
32+
coverage==7.4.1 # via -r requirements-dev.in, pytest-cov
3333
cryptography==42.0.2 # via types-paramiko, types-pyopenssl, types-redis
3434
cycler==0.12.1 # via matplotlib
3535
cytoolz==0.12.3 # via gt4py (pyproject.toml)
@@ -47,7 +47,7 @@ exceptiongroup==1.2.0 # via hypothesis, pytest
4747
execnet==2.0.2 # via pytest-cache, pytest-xdist
4848
executing==2.0.1 # via devtools, stack-data
4949
factory-boy==3.3.0 # via -r requirements-dev.in, pytest-factoryboy
50-
faker==22.6.0 # via factory-boy
50+
faker==22.7.0 # via factory-boy
5151
fastjsonschema==2.19.1 # via nbformat
5252
filelock==3.13.1 # via tox, virtualenv
5353
flake8==7.0.0 # via -r requirements-dev.in, flake8-bugbear, flake8-builtins, flake8-debugger, flake8-docstrings, flake8-eradicate, flake8-mutable, flake8-pyproject, flake8-rst-docstrings
@@ -59,23 +59,25 @@ flake8-eradicate==1.5.0 # via -r requirements-dev.in
5959
flake8-mutable==1.2.0 # via -r requirements-dev.in
6060
flake8-pyproject==1.2.3 # via -r requirements-dev.in
6161
flake8-rst-docstrings==0.3.0 # via -r requirements-dev.in
62-
flask==3.0.1 # via dace
62+
flask==3.0.2 # via dace
6363
fonttools==4.47.2 # via matplotlib
6464
fparser==0.1.4 # via dace
6565
frozendict==2.4.0 # via gt4py (pyproject.toml)
6666
gridtools-cpp==2.3.2 # via gt4py (pyproject.toml)
67-
hypothesis==6.97.3 # via -r requirements-dev.in, gt4py (pyproject.toml)
67+
hypothesis==6.98.2 # via -r requirements-dev.in, gt4py (pyproject.toml)
6868
identify==2.5.33 # via pre-commit
6969
idna==3.6 # via requests
7070
imagesize==1.4.1 # via sphinx
71-
importlib-metadata==7.0.1 # via build, flask, jupyter-client, sphinx
71+
importlib-metadata==7.0.1 # via build, flask, jax, jupyter-client, sphinx
7272
importlib-resources==6.1.1 ; python_version < "3.9" # via gt4py (pyproject.toml), jsonschema, jsonschema-specifications, matplotlib
7373
inflection==0.5.1 # via pytest-factoryboy
7474
iniconfig==2.0.0 # via pytest
75-
ipykernel==6.29.0 # via nbmake
75+
ipykernel==6.29.1 # via nbmake
7676
ipython==8.12.3 # via ipykernel
7777
isort==5.13.2 # via -r requirements-dev.in
7878
itsdangerous==2.1.2 # via flask
79+
jax==0.4.13 # via gt4py (pyproject.toml)
80+
jaxlib==0.4.13 # via jax
7981
jedi==0.19.1 # via ipython
8082
jinja2==3.1.3 # via flask, gt4py (pyproject.toml), sphinx
8183
jsonschema==4.21.1 # via nbformat
@@ -87,12 +89,13 @@ kiwisolver==1.4.5 # via matplotlib
8789
lark==1.1.9 # via gt4py (pyproject.toml)
8890
mako==1.3.2 # via gt4py (pyproject.toml)
8991
markdown-it-py==3.0.0 # via jupytext, mdit-py-plugins
90-
markupsafe==2.1.4 # via jinja2, mako, werkzeug
92+
markupsafe==2.1.5 # via jinja2, mako, werkzeug
9193
matplotlib==3.7.4 # via -r requirements-dev.in
9294
matplotlib-inline==0.1.6 # via ipykernel, ipython
9395
mccabe==0.7.0 # via flake8
9496
mdit-py-plugins==0.4.0 # via jupytext
9597
mdurl==0.1.2 # via markdown-it-py
98+
ml-dtypes==0.2.0 # via jax, jaxlib
9699
mpmath==1.3.0 # via sympy
97100
mypy==1.8.0 # via -r requirements-dev.in
98101
mypy-extensions==1.0.0 # via black, mypy
@@ -104,7 +107,8 @@ nest-asyncio==1.6.0 # via ipykernel, nbclient
104107
networkx==3.1 # via dace
105108
ninja==1.11.1.1 # via gt4py (pyproject.toml)
106109
nodeenv==1.8.0 # via pre-commit
107-
numpy==1.24.4 # via contourpy, dace, gt4py (pyproject.toml), matplotlib, types-jack-client
110+
numpy==1.24.4 # via contourpy, dace, gt4py (pyproject.toml), jax, jaxlib, matplotlib, ml-dtypes, opt-einsum, scipy, types-jack-client
111+
opt-einsum==3.3.0 # via jax
108112
ordered-set==4.1.0 # via deepdiff
109113
packaging==23.2 # via black, build, gt4py (pyproject.toml), ipykernel, jupytext, matplotlib, pyproject-api, pytest, setuptools-scm, sphinx, tox
110114
parso==0.8.3 # via jedi
@@ -136,16 +140,17 @@ pytest==8.0.0 # via -r requirements-dev.in, gt4py (pyproject.toml),
136140
pytest-cache==1.0 # via -r requirements-dev.in
137141
pytest-cov==4.1.0 # via -r requirements-dev.in
138142
pytest-factoryboy==2.6.0 # via -r requirements-dev.in
139-
pytest-xdist==3.5.0 # via -r requirements-dev.in, pytest-xdist
143+
pytest-xdist==3.5.0 # via -r requirements-dev.in
140144
python-dateutil==2.8.2 # via faker, jupyter-client, matplotlib
141-
pytz==2023.4 # via babel
145+
pytz==2024.1 # via babel
142146
pyyaml==6.0.1 # via dace, jupytext, pre-commit
143147
pyzmq==25.1.2 # via ipykernel, jupyter-client
144148
referencing==0.33.0 # via jsonschema, jsonschema-specifications
145149
requests==2.31.0 # via dace, sphinx
146150
restructuredtext-lint==1.4.0 # via flake8-rst-docstrings
147151
rpds-py==0.17.1 # via jsonschema, referencing
148-
ruff==0.1.15 # via -r requirements-dev.in
152+
ruff==0.2.1 # via -r requirements-dev.in
153+
scipy==1.10.1 # via gt4py (pyproject.toml), jax, jaxlib
149154
setuptools-scm==8.0.4 # via fparser
150155
six==1.16.0 # via asttokens, astunparse, python-dateutil
151156
snowballstemmer==2.2.0 # via pydocstyle, sphinx
@@ -163,7 +168,7 @@ stack-data==0.6.3 # via ipython
163168
sympy==1.9 # via dace, gt4py (pyproject.toml)
164169
tabulate==0.9.0 # via gt4py (pyproject.toml)
165170
toml==0.10.2 # via jupytext
166-
tomli==2.0.1 # via -r requirements-dev.in, black, build, coverage, flake8-pyproject, mypy, pip-tools, pyproject-api, pyproject-hooks, pytest, setuptools-scm, tox
171+
tomli==2.0.1 ; python_version < "3.11" # via -r requirements-dev.in, black, build, coverage, flake8-pyproject, mypy, pip-tools, pyproject-api, pyproject-hooks, pytest, setuptools-scm, tox
167172
toolz==0.12.1 # via cytoolz
168173
tornado==6.4 # via ipykernel, jupyter-client
169174
tox==4.12.1 # via -r requirements-dev.in
@@ -175,15 +180,15 @@ types-atomicwrites==1.4.5.1 # via types-all
175180
types-backports==0.1.3 # via types-all
176181
types-backports-abc==0.5.2 # via types-all
177182
types-bleach==6.1.0.1 # via types-all
178-
types-boto==2.49.18.9 # via types-all
183+
types-boto==2.49.18.20240205 # via types-all
179184
types-cachetools==5.3.0.7 # via types-all
180185
types-certifi==2021.10.8.3 # via types-all
181186
types-cffi==1.16.0.20240106 # via types-jack-client
182187
types-characteristic==14.3.7 # via types-all
183188
types-chardet==5.0.4.6 # via types-all
184189
types-click==7.1.8 # via types-all, types-flask
185190
types-click-spinner==0.1.13.20240106 # via types-all
186-
types-colorama==0.4.15.20240106 # via types-all
191+
types-colorama==0.4.15.20240205 # via types-all
187192
types-contextvars==2.4.7.3 # via types-all
188193
types-croniter==2.0.0.20240106 # via types-all
189194
types-cryptography==3.3.23.2 # via types-all, types-openssl-python, types-pyjwt
@@ -193,7 +198,7 @@ types-datetimerange==2.0.0.6 # via types-all
193198
types-decorator==5.1.8.20240106 # via types-all
194199
types-deprecated==1.2.9.20240106 # via types-all
195200
types-docopt==0.6.11.4 # via types-all
196-
types-docutils==0.20.0.20240126 # via types-all
201+
types-docutils==0.20.0.20240201 # via types-all
197202
types-emoji==2.1.0.3 # via types-all
198203
types-enum34==1.1.8 # via types-all
199204
types-fb303==1.0.0 # via types-all, types-scribe
@@ -217,9 +222,9 @@ types-mypy-extensions==1.0.0.5 # via types-all
217222
types-nmap==0.1.6 # via types-all
218223
types-openssl-python==0.1.3 # via types-all
219224
types-orjson==3.6.2 # via types-all
220-
types-paramiko==3.4.0.20240120 # via types-all, types-pysftp
225+
types-paramiko==3.4.0.20240205 # via types-all, types-pysftp
221226
types-pathlib2==2.3.0 # via types-all
222-
types-pillow==10.2.0.20240125 # via types-all
227+
types-pillow==10.2.0.20240206 # via types-all
223228
types-pkg-resources==0.1.3 # via types-all
224229
types-polib==1.2.0.20240115 # via types-all
225230
types-protobuf==4.24.0.20240129 # via types-all
@@ -235,7 +240,7 @@ types-pysftp==0.2.17.20240106 # via types-all
235240
types-python-dateutil==2.8.19.20240106 # via types-all, types-datetimerange
236241
types-python-gflags==3.1.7.3 # via types-all
237242
types-python-slugify==8.0.2.20240127 # via types-all
238-
types-pytz==2023.4.0.20240130 # via types-all, types-tzlocal
243+
types-pytz==2024.1.0.20240203 # via types-all, types-tzlocal
239244
types-pyvmomi==8.0.0.6 # via types-all
240245
types-pyyaml==6.0.12.12 # via types-all
241246
types-redis==4.6.0.20240106 # via types-all
@@ -268,5 +273,5 @@ xxhash==3.0.0 # via gt4py (pyproject.toml)
268273
zipp==3.17.0 # via importlib-metadata, importlib-resources
269274

270275
# The following packages are considered to be unsafe in a requirements file:
271-
pip==23.3.2 # via pip-tools
276+
pip==24.0 # via pip-tools
272277
setuptools==69.0.3 # via gt4py (pyproject.toml), nodeenv, pip-tools, setuptools-scm

docs/development/tools/release.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ Currently, GT4Py releases are published in PyPI (and TestPyPI) and also as commi
1717
4. Commit the changes with the following message:
1818

1919
```bash
20-
$ git commit -m 'Releasing 0.{M}.{m}.{p} version.'
20+
$ git commit -m 'Releasing {M}.{m}.{p} version.'
2121
```
2222

23-
5. On the GitHub website go to _Releases_ and _Draft a new release_. Choose `v0.{M}.{m}.{p}` as tag and select a branch (usually `main`). Follow the style of the previous releases for the title (`GT4Py v0.{M}.{m}.{p}`) and description. Then _Publish release_.
23+
5. On the GitHub website go to _Releases_ and _Draft a new release_. Choose `v{M}.{m}.{p}` as tag and select a branch (usually `main`). Follow the style of the previous releases for the title (`GT4Py v{M}.{m}.{p}`) and description. Then _Publish release_.
2424

25-
6. Upload distribution package to TestPyPI and quickly test that it works properly.
25+
6. Publishing the release will trigger a Github action to deploy to TestPyPI. Install the package from TestPyPi and do basic tests.
2626

27-
7. Upload distribution package to PyPI and quickly that test it works properly.
27+
7. If tests are ok, manually trigger the deploy Github action selecting the release tag as target. This will publish the package to PyPI. Install the package and test if it works.
28+
29+
## PyPi and TestPyPi accounts
30+
31+
The account is called `gridtools`. Credentials can be found in the bitwarden of CSCS. For 2FA, the recovery keys are stored in bitwarden, too. In case a new developer should get access, the recovery keys can be used to setup the authentication app (for all developers who should have access).
2832

2933
<!-- Reference links -->
3034

docs/development/tools/requirements.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The specification of required third-party packages is scattered and partially du
55
The following files in this repository contain information about required third-party packages:
66

77
- `pyproject.toml`: GT4Py [package configuration](https://peps.python.org/pep-0621/) used by the build backend (`setuptools`). Install dependencies are specified in the _project.dependencies_ and _project.optional-dependencies_ tables.
8-
- `requirements-dev.in`: [requirements file](https://pip.pypa.io/en/stable/reference/requirements-file-format/) used by **pip**. It contains a list of packages required for the development of GT4Py. Part of its content is generated automatically from `pyproject.toml` using **cog**.
8+
- `requirements-dev.in`: [requirements file](https://pip.pypa.io/en/stable/reference/requirements-file-format/) used by **pip**. It contains a list of packages required for the development of GT4Py.
99
- `requirements-dev.txt`: requirements file used by **pip**. It contains a completely frozen list of all packages required for installing and developing GT4Py. It is used by **pip** and **tox** to initialize the standard development and testing environments. It is automatically generated automatically from `requirements-dev.in` by **pip-compile**, when running the **tox** environment to update requirements.
1010
- `constraints.txt`: [constraints file](https://pip.pypa.io/en/stable/user_guide/#constraints-files) used by **pip** and **tox** to initialize a subset of the standard development environment making sure that if other packages are installed, transitive dependencies are taken from the frozen package list. It is generated automatically from `requirements-dev.in` using **pip-compile**.
1111
- `min-requirements-test.txt`: requirements file used by **pip**. It contains the minimum list of requirements to run GT4Py tests with the oldest compatible versions of all dependencies. It is generated automatically from `pyproject.toml` using **cog**.
@@ -14,14 +14,14 @@ The following files in this repository contain information about required third-
1414

1515
The expected workflow to update GT4Py requirements is as follows:
1616

17-
1. For changes in the GT4Py package dependencies, update the relevant table in `pyproject.toml`. When modifying the _project.optional-dependencies_ tables, make sure the `full` extra table **always** contains the combined dependencies from all the other extra tables.
17+
1. For changes in the GT4Py package dependencies, update the relevant table in `pyproject.toml`. When adding new tables to the _project.optional-dependencies_ section, make sure to add the new table as a dependency of the `all-` extra tables when possible.
1818

1919
2. For changes in the development tools, update the `requirements-dev.in` file.
2020

21-
3. Run the **tox** _requirements-common_ environment to update all files automatically with **pip-compile** and **cog**. Note that **pip-compile** will most likely update the versions of some unrelated tools if new versions are available in PyPI.
21+
3. Run the **tox** _requirements-base_ environment to update all files automatically with **pip-compile** and **cog**. Note that **pip-compile** will most likely update the versions of some unrelated tools if new versions are available in PyPI.
2222

2323
```bash
24-
tox r -e requirements-common
24+
tox r -e requirements-base
2525
```
2626

2727
4. Check that the **mypy** mirror used by **pre-commit** (https://github.com/pre-commit/mirrors-mypy) in `.pre-commit-config.yaml` supports the same version as in `constraints.txt`, and manually update the `rev` version number.

0 commit comments

Comments
 (0)