From 4ed7cd48496a930b435e68df67e0d9df82a9cfde Mon Sep 17 00:00:00 2001 From: "Fabian H." <73600109+teutoburg@users.noreply.github.com> Date: Mon, 27 Jul 2026 13:21:01 +0200 Subject: [PATCH 1/5] Upgrade Python version to 3.13 in workflow --- .github/workflows/download_data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/download_data.yml b/.github/workflows/download_data.yml index 17b5c4a..cd7fa71 100644 --- a/.github/workflows/download_data.yml +++ b/.github/workflows/download_data.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v7 with: - python-version: 3.11 + python-version: 3.13 - name: Install dependencies run: | python -m pip install --upgrade pip From 5977bbacc2968918e31cf33f2f93028c0213cf18 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Mon, 10 Aug 2026 18:50:03 +0200 Subject: [PATCH 2/5] Use Poetry in pyproject.toml --- pyproject.toml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b4d298..7990f6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,32 +1,42 @@ [project] name = "ScopeSim_Data" -version = "0.0.1-alpha" +version = "0.1.0.dev0" description = "Data often used by ScopeSim and related tools." readme = "README.md" -requires-python = ">=3.8" -license = {text = "License :: OSI Approved :: GNU General Public License v3 (GPLv3)"} +requires-python = ">=3.12, <3.15" +license = "GPL-3.0-or-later" authors = [ - {name = "Hugo Buddelmeijer", email="hugo@buddelmeijer.nl"}, + {name = "Hugo Buddelmeijer", email = "hugo@buddelmeijer.nl"}, ] maintainers = [ - {name = "Kieran Leschinski", email="kieran.leschinski@unive.ac.at"}, - {name = "Hugo Buddelmeijer", email="hugo@buddelmeijer.nl"}, + {name = "Kieran Leschinski", email = "kieran.leschinski@univie.ac.at"}, + {name = "Hugo Buddelmeijer", email = "hugo@buddelmeijer.nl"}, + {name = "Fabian Haberhauer", email = "fabian.haberhauer@univie.ac.at"}, ] -classifiers=[ +dynamic = [ "classifiers" ] +dependencies = [] + +[project.urls] +"Source" = "https://github.com/AstarVienna/ScopeSim_Data" + +[tool.poetry] +package-mode = true # Needs to pretend to be a package to be imported +classifiers = [ "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Astronomy", ] -dependencies = [] -[project.urls] -"Source" = "https://github.com/AstarVienna/ScopeSim_Data" +[tool.poetry.group.test.dependencies] +pytest = "^9.1.1" +pytest-notebook = ">=0.11.0" +myst-nb = "^1.4.0" + +[tool.poetry.scripts] +main_script = { reference = "bin/download_scopesim_data.sh", type = "file" } -# TODO: Figure out whether the below actually puts the script in the PATH somewhere. -[tools.setuptools] -script_files = "bin/download_scopesim_data.sh" +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" -[tool.setuptools.packages] -find = {} From 656e186b870fc2daa9eaa06685f5ef3625af2efb Mon Sep 17 00:00:00 2001 From: teutoburg Date: Mon, 10 Aug 2026 18:52:26 +0200 Subject: [PATCH 3/5] Rely on pip installations of individual packages The reason we previously used the Poetry installs of all of them was that the optional dependencies in the test group can only be installed that way. But this created the problem of versions overwriting each other. It turns out, most of these packages only have pytest (and pytest-cov) in the test dependency group anyway, so if we just install that, we should be fine. --- bin/download_scopesim_data.sh | 44 ++++------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/bin/download_scopesim_data.sh b/bin/download_scopesim_data.sh index bad59a9..c6c1297 100755 --- a/bin/download_scopesim_data.sh +++ b/bin/download_scopesim_data.sh @@ -26,8 +26,6 @@ function cleanup { trap cleanup EXIT - - if [[ $# -gt 1 ]]; then echo "Usage: $0 [data directory]" exit 2 @@ -61,49 +59,13 @@ pipx install poetry==2.4.1 # All poetry files are updated with `poetry update` to ensure we test the latest # versions of our dependencies. -# Pyckles must go first, because otherwise it uninstalls scipy (????). See -# https://stackoverflow.com/questions/67085976/how-to-stop-poetry-from-uninstalling-packages git clone https://github.com/AstarVienna/Pyckles.git -pushd Pyckles -poetry install --with=test,docs -poetry update --with=test,docs -popd - git clone https://github.com/AstarVienna/speXtra.git -pushd speXtra -poetry install --with=test,docs -poetry update --with=test,docs -popd - git clone https://github.com/AstarVienna/ScopeSim.git -pushd ScopeSim -poetry install --with=test,dev,docs -poetry update --with=test,dev,docs -popd - git clone https://github.com/AstarVienna/skycalc_ipy.git -pushd skycalc_ipy -poetry install --with=test,docs -poetry update --with=test,docs -popd - git clone https://github.com/AstarVienna/AnisoCADO.git -pushd AnisoCADO -poetry install --with=test,docs -poetry update --with=test,docs -popd - git clone https://github.com/AstarVienna/ScopeSim_Templates.git -pushd ScopeSim_Templates -poetry install --with=test,dev,docs -poetry update --with=test,dev,docs -popd - git clone https://github.com/AstarVienna/irdb.git -pushd irdb -# irdb doesn't use poetry yet -pip install -r requirements.github_actions.txt -popd # poetry update will upgrade only to the latest versions that are released. # The packages will therefore downgrade each other. @@ -119,7 +81,11 @@ pip install -e ScopeSim pip install -e ScopeSim_Templates pip install -e skycalc_ipy pip install -e AnisoCADO -# pip install -e irdb + +pushd irdb +# irdb doesn't use poetry yet +pip install -r requirements.github_actions.txt +popd # Run the tests. From 6c305b2cb4895b8794d11f8aa05264a720ab4fdb Mon Sep 17 00:00:00 2001 From: teutoburg Date: Mon, 10 Aug 2026 18:56:28 +0200 Subject: [PATCH 4/5] Install Poetry and ScopeSim_Data in the workflow --- .github/workflows/download_data.yml | 13 ++++++++++++- bin/download_scopesim_data.sh | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/download_data.yml b/.github/workflows/download_data.yml index cd7fa71..4dd77a3 100644 --- a/.github/workflows/download_data.yml +++ b/.github/workflows/download_data.yml @@ -24,16 +24,27 @@ jobs: timeout-minutes: 180 steps: - uses: actions/checkout@v7 + + - name: Install poetry + shell: bash + run: pipx install poetry==2.4.1 + - name: Set up Python uses: actions/setup-python@v7 with: python-version: 3.13 + - name: Install dependencies run: | + python -m venv envdata + source envdata/bin/activate python -m pip install --upgrade pip pip install -e . + poetry install + - name: Run download script - run: bash bin/download_scopesim_data.sh + # run: poetry run main_script # doesn't work, with nonsensical message -.- + run: poetry run bash bin/download_scopesim_data.sh # Create a PR with the changes from the above script, if any. - name: Create Pull Request diff --git a/bin/download_scopesim_data.sh b/bin/download_scopesim_data.sh index c6c1297..e69440b 100755 --- a/bin/download_scopesim_data.sh +++ b/bin/download_scopesim_data.sh @@ -49,10 +49,10 @@ mkdir -p "${DIR_DATA}" export SCOPESIM_DATA_CI_FLAG=1 # Create the environment. -pushd "${DIR_WORK}" python -m venv envdata source envdata/bin/activate -pipx install poetry==2.4.1 +pip install -e . +pushd "${DIR_WORK}" # Download and install all the packages. Has to be done from git, because the # releases do not (always) have the test files. From d5e4ab20b70ebc0b0eea62382676b2dd37080755 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Mon, 10 Aug 2026 20:24:16 +0200 Subject: [PATCH 5/5] Fix installation order --- bin/download_scopesim_data.sh | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/bin/download_scopesim_data.sh b/bin/download_scopesim_data.sh index e69440b..9bf4c4b 100755 --- a/bin/download_scopesim_data.sh +++ b/bin/download_scopesim_data.sh @@ -67,26 +67,20 @@ git clone https://github.com/AstarVienna/AnisoCADO.git git clone https://github.com/AstarVienna/ScopeSim_Templates.git git clone https://github.com/AstarVienna/irdb.git -# poetry update will upgrade only to the latest versions that are released. -# The packages will therefore downgrade each other. -# But ScopeSim_Data should use the latest version of all our projects -# (to download the data they need, and to test whether they work together). -# So the projects need to be installed again. -# Note that it is not possible to only use pip, poetry is required to install -# the dependency groups (that is, dev/test/docs). See -# https://stackoverflow.com/questions/76118614/is-it-possible-to-install-poetry-groups-with-pip -pip install -e Pyckles -pip install -e speXtra -pip install -e ScopeSim -pip install -e ScopeSim_Templates -pip install -e skycalc_ipy -pip install -e AnisoCADO - +# These need to be in descending order to avoid overwriting +# a dev install with a released version. pushd irdb # irdb doesn't use poetry yet pip install -r requirements.github_actions.txt popd +pip install -e ScopeSim_Templates +pip install -e ScopeSim +pip install -e speXtra +pip install -e skycalc_ipy +pip install -e Pyckles +pip install -e AnisoCADO + # Run the tests. pushd Pyckles