Skip to content

Commit 2645aa0

Browse files
authored
MAINT: update some build steps (#27)
* MAINT: update some build steps * dummy commit for CI * Bump versions for CI * Another attempt to fix the CI * Add gsl to test environment * Remove old python * Add pandoc to pages job
1 parent a97ef5c commit 2645aa0

13 files changed

Lines changed: 84 additions & 308 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "gwmemory 3.14",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.14-trixie",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "latest"
7+
}
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"settings": {
12+
"python.defaultInterpreterPath": "/usr/local/bin/python",
13+
"python.linting.enabled": true
14+
},
15+
"extensions": [
16+
"ms-python.python",
17+
"ms-python.vscode-pylance",
18+
"ms-python.vscode-python-envs",
19+
"GitHub.copilot"
20+
]
21+
}
22+
},
23+
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y libgsl-dev && pip install uv"
24+
}

.github/workflows/pages.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,25 @@ jobs:
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref }}
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v6
2222
- name: Fetch all history for all tags and branches
2323
run: git fetch --prune --unshallow
24-
- uses: s-weigand/setup-conda@v1
24+
- uses: astral-sh/setup-uv@v8.1.0
25+
- name: Setup Python
26+
uses: actions/setup-python@v6
2527
with:
26-
python-version: 3.11
28+
python-version: 3.13
2729

2830
- name: Install dependencies
2931
run: |
3032
sudo apt-get update
31-
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super
32-
conda install pip setuptools
33-
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt --file pages_requirements.txt
34-
python -m pip install nrsur7dq2
35-
- name: Install gwmemory
36-
run: |
37-
pip install .
38-
- name: List installed
39-
run: |
40-
conda list
33+
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super pandoc libgsl-dev
34+
uv sync --extra full --extra docs
4135
4236
- name: Run notebook
4337
run: |
4438
cd examples
45-
jupyter nbconvert --to html --execute *.ipynb
39+
uv run jupyter nbconvert --to html --execute *.ipynb
4640
cd ..
4741
4842
- name: Build documentation
@@ -51,15 +45,15 @@ jobs:
5145
mv Makefile.gh_pages Makefile
5246
cp ../examples/GWMemory.ipynb ./example.ipynb
5347
cp ../examples/Comparison.ipynb ./comparison.ipynb
54-
make clean
55-
make html
48+
uv run make clean
49+
uv run make html
5650
cd ../
5751
touch _gh-pages/latest/html/.nojekyll
5852
rm -r docs
5953
mv _gh-pages/latest/html docs
6054
6155
- name: Deploy
62-
uses: peaceiris/actions-gh-pages@v3
56+
uses: peaceiris/actions-gh-pages@v4
6357
if: ${{ github.ref == 'refs/heads/master' }}
6458
with:
6559
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pypi.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ jobs:
1414
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1515
runs-on: ubuntu-20.04
1616
steps:
17-
- uses: actions/checkout@master
17+
- uses: actions/checkout@v6
1818
- name: Fetch all history for all tags and branches
1919
run: git fetch --prune --unshallow
20-
- name: Set up Python 3.9
21-
uses: actions/setup-python@v2
20+
- name: Set up Python 3.13
21+
uses: actions/setup-python@v6
2222
with:
23-
python-version: 3.9
23+
python-version: 3.13
2424
- name: Install pypa/build
2525
run: >-
2626
python -m pip install build setuptools_scm --user
2727
- name: Build a binary wheel and a source tarball
2828
run: >-
2929
python -m build --sdist --wheel --outdir dist/ .
3030
# - name: Publish distribution 📦 to Test PyPI
31-
# uses: pypa/gh-action-pypi-publish@master
31+
# uses: pypa/gh-action-pypi-publish@v1
3232
# with:
3333
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
3434
# repository_url: https://test.pypi.org/legacy/
3535
- name: Publish distribution 📦 to PyPI
3636
if: startsWith(github.ref, 'refs/tags')
37-
uses: pypa/gh-action-pypi-publish@master
37+
uses: pypa/gh-action-pypi-publish@v1
3838
with:
3939
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/unit_test.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,32 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
python-version: ["3.8", "3.9", "3.10"]
27+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2828

2929
steps:
30-
- uses: actions/checkout@v2
31-
- name: Setup conda
32-
uses: s-weigand/setup-conda@v1
30+
- uses: actions/checkout@v6
31+
- uses: astral-sh/setup-uv@v8.1.0
32+
- name: Setup Python
33+
uses: actions/setup-python@v6
3334
with:
34-
update-conda: true
3535
python-version: ${{ matrix.python-version }}
36-
conda-channels: anaconda, conda-forge
3736
- name: Install dependencies
3837
run: |
39-
conda install pip setuptools
40-
conda install flake8 pytest-cov
41-
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt
42-
python -m pip install nrsur7dq2
43-
- name: Install gwmemory
44-
run: |
45-
pip install .
46-
- name: List installed
47-
run: |
48-
conda list
38+
sudo apt-get install libgsl-dev
39+
uv sync --extra full
4940
- name: Test with pytest
5041
run: |
51-
pytest --cov gwmemory -ra --color yes --cov-report=xml --junitxml=pytest.xml
42+
uv run pytest --cov gwmemory -ra --color yes --cov-report=xml --junitxml=pytest.xml
5243
- name: Publish coverage to Codecov
53-
uses: codecov/codecov-action@v1.2.1
44+
uses: codecov/codecov-action@v6
5445
with:
5546
files: coverage.xml
5647
flags: python${{ matrix.python-version }}
5748
- name: Coverage report
58-
run: python -m coverage report --show-missing
49+
run: uv run python -m coverage report --show-missing
5950
- name: Upload test results
6051
if: always()
61-
uses: actions/upload-artifact@v2
52+
uses: actions/upload-artifact@v7
6253
with:
6354
name: pytest-${{ matrix.python-version }}
6455
path: pytest.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ wheels/
2424
.installed.cfg
2525
*.egg
2626
MANIFEST
27+
uv.lock
2728

2829
# PyInstaller
2930
# Usually these files are written by a python script from a template

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
`GWMemory` is available via `conda-forge` and `pypi`
1212

1313
```console
14+
$ uv pip install gwmemory
1415
$ conda install -c conda-forge gwmemory
1516
$ python -m pip install gwmemory
1617
```
@@ -20,9 +21,11 @@ You can also install from this repository in the usual way:
2021
```console
2122
$ git clone https://github.com/ColmTalbot/gwmemory.git
2223
$ cd gwmemory
23-
$ python -m pip install .
24+
$ uv sync
2425
```
2526

27+
Use `uv sync --extra full` for the optional runtime and test dependencies, and `uv sync --extra full --extra docs` when building the documentation stack.
28+
2629
## Examples
2730

2831
Demonstrations of how to calculate memory waveforms can be found in the [documentation](https://colmtalbot.github.io/gwmemory/) and in the examples directory.

0 commit comments

Comments
 (0)