Skip to content

Commit 1c8f1b1

Browse files
committed
Merge branch 'master' into joss-paper
2 parents 0c6fa54 + 17a8110 commit 1c8f1b1

File tree

127 files changed

+28346
-4507
lines changed

Some content is hidden

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

127 files changed

+28346
-4507
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
# Check for updates to GitHub Actions every week
13+
interval: "weekly"

.github/workflows/benchmark.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Benchmark
22
on:
33
push:
4-
branches:
5-
- master
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
67

78
permissions:
89
contents: write
@@ -13,23 +14,25 @@ jobs:
1314
name: Run pytest-benchmark benchmark example
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1718
with:
1819
submodules: recursive
19-
- uses: actions/setup-python@v4
20+
- uses: actions/setup-python@v5
2021
with:
21-
python-version: "3.10"
22+
python-version: "3.13"
2223
- name: Install deps
2324
run: |
24-
pip install -r requirements/fitting-requirements.txt
25-
pip install pytest pytest-benchmark pytest-coverage
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
uv pip install --system -r requirements/dev-requirements.txt
27+
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
2628
- name: Install module
2729
run: |
28-
pip install .
30+
uv pip install --system .
2931
- name: Run benchmark
3032
run: |
3133
pytest tests/benchmark*.py --benchmark-json output.json
3234
- name: Store benchmark result
35+
if: github.ref == 'refs/heads/master'
3336
uses: benchmark-action/github-action-benchmark@v1
3437
with:
3538
name: Python Benchmark with pytest-benchmark
@@ -40,5 +43,18 @@ jobs:
4043
auto-push: true
4144
# Show alert with commit comment on detecting possible performance regression
4245
alert-threshold: "200%"
46+
comment-on-alert: false
47+
fail-on-alert: false
48+
- name: Check benchmark threshold
49+
if: github.ref != 'refs/heads/master'
50+
uses: benchmark-action/github-action-benchmark@v1
51+
with:
52+
name: Python Benchmark with pytest-benchmark
53+
tool: "pytest"
54+
output-file-path: output.json
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
auto-push: false
57+
# Show alert with commit comment on detecting possible performance regression
58+
alert-threshold: "200%"
4359
comment-on-alert: true
44-
fail-on-alert: true
60+
fail-on-alert: false

.github/workflows/build-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out the repo
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
with:
1515
submodules: recursive
1616
- name: Log in to Docker Hub

.github/workflows/linting.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@ on:
55
branches: [master]
66

77
jobs:
8-
black-lint:
8+
linting:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: psf/black@stable
13-
sphinx-lint:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-python@v4
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
1813
with:
19-
python-version: "3.10"
14+
python-version: "3.13"
2015
- name: Install deps
2116
run: |
22-
pip install sphinx-lint
17+
pip install sphinx-lint ruff==0.8.5
18+
- name: ruff
19+
run: |
20+
ruff check src/elli tests
21+
- name: ruff formatting
22+
run: |
23+
ruff format --check src/elli tests
2324
- name: Run Sphinx Linting
2425
run: |
2526
sphinx-lint .

.github/workflows/pytest.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ jobs:
1111
test_python:
1212
runs-on: ubuntu-latest
1313
strategy:
14+
fail-fast: false
1415
matrix:
15-
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
16+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920
with:
2021
submodules: recursive
2122
- name: Set up Python ${{ matrix.python_version }}
22-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2324
with:
2425
python-version: ${{ matrix.python_version }}
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
2826
- name: Install module
2927
run: |
30-
pip install .[fitting,testing]
28+
curl -LsSf https://astral.sh/uv/install.sh | sh
29+
uv pip install --system ".[fitting,dev]"
30+
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
3131
- name: Test with pytest
3232
run: |
3333
pytest --nbmake

.github/workflows/python-publish.yml

Lines changed: 80 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,91 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
name: Publish 📦
32

4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Upload Python Package
10-
11-
on:
12-
release:
13-
types: [published]
3+
on: push
144

155
jobs:
16-
deploy:
17-
6+
build:
7+
name: Build distribution 📦
188
runs-on: ubuntu-latest
199

