Skip to content

Commit 6e9d47f

Browse files
added github actions and readthedocs conf
1 parent b2913f6 commit 6e9d47f

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

.github/workflows/linting.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: imas-python
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout imas-python sources
12+
uses: actions/checkout@v4
13+
with:
14+
ref: rename-imaspy-to-imas
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Display Python version
22+
run: python -c "import sys; print(sys.version)"
23+
24+
- name: Install the code linting and formatting tools
25+
run: pip install --upgrade 'black >=24,<25' flake8
26+
27+
- name: Check formatting of code with black
28+
run: black --check imas
29+
30+
- name: Check linting with flake8
31+
run: flake8 imas

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: build-wheel-and-publish-test-pypi
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.x"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m pip install pip setuptools wheel build
20+
- name: Build a binary wheel and a source tarball
21+
run: python3 -m build .
22+
- name: Store the distribution packages
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: python-package-distributions
26+
path: dist/
27+
28+
publish-to-pypi:
29+
name: Publish imas-python distribution to PyPI
30+
needs:
31+
- build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/p/imas-python
36+
permissions:
37+
id-token: write # IMPORTANT: mandatory for trusted publishing
38+
steps:
39+
- name: Download all the dists
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: python-package-distributions
43+
path: dist/
44+
- name: Publish distribution to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
47+
publish-to-testpypi:
48+
name: Publish imas-python distribution to TestPyPI
49+
needs:
50+
- build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: testpypi
54+
url: https://test.pypi.org/p/imas-python
55+
permissions:
56+
id-token: write # IMPORTANT: mandatory for trusted publishing
57+
steps:
58+
- name: Download all the dists
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: python-package-distributions
62+
path: dist/
63+
- name: Publish distribution to TestPyPI
64+
uses: pypa/gh-action-pypi-publish@unstable/v1
65+
with:
66+
repository-url: https://test.pypi.org/legacy/
67+
verbose: true

.readthedocs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.11"
7+
jobs:
8+
post_checkout:
9+
- git fetch --unshallow || true
10+
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- docs
17+
- netcdf
18+
- h5py
19+
20+
sphinx:
21+
builder: html
22+
configuration: docs/source/conf.py
23+
fail_on_warning: false

0 commit comments

Comments
 (0)