diff --git a/.gitignore b/.gitignore index e8a4379..042bb07 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ output *.zip git-version.txt git-date.txt +sync_zenodo_inventory.jsonl # Python __pycache__ diff --git a/1_dataset/plan.py b/1_dataset/plan.py index 7113ac7..45a541e 100755 --- a/1_dataset/plan.py +++ b/1_dataset/plan.py @@ -8,12 +8,21 @@ from path import Path from stepup.core.api import copy, glob, hold, loadns, run, shq, static -from stepup.reprep.api import compile_typst, wrap_git +from stepup.reprep.api import compile_typst # Write Git information to text file for inclusion in documents. -static("../.git/") -wrap_git("git describe --tags --match 'v*'", stdout="git-version.txt") -wrap_git("git log -n1 --pretty='format:(%cs %h)'", stdout="git-date.txt") +run( + "git describe --tags --match 'v*' > git-version.txt", + shell=True, + out="git-version.txt", + recheck=True, +) +run( + "git log -n1 --pretty='format:(%cs %h)' > git-date.txt", + shell=True, + out="git-date.txt", + recheck=True, +) # Declare static files static( diff --git a/2_validation/plan.py b/2_validation/plan.py index dc69b0d..58c2339 100755 --- a/2_validation/plan.py +++ b/2_validation/plan.py @@ -8,12 +8,21 @@ from path import Path from stepup.core.api import loadns, run, shq, static -from stepup.reprep.api import compile_typst, wrap_git +from stepup.reprep.api import compile_typst # Write Git information to text file for inclusion in documents. -static("../.git/") -wrap_git("git describe --tags --match 'v*'", stdout="git-version.txt") -wrap_git("git log -n1 --pretty='format:(%cs %h)'", stdout="git-date.txt") +run( + "git describe --tags --match 'v*' > git-version.txt", + shell=True, + out="git-version.txt", + recheck=True, +) +run( + "git log -n1 --pretty='format:(%cs %h)' > git-date.txt", + shell=True, + out="git-date.txt", + recheck=True, +) dataset_path = Path("../1_dataset/") diff --git a/3_zenodo/plan.py b/3_zenodo/plan.py index 934328c..32ab037 100755 --- a/3_zenodo/plan.py +++ b/3_zenodo/plan.py @@ -4,14 +4,14 @@ import os -from stepup.core.api import glob, loadns, static -from stepup.reprep.api import sync_zenodo, wrap_git +from stepup.core.api import glob, loadns, run, static +from stepup.reprep.api import make_inventory, sync_zenodo -static("../.git/") -wrap_git( +run( "git archive --format=zip --output 3_zenodo/main.zip HEAD", out="3_zenodo/main.zip", workdir="../", + recheck=True, ) static("zenodo_description.md", "sync_zenodo.yaml", "../1_dataset/") @@ -25,10 +25,14 @@ *glob("../1_dataset/output/*.zip"), *static("../LICENSES/*.txt"), ] +make_inventory(*archive_paths, "sync_zenodo_inventory.jsonl") official_settings = loadns("../1_dataset/settings.json", do_amend=True) used_settings = loadns("../1_dataset/output/settings.json", do_amend=True) -if official_settings != used_settings and os.getenv("REPREP_ZENODO_TOKEN") is not None: +if official_settings == used_settings: + # Only schedule the sync step with official settings. + # This guarantees that, even if plan.py is skipped upon restarting the workflow, + # no results derived from local settings are accidentally uploaded. + sync_zenodo("sync_zenodo.yaml", "zenodo_description.md", "sync_zenodo_inventory.jsonl") +elif "REPREP_ZENODO_TOKEN" in os.environ: raise RuntimeError("Refusing to upload data generated with local settings.") - -sync_zenodo("sync_zenodo.yaml", archive_paths, path_description="zenodo_description.md") diff --git a/pylock.toml b/pylock.toml index 059be81..7db5b5d 100644 --- a/pylock.toml +++ b/pylock.toml @@ -1131,17 +1131,17 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/f1/7b/ce1eafaf1a76852 [[packages]] name = "stepup" -version = "4.1.0" +version = "4.2.0" index = "https://pypi.org/simple" -sdist = { url = "https://files.pythonhosted.org/packages/1c/b7/09d857cf9a8b0d63113fbac3225f083f2eda794ed2d9e253126128aa3f5f/stepup-4.1.0.tar.gz", upload-time = 2026-11-20T09:11:24Z, size = 464423, hashes = { sha256 = "317bb40c09f9e3ef0a4267a3d264d6086c064bce0f00c522856c0ea524e6b434" } } -wheels = [{ url = "https://files.pythonhosted.org/packages/72/b4/db7f54347c246b698fefeb145612c3d9474d7cdf057b8aa56c9ab02b4d96/stepup-4.1.0-py3-none-any.whl", upload-time = 2026-11-20T09:11:22Z, size = 443650, hashes = { sha256 = "c571a71b587634ddb4f771896f90eacb69c8b492bca00cfc65272343b46b14a3" } }] +sdist = { url = "https://files.pythonhosted.org/packages/43/4c/d7f79df78adda6e96c20fe49653adc7d64a89fc43897b6f833aa0c3405ae/stepup-4.2.0.tar.gz", upload-time = 2026-11-23T07:48:10Z, size = 470409, hashes = { sha256 = "b6f72e6a3e365ed182ee3e252cee2338900f974ccd6401362bcda68fe612a279" } } +wheels = [{ url = "https://files.pythonhosted.org/packages/95/68/b9d37feec90f22a4127f3923425c8399b923fe4d69881c8ff925c15378a5/stepup-4.2.0-py3-none-any.whl", upload-time = 2026-11-23T07:48:09Z, size = 449447, hashes = { sha256 = "c22b96e2256d6ca20fdab1a9fda763a7dc065f0222c2806624f8f4441dbaf0b8" } }] [[packages]] name = "stepup-reprep" -version = "4.1.0" +version = "4.2.0" index = "https://pypi.org/simple" -sdist = { url = "https://files.pythonhosted.org/packages/52/72/e7d77344c9226e4fd19c552da82a8997ae3e4e519f6ef190e0625232218e/stepup_reprep-4.1.0.tar.gz", upload-time = 2026-11-20T10:10:28Z, size = 148423, hashes = { sha256 = "fc6f2d497d7f96bce0a02d11f76a89df771c9a1bbc44be29b4aeac6f2516ec9f" } } -wheels = [{ url = "https://files.pythonhosted.org/packages/4d/98/e033f76dcaacc35b1321200b8f50c504c58308e45ce5fe13041689366a07/stepup_reprep-4.1.0-py3-none-any.whl", upload-time = 2026-11-20T10:10:27Z, size = 130204, hashes = { sha256 = "ae5d721be7ce61e2fa4bd5219cfd786bed48f1d6a3f78f479013bfd1a98ef895" } }] +sdist = { url = "https://files.pythonhosted.org/packages/a3/e2/eee55df0415db7105f5853348d1748569726a3d104fc51f829d0eca5dc94/stepup_reprep-4.2.0.tar.gz", upload-time = 2026-11-23T08:22:38Z, size = 156633, hashes = { sha256 = "9c609a2ff28b26d9781634b57d28e2591d710a4395795180ffef985fa109e953" } } +wheels = [{ url = "https://files.pythonhosted.org/packages/0d/37/24ff3e5a880202f5186728dc58187878cc2c6d355fa418f7a548c0bf9ec6/stepup_reprep-4.2.0-py3-none-any.whl", upload-time = 2026-11-23T08:22:37Z, size = 139459, hashes = { sha256 = "c0fdd748e2f9f2e7d2b2df07fbec4f8974dcd06e66a7154b03195b9f9552a318" } }] [[packages]] name = "svg-path" diff --git a/pyproject.toml b/pyproject.toml index 8f9e8a6..7ac1777 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,8 @@ dependencies = [ "pytest>=9.2.0", "reuse>=6.3.0", "scipy>=1.18.1", - "stepup>=4.1.0", - "stepup-reprep>=4.1.0", + "stepup>=4.2.0", + "stepup-reprep>=4.2.0", ] # Keep consistent with PYTHON_VERSION in setup.sh. requires-python = "==3.14.*" diff --git a/uv.lock b/uv.lock index 0acb97e..52671fa 100644 --- a/uv.lock +++ b/uv.lock @@ -35,8 +35,8 @@ requires-dist = [ { name = "pytest", specifier = ">=9.2.0" }, { name = "reuse", specifier = ">=6.3.0" }, { name = "scipy", specifier = ">=1.18.1" }, - { name = "stepup", specifier = ">=4.1.0" }, - { name = "stepup-reprep", specifier = ">=4.1.0" }, + { name = "stepup", specifier = ">=4.2.0" }, + { name = "stepup-reprep", specifier = ">=4.2.0" }, ] [[package]] @@ -1583,7 +1583,7 @@ wheels = [ [[package]] name = "stepup" -version = "4.1.0" +version = "4.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "asyncinotify", marker = "sys_platform == 'linux'" }, @@ -1596,17 +1596,18 @@ dependencies = [ { name = "rich" }, { name = "watchfiles", marker = "sys_platform != 'linux'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/1c/b7/09d857cf9a8b0d63113fbac3225f083f2eda794ed2d9e253126128aa3f5f/stepup-4.1.0.tar.gz", hash = "sha256:317bb40c09f9e3ef0a4267a3d264d6086c064bce0f00c522856c0ea524e6b434", size = 464423, upload-time = "2026-11-20T09:11:24.587Z" } +sdist = { url = "https://files.pythonhosted.org/packages/43/4c/d7f79df78adda6e96c20fe49653adc7d64a89fc43897b6f833aa0c3405ae/stepup-4.2.0.tar.gz", hash = "sha256:b6f72e6a3e365ed182ee3e252cee2338900f974ccd6401362bcda68fe612a279", size = 470409, upload-time = "2026-11-23T07:48:10.613Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/72/b4/db7f54347c246b698fefeb145612c3d9474d7cdf057b8aa56c9ab02b4d96/stepup-4.1.0-py3-none-any.whl", hash = "sha256:c571a71b587634ddb4f771896f90eacb69c8b492bca00cfc65272343b46b14a3", size = 443650, upload-time = "2026-11-20T09:11:22.819Z" }, + { url = "https://files.pythonhosted.org/packages/95/68/b9d37feec90f22a4127f3923425c8399b923fe4d69881c8ff925c15378a5/stepup-4.2.0-py3-none-any.whl", hash = "sha256:c22b96e2256d6ca20fdab1a9fda763a7dc065f0222c2806624f8f4441dbaf0b8", size = 449447, upload-time = "2026-11-23T07:48:09.232Z" }, ] [[package]] name = "stepup-reprep" -version = "4.1.0" +version = "4.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, + { name = "beautifulsoup4" }, { name = "cattrs" }, { name = "defusedxml" }, { name = "idutils" }, @@ -1623,15 +1624,14 @@ dependencies = [ { name = "pyyaml" }, { name = "pyzmq" }, { name = "requests" }, - { name = "scipy" }, { name = "stepup" }, { name = "svg-path" }, { name = "traitlets" }, { name = "weasyprint" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/52/72/e7d77344c9226e4fd19c552da82a8997ae3e4e519f6ef190e0625232218e/stepup_reprep-4.1.0.tar.gz", hash = "sha256:fc6f2d497d7f96bce0a02d11f76a89df771c9a1bbc44be29b4aeac6f2516ec9f", size = 148423, upload-time = "2026-11-20T10:10:28.993Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/e2/eee55df0415db7105f5853348d1748569726a3d104fc51f829d0eca5dc94/stepup_reprep-4.2.0.tar.gz", hash = "sha256:9c609a2ff28b26d9781634b57d28e2591d710a4395795180ffef985fa109e953", size = 156633, upload-time = "2026-11-23T08:22:38.595Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4d/98/e033f76dcaacc35b1321200b8f50c504c58308e45ce5fe13041689366a07/stepup_reprep-4.1.0-py3-none-any.whl", hash = "sha256:ae5d721be7ce61e2fa4bd5219cfd786bed48f1d6a3f78f479013bfd1a98ef895", size = 130204, upload-time = "2026-11-20T10:10:27.393Z" }, + { url = "https://files.pythonhosted.org/packages/0d/37/24ff3e5a880202f5186728dc58187878cc2c6d355fa418f7a548c0bf9ec6/stepup_reprep-4.2.0-py3-none-any.whl", hash = "sha256:c0fdd748e2f9f2e7d2b2df07fbec4f8974dcd06e66a7154b03195b9f9552a318", size = 139459, upload-time = "2026-11-23T08:22:37.234Z" }, ] [[package]]