2010
steps:
21-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
2212
with:
2313
submodules: recursive
2414
- name: Set up Python
25-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m
21+
pip install
22+
build
23+
--user
24+
- name: Build a binary wheel and a source tarball
25+
run: python3 -m build
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish to PyPi
35+
if: startsWith(github.ref, 'refs/tags/')
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/pyElli/
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
github-release:
55+
name: >-
56+
GitHub Release
57+
needs:
58+
- publish-to-pypi
59+
runs-on: ubuntu-latest
60+
61+
permissions:
62+
contents: write
63+
id-token: write
64+
65+
steps:
66+
- name: Download all the dists
67+
uses: actions/download-artifact@v4
2668
with:
27-
python-version: '3.x'
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install build
32-
- name: Build package
33-
run: python -m build
34-
- name: Publish package
35-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
69+
name: python-package-distributions
70+
path: dist/
71+
- name: Sign the dists with Sigstore
72+
uses: sigstore/[email protected]
3673
with:
37-
user: __token__
38-
password: ${{ secrets.PYPI_API_TOKEN }}
74+
inputs: >-
75+
./dist/*.tar.gz
76+
./dist/*.whl
77+
- name: Create GitHub Release
78+
env:
79+
GITHUB_TOKEN: ${{ github.token }}
80+
run: >-
81+
gh release create
82+
'${{ github.ref_name }}'
83+
--repo '${{ github.repository }}'
84+
--notes ""
85+
- name: Upload artifact signatures to GitHub Release
86+
env:
87+
GITHUB_TOKEN: ${{ github.token }}
88+
run: >-
89+
gh release upload
90+
'${{ github.ref_name }}' dist/**
91+
--repo '${{ github.repository }}'

.github/workflows/requirements.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check requirements
1+
name: Dev requirements for target python
22

33
on:
44
push:
@@ -8,20 +8,21 @@ jobs:
88
test_python:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
submodules: recursive
14-
- name: Set up Python 3.10
15-
uses: actions/setup-python@v4
14+
- name: Set up Python 3.13
15+
uses: actions/setup-python@v5
1616
with:
17-
python-version: "3.10"
18-
- name: Install dev requirements
17+
python-version: "3.13"
18+
- name: Install package (no deps)
1919
run: |
20-
python -m pip install --upgrade pip
21-
python -m pip install -r requirements/dev-requirements.txt
22-
- name: Install module
20+
curl -LsSf https://astral.sh/uv/install.sh | sh
21+
uv pip install --system --no-deps .[fitting,dev]
22+
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
23+
- name: Install dev requirements
2324
run: |
24-
pip install .[fitting,testing]
25+
uv pip install --system -r requirements/dev-requirements.txt
2526
- name: Test with pytest
2627
run: |
2728
pytest --nbmake

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ __pycache__/*
2222
.pydevproject
2323
.settings
2424
.idea
25-
.vscode
2625
tags
2726

2827
# Package files

.pre-commit-config.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 23.1.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.8.5
45
hooks:
5-
- id: black
6-
language_version: python3.10
7-
# - repo: local
8-
# hooks:
9-
# - id: pylint
10-
# name: pylint
11-
# entry: pylint
12-
# language: system
13-
# types: [python]
14-
# args: ["-rn", "--rcfile", ".pylintrc"]
6+
# Run the linter.
7+
- id: ruff
8+
# Run the formatter.
9+
- id: ruff-format
1510
- repo: local
1611
hooks:
1712
- id: sphinx-lint

.readthedocs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# Required
55
version: 2
66

7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.11"
11+
712
# Build documentation in the docs/ directory with Sphinx
813
sphinx:
914
configuration: docs/conf.py
@@ -17,7 +22,5 @@ formats:
1722
- pdf
1823

1924
python:
20-
version: 3.8
2125
install:
2226
- requirements: docs/requirements.txt
23-
- { path: ., method: pip }

.vscode/ltex.dictionary.en-US.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dispersions
2+
dataframes
3+
ellipsometry

.vscode/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.rulers": [90],
3+
"editor.renderWhitespace": "all",
4+
"editor.tabSize": 4,
5+
"files.trimTrailingWhitespace": true,
6+
"[python]": {
7+
"editor.formatOnSave": true,
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll": "explicit",
10+
"source.organizeImports": "explicit"
11+
},
12+
"editor.defaultFormatter": "charliermarsh.ruff"
13+
},
14+
"python.testing.pytestArgs": ["tests"],
15+
"python.testing.unittestEnabled": false,
16+
"python.testing.pytestEnabled": true
17+
}

0 commit comments

Comments
 (0)