From 787a11366dbb39f16cdccf2382190caa3a78407e Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 10:21:38 +0100 Subject: [PATCH 01/10] Update __version__.py --- src/easyreflectometry/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/easyreflectometry/__version__.py b/src/easyreflectometry/__version__.py index 19b4f1d6..72837bdc 100644 --- a/src/easyreflectometry/__version__.py +++ b/src/easyreflectometry/__version__.py @@ -1 +1 @@ -__version__ = '1.3.0' +__version__ = '1.3.1' From a3f51145083f8a3806f58b268c261b52065f7eb3 Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 10:31:09 +0100 Subject: [PATCH 02/10] update build python version --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index bc12d4e9..3c0f1a9c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: 3.10 + python-version: 3.12 - name: Install dependencies and build run: | From 3b0bfdc56ed919924064b1b9e17c90659875783a Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 11:02:08 +0100 Subject: [PATCH 03/10] update sphinx version for docs --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 34732349..94ab6b98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ dev = [ docs = [ "myst_parser==4.0.1", "nbsphinx==0.9.7", + "sphinx==7.2.6", # downgraded for compatibility with autodoc-typehints "sphinx_autodoc_typehints==3.0.1", "sphinx_book_theme==1.1.4", "sphinx-copybutton==0.5.2", From a4b247a822565bbbef0222d02acc3eb6cd37b3ee Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 11:38:12 +0100 Subject: [PATCH 04/10] Fix settings to create docs --- docs/src/api/model.rst | 2 +- docs/src/api/sample.rst | 2 +- docs/src/conf.py | 3 ++- pyproject.toml | 6 ++--- src/easyreflectometry/data/__init__.py | 8 +++---- src/easyreflectometry/model/__init__.py | 10 ++++----- src/easyreflectometry/sample/__init__.py | 28 ++++++++++++------------ 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/docs/src/api/model.rst b/docs/src/api/model.rst index 7d1824cb..676cd0c9 100644 --- a/docs/src/api/model.rst +++ b/docs/src/api/model.rst @@ -1,4 +1,4 @@ -.. automodule:: easyreflectometry.experiment.model +.. automodule:: easyreflectometry.model :members: :undoc-members: :show-inheritance: diff --git a/docs/src/api/sample.rst b/docs/src/api/sample.rst index 963cecf8..e3518d9a 100644 --- a/docs/src/api/sample.rst +++ b/docs/src/api/sample.rst @@ -1,5 +1,5 @@ -.. automodule:: easyreflectometry.sample.sample +.. automodule:: easyreflectometry.sample :members: :undoc-members: :show-inheritance: \ No newline at end of file diff --git a/docs/src/conf.py b/docs/src/conf.py index 36235949..5ddb27ce 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -25,7 +25,8 @@ import easyreflectometry -sys.path.insert(0, os.path.abspath('../src')) +# sys.path.insert(0, os.path.abspath('../src')) +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "src")) main_root = Path(__file__).parents[2] sys.path.append(str(main_root)) diff --git a/pyproject.toml b/pyproject.toml index 94ab6b98..4a80d423 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,9 +60,9 @@ dev = [ docs = [ "myst_parser==4.0.1", "nbsphinx==0.9.7", - "sphinx==7.2.6", # downgraded for compatibility with autodoc-typehints - "sphinx_autodoc_typehints==3.0.1", - "sphinx_book_theme==1.1.4", + "sphinx==7.2.6", + "sphinx_autodoc_typehints==1.24.0", # Compatible with sphinx 7.x + "sphinx-book-theme==1.1.4", "sphinx-copybutton==0.5.2", "toml==0.10.2", ] diff --git a/src/easyreflectometry/data/__init__.py b/src/easyreflectometry/data/__init__.py index 18294db3..26c3f270 100644 --- a/src/easyreflectometry/data/__init__.py +++ b/src/easyreflectometry/data/__init__.py @@ -4,8 +4,8 @@ from .measurement import load_as_dataset __all__ = [ - load, - load_as_dataset, - ProjectData, - DataSet1D, + "load", + "load_as_dataset", + "ProjectData", + "DataSet1D", ] diff --git a/src/easyreflectometry/model/__init__.py b/src/easyreflectometry/model/__init__.py index 6b2d8936..baa1aec4 100644 --- a/src/easyreflectometry/model/__init__.py +++ b/src/easyreflectometry/model/__init__.py @@ -5,9 +5,9 @@ from .resolution_functions import ResolutionFunction __all__ = ( - LinearSpline, - PercentageFwhm, - ResolutionFunction, - Model, - ModelCollection, + "LinearSpline", + "PercentageFwhm", + "ResolutionFunction", + "Model", + "ModelCollection", ) diff --git a/src/easyreflectometry/sample/__init__.py b/src/easyreflectometry/sample/__init__.py index 7bb988dd..7de04416 100644 --- a/src/easyreflectometry/sample/__init__.py +++ b/src/easyreflectometry/sample/__init__.py @@ -14,18 +14,18 @@ from .elements.materials.material_solvated import MaterialSolvated __all__ = ( - BaseAssembly, - GradientLayer, - Layer, - LayerAreaPerMolecule, - LayerCollection, - Material, - MaterialCollection, - MaterialDensity, - MaterialMixture, - MaterialSolvated, - Multilayer, - RepeatingMultilayer, - Sample, - SurfactantLayer, + "BaseAssembly", + "GradientLayer", + "Layer", + "LayerAreaPerMolecule", + "LayerCollection", + "Material", + "MaterialCollection", + "MaterialDensity", + "MaterialMixture", + "MaterialSolvated", + "Multilayer", + "RepeatingMultilayer", + "Sample", + "SurfactantLayer", ) From e9643aad2cc382c65d5c697cd056b886b73e202b Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 11:51:26 +0100 Subject: [PATCH 05/10] Update requirements --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4a80d423..95b1e4ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,8 @@ dev = [ docs = [ "myst_parser==4.0.1", "nbsphinx==0.9.7", - "sphinx==7.2.6", - "sphinx_autodoc_typehints==1.24.0", # Compatible with sphinx 7.x + "sphinx<8.2", # Ensures compatibility with sphinx-autodoc-typehints + "sphinx_autodoc_typehints==1.24.0", # Works with sphinx <8.2 "sphinx-book-theme==1.1.4", "sphinx-copybutton==0.5.2", "toml==0.10.2", From d744650ce235c0ae893ed3a3f6aba77a4391da49 Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 11:58:09 +0100 Subject: [PATCH 06/10] force compatible sphinx version --- .github/workflows/documentation-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation-build.yml b/.github/workflows/documentation-build.yml index d628da20..aa08170d 100644 --- a/.github/workflows/documentation-build.yml +++ b/.github/workflows/documentation-build.yml @@ -42,7 +42,7 @@ jobs: - name: Build and Commit uses: sphinx-notes/pages@master with: - install_requirements: true + install_requirements: false documentation_path: docs/src - name: Push changes uses: ad-m/github-push-action@master From 98233557e82333f6ef695e6813551ccfe63a57a8 Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 13:30:26 +0100 Subject: [PATCH 07/10] change sphinx version --- .github/workflows/documentation-build.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation-build.yml b/.github/workflows/documentation-build.yml index aa08170d..d628da20 100644 --- a/.github/workflows/documentation-build.yml +++ b/.github/workflows/documentation-build.yml @@ -42,7 +42,7 @@ jobs: - name: Build and Commit uses: sphinx-notes/pages@master with: - install_requirements: false + install_requirements: true documentation_path: docs/src - name: Push changes uses: ad-m/github-push-action@master diff --git a/pyproject.toml b/pyproject.toml index 95b1e4ba..5ceb3f2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,8 @@ dev = [ docs = [ "myst_parser==4.0.1", "nbsphinx==0.9.7", - "sphinx<8.2", # Ensures compatibility with sphinx-autodoc-typehints - "sphinx_autodoc_typehints==1.24.0", # Works with sphinx <8.2 + "sphinx" + "sphinx_autodoc_typehints" "sphinx-book-theme==1.1.4", "sphinx-copybutton==0.5.2", "toml==0.10.2", From e1b1185f24d901102425e450b4bcb46403498701 Mon Sep 17 00:00:00 2001 From: henrikjacobsenfys Date: Fri, 21 Mar 2025 13:31:51 +0100 Subject: [PATCH 08/10] fix typo --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5ceb3f2e..eebf6063 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,8 @@ dev = [ docs = [ "myst_parser==4.0.1", "nbsphinx==0.9.7", - "sphinx" - "sphinx_autodoc_typehints" + "sphinx", + "sphinx_autodoc_typehints", "sphinx-book-theme==1.1.4", "sphinx-copybutton==0.5.2", "toml==0.10.2", From e3bb8f0c1f077e387d680b1a7fda01a4dc8fb365 Mon Sep 17 00:00:00 2001 From: Christian Dam Vedel <158568093+damskii9992@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:16:05 +0100 Subject: [PATCH 09/10] Try trusted publishing for PyPi uploads --- .github/workflows/python-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3c0f1a9c..a64c28d1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -36,5 +36,5 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_PASSWORD }} + #with: + # password: ${{ secrets.PYPI_PASSWORD }} From 30969c2ea91051ae12b4507059d310a0805852de Mon Sep 17 00:00:00 2001 From: Christian Dam Vedel <158568093+damskii9992@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:21:01 +0100 Subject: [PATCH 10/10] Properly use trusted publishing --- .github/workflows/python-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a64c28d1..dce167b2 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,7 +21,9 @@ jobs: deploy: runs-on: ubuntu-latest - + permissions: + id-token: write + steps: - uses: actions/checkout@v4