From 923f1cf41411bc12d137468ecc3d3207998bf243 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 09:49:03 +0100 Subject: [PATCH 1/4] feat: farewell to OSF, new templates' data go to GIN OSF no longer accepts uploads. `tfmgr add` now: - creates a GIN sibling for the template (needs a GIN access token, --gin-token or GIN_TOKEN); - publishes it as the dataset's common data source (gin-src), so that anyone cloning the GitHub repository (reviewers, the intake previews, the Archive's intake action) gets the data from GIN without extra configuration; - makes the GitHub sibling depend on it, so pushing uploads the data first. The OSF-only commands (push, get, geturls), tfmanager/osf.py, the async upload helpers and the datalad-osf/osfclient dependencies are removed. pkg_resources (gone from recent setuptools) is replaced by importlib, and CI runs on pinned ubuntu-26.04 runners with Python 3.10 to 3.12. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build_docs.yaml | 10 +- .github/workflows/pythonapp.yml | 14 +-- CHANGES.rst | 13 +++ pyproject.toml | 2 +- setup.cfg | 18 ++-- setup.py | 4 +- tfmanager/__init__.py | 10 +- tfmanager/cli.py | 164 +++++++++--------------------- tfmanager/io.py | 84 +-------------- tfmanager/osf.py | 110 -------------------- 10 files changed, 89 insertions(+), 340 deletions(-) delete mode 100644 tfmanager/osf.py diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 6ca9921..251347f 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -12,10 +12,10 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 with: ssh-key: "${{ secrets.NIPREPS_BOT }}" - name: Fetch all tags (for setuptools_scm to work) @@ -23,12 +23,12 @@ jobs: run: | /usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v7 with: - python-version: 3.7 + python-version: '3.12' - name: Build in confined environment and interpolate version run: | - python -m pip install -U pip "setuptools >= 42.0" "setuptools_scm[toml] >= 3.4" + python -m pip install -U pip "setuptools >= 42.0" "setuptools_scm[toml] >= 8" python setup.py --version python -m pip install -r docs/requirements.txt make -C docs/ html diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index e510f67..23bf26f 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -12,13 +12,13 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ['3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 with: ssh-key: "${{ secrets.NIPREPS_BOT }}" - name: Fetch all tags (for setuptools_scm to work) @@ -26,14 +26,14 @@ jobs: run: | /usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Build in confined environment and interpolate version run: | python -m venv /tmp/buildenv source /tmp/buildenv/bin/activate - python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ + python -m pip install "setuptools >= 64" wheel "setuptools_scm[toml] >= 8" \ setuptools_scm_git_archive "pip>=10.0.1" twine docutils python setup.py sdist bdist_wheel python -m twine check dist/tfmanager* @@ -49,7 +49,7 @@ jobs: run: | python -m venv /tmp/install_sdist source /tmp/install_sdist/bin/activate - python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" + python -m pip install "setuptools >= 64" "pip>=10.0.1" python -m pip install dist/tfmanager*.tar.gz INSTALLED_VERSION=$( tfmgr --version ) INSTALLED_VERSION=${INSTALLED_VERSION##* } @@ -61,7 +61,7 @@ jobs: python -m venv /tmp/install_wheel source /tmp/install_wheel/bin/activate # CRUCIAL: pip does not install console scripts from wheels before 20.1b1 - python -m pip install "setuptools ~= 42.0" "pip>=20.1b1" + python -m pip install "setuptools >= 64" "pip>=20.1b1" python -m pip install dist/tfmanager*.whl INSTALLED_VERSION=$( tfmgr --version ) INSTALLED_VERSION=${INSTALLED_VERSION##* } diff --git a/CHANGES.rst b/CHANGES.rst index 9131e85..caf7571 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,16 @@ +Unreleased +========== +Farewell to OSF: OSF no longer accepts uploads, and the TemplateFlow submission +pipeline now stores the data of new templates on GIN (https://gin.g-node.org). + +* ``tfmgr add`` creates a GIN sibling (``--gin-token`` / ``GIN_TOKEN``), publishes it + as the dataset's common data source (``gin-src``), and pushes the data there before + publishing the dataset on GitHub. The OSF options are gone. +* The OSF-only commands ``push``, ``get`` and ``geturls`` are removed, together with + the ``datalad-osf`` and ``osfclient`` dependencies. +* ``pkg_resources`` (removed from recent setuptools) is replaced by ``importlib``. +* CI runs on pinned ``ubuntu-26.04`` runners with Python 3.10 to 3.12. + 20.0.0a0 (April 24, 2020) ========================= First Alpha release. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 451d2ca..accf07a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 42.0", "wheel", "setuptools_scm[toml] >= 3.4"] +requires = ["setuptools >= 64", "wheel", "setuptools_scm[toml] >= 8"] [tool.setuptools_scm] write_to = "tfmanager/_version.py" diff --git a/setup.cfg b/setup.cfg index 9478b46..cc6bcc9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,9 +6,9 @@ classifiers = Intended Audience :: Science/Research Topic :: Scientific/Engineering :: Image Recognition License :: OSI Approved :: BSD License - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 description = TemplateFlow Manager eases the process of contributing to the Archive license = Apache-2.0 long_description = file:README.rst @@ -19,16 +19,16 @@ project_urls = url = https://github.com/templateflow/python-manager [options] -python_requires = >= 3.7 +python_requires = >= 3.10 setup_requires = - setuptools >= 42.0 - setuptools_scm >= 3.4 + setuptools >= 64 + setuptools_scm >= 8 toml install_requires = click - datalad >= 0.14 - datalad_osf >= 0.2 - osfclient + datalad >= 0.16 + nibabel + numpy templateflow >= 0.4.2 toml packages = find: diff --git a/setup.py b/setup.py index 9010928..66f7d95 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,8 @@ extra_args = {} if "bdist_wheel" in sys.argv: extra_args["setup_requires"] = [ - "setuptools >= 42.0", + "setuptools >= 64", "wheel", - "setuptools_scm[toml] >= 3.4", + "setuptools_scm[toml] >= 8", ] setup(**extra_args) diff --git a/tfmanager/__init__.py b/tfmanager/__init__.py index a4df823..87e9a32 100644 --- a/tfmanager/__init__.py +++ b/tfmanager/__init__.py @@ -6,14 +6,14 @@ try: from ._version import __version__ except ModuleNotFoundError: - from pkg_resources import get_distribution, DistributionNotFound + from importlib.metadata import PackageNotFoundError, version try: - __version__ = get_distribution(__packagename__).version - except DistributionNotFound: + __version__ = version(__packagename__) + except PackageNotFoundError: __version__ = "unknown" - del get_distribution - del DistributionNotFound + del version + del PackageNotFoundError __all__ = [ "__copyright__", diff --git a/tfmanager/cli.py b/tfmanager/cli.py index 7101953..87d3370 100644 --- a/tfmanager/cli.py +++ b/tfmanager/cli.py @@ -1,13 +1,13 @@ """CLI.""" import os -from os import cpu_count, getcwd, chdir, getenv +from os import cpu_count, getcwd, chdir import datetime import json from pathlib import Path import click from tempfile import TemporaryDirectory import toml -from pkg_resources import resource_filename as pkgr_fn +from importlib.resources import files as _pkg_files def validate_name(ctx, param, value): @@ -22,15 +22,6 @@ def validate_name(ctx, param, value): return value -def is_set(ctx, param, value): - """Check that an argument is set.""" - if not value: - raise click.BadParameter( - f"Please set it explicitly or define the corresponding environment variable." - ) - return value - - @click.group() @click.version_option(message="TF Archive manager %(version)s") def cli(): @@ -40,14 +31,6 @@ def cli(): @cli.command() @click.argument("template_id", callback=validate_name) -@click.option("--osf-user", envvar="OSF_USERNAME", callback=is_set) -@click.password_option( - "--osf-password", - envvar="OSF_PASSWORD", - prompt="OSF password", - confirmation_prompt=False, -) -@click.option("--osf-overwrite", is_flag=True) @click.option( "--gh-user", envvar="GITHUB_USER", @@ -58,19 +41,27 @@ def cli(): confirmation_prompt=False, envvar="GITHUB_TOKEN", ) +@click.password_option( + "--gin-token", + prompt="GIN access token (https://gin.g-node.org/user/settings/applications)", + confirmation_prompt=False, + envvar="GIN_TOKEN", +) @click.option("--path", type=click.Path(exists=True)) @click.option("-j", "--nprocs", type=click.IntRange(min=1), default=cpu_count()) def add( template_id, - osf_user, - osf_password, - osf_overwrite, gh_user, gh_token, + gin_token, path, nprocs, ): - """Add a new template.""" + """Add a new template. + + The template's data are uploaded to GIN (https://gin.g-node.org), its DataLad dataset + is published on GitHub, and a pull request proposes it to the TemplateFlow Archive. + """ from .io import run_command from .utils import copy_template import shutil @@ -78,8 +69,11 @@ def add( if not gh_user or not gh_token: raise click.BadParameter("Insufficient secrets to login into GitHub") + if not gin_token: + raise click.BadParameter("A GIN access token is needed to upload the data") os.environ["DATALAD_CREDENTIAL_GITHUB_TOKEN"] = gh_token + os.environ["DATALAD_CREDENTIAL_GIN_TOKEN"] = gin_token path = Path(path or f"tpl-{template_id}").absolute() cwd = Path.cwd() @@ -115,7 +109,7 @@ def add( "file before uploading." ) - license_path = Path(pkgr_fn("tfmanager", f"data/{license_prompt}.LICENSE")) + license_path = Path(str(_pkg_files("tfmanager") / "data" / f"{license_prompt}.LICENSE")) metadata["License"] = license_prompt # Check RRID @@ -253,32 +247,41 @@ def add( changes += [changelog.read_text()] changelog.write_text("\n".join(changes)) - # Init OSF sibling - rrid_str = f" (RRID: {metadata['RRID']})" if metadata.get("RRID") else "" - dl.create_sibling_osf( - title=f"TemplateFlow resource: <{template_id}>{rrid_str}", - name="osf", - dataset=f"./tpl-{template_id}", - public=True, - category="data", + dataset = str(repodir / f"tpl-{template_id}") + + # Save added contents + dl.save( + dataset=dataset, + message="ADD: TemplateFlow Manager initialized contents" + ) + + # GIN stores the data (annexed files). Once it holds them, publishing it as the + # dataset's common data source records it in the dataset, so anyone cloning the + # GitHub repository (reviewers, the intake previews, the Archive's intake) gets + # the data from GIN. + dl.create_sibling_gin( + f"tpl-{template_id}", + dataset=dataset, + name="gin", + access_protocol="https-ssh", description=metadata["Name"], - tags=["TemplateFlow dataset", template_id] ) - # Init GH sibling + dl.push(dataset=dataset, to="gin", jobs=cpu_count()) + dl.siblings( + action="configure", + dataset=dataset, + name="gin", + as_common_datasrc="gin-src", + ) + # GitHub holds the dataset (pushing to it updates GIN first) dl.create_sibling_github( reponame=f"tpl-{template_id}", - dataset=str(repodir / f"tpl-{template_id}"), - publish_depends="osf-storage", + dataset=dataset, + publish_depends="gin", existing="replace", access_protocol="ssh" ) - # Save added contents - dl.save( - dataset=str(repodir / f"tpl-{template_id}"), - message="ADD: TemplateFlow Manager initialized contents" - ) - # Push to siblings dl.push( dataset=str(repodir / f"tpl-{template_id}"), @@ -349,82 +352,7 @@ def add( ) del os.environ["DATALAD_CREDENTIAL_GITHUB_TOKEN"] - - -@cli.command() -@click.argument("template_id", callback=validate_name) -@click.option("--osf-project", envvar="OSF_PROJECT", callback=is_set) -@click.option("--osf-user", envvar="OSF_USERNAME", callback=is_set) -@click.password_option( - "--osf-password", - envvar="OSF_PASSWORD", - prompt="OSF password", - confirmation_prompt=False, -) -@click.option("--osf-overwrite", is_flag=True) -@click.option("--path", type=click.Path(exists=True)) -@click.option("-j", "--nprocs", type=click.IntRange(min=1), default=cpu_count()) -def push( - template_id, osf_project, osf_user, osf_password, osf_overwrite, path, nprocs, -): - """Push a new template, but do not create PR.""" - from .osf import upload as _upload - path = Path(path or f"tpl-{template_id}") - - if not path.exists(): - raise click.UsageError(f"<{path}> does not exist.") - - _upload( - template_id, osf_project, osf_user, osf_password, osf_overwrite, path, nprocs, - ) - - -@cli.command() -@click.argument("template_id") -@click.option("--osf-project", envvar="OSF_PROJECT", callback=is_set) -@click.option("--overwrite", is_flag=True) -@click.option("--path", type=click.Path(exists=False)) -@click.option("-j", "--nprocs", type=click.IntRange(min=1), default=cpu_count()) -def get( - template_id, osf_project, overwrite, path, nprocs, -): - """Add a new template.""" - from .osf import get_template as _get - if template_id.startswith("tpl-"): - template_id = template_id[4:] - - path = Path(path or f"tpl-{template_id}") - - if path.name != f"tpl-{template_id}": - path = path / f"tpl-{template_id}" - - if path.exists(): - click.echo(f"WARNING: <{path}> exists.") - - _get(template_id, osf_project, overwrite, path, nprocs) - - -@cli.command() -@click.argument("template_id") -@click.option("--osf-project", envvar="OSF_PROJECT", default="ue5gx") -@click.option("-o", "--out-csv", type=click.Path(exists=False)) -def geturls(template_id, osf_project, out_csv): - """Add a new template.""" - from .osf import get_project_urls - - if template_id.startswith("tpl-"): - template_id = template_id[4:] - - urls = get_project_urls( - f"""\ -https://files.osf.io/v1/resources/{osf_project}/providers/osfstorage/\ -""", - f"tpl-{template_id}", - ) - if out_csv: - Path(out_csv).write_text(urls) - return - print(urls) + del os.environ["DATALAD_CREDENTIAL_GIN_TOKEN"] @cli.command() diff --git a/tfmanager/io.py b/tfmanager/io.py index 80fb71d..9b0ccbd 100644 --- a/tfmanager/io.py +++ b/tfmanager/io.py @@ -1,9 +1,5 @@ """I/O support.""" -import asyncio -from functools import partial -from typing import Sequence, Mapping -from pathlib import Path -from .utils import glob_all as _glob_all +from typing import Mapping def run_command( @@ -28,81 +24,3 @@ def run_command( proc = run(cmd, capture_output=capture_output, shell=True, env=env, cwd=cwd,) return proc - - -@asyncio.coroutine -def run_all( - cmd_list: Sequence[str], - env: Mapping[str, str] = None, - cwd: Path = Path.cwd(), - max_runners: int = 1, -) -> None: - """ - Run all commands in a list. - - :param command_list: List of commands to run. - """ - semaphore = asyncio.Semaphore(max_runners) - - loop = asyncio.get_event_loop() - fs = [run_command_on_loop(loop, semaphore, cmd, env) for cmd in cmd_list] - for f in asyncio.as_completed(fs): - yield from f - - -@asyncio.coroutine -def run_command_on_loop( - loop: asyncio.AbstractEventLoop, - semaphore: asyncio.Semaphore, - command: str, - env: Mapping[str, str] = None, -) -> bool: - """ - Run test for one particular feature, check its result and return report. - - :param loop: Loop to use. - :param command: Command to run. - :return: Result of the command. - """ - with (yield from semaphore): - runner = partial(run_command, cmd=command, env=env) - proc = yield from loop.run_in_executor(None, runner) - filename = proc.args.split(" ")[-1] - is_fetch = "fetch" in proc.args.split(" ") - if proc.returncode == 0: - message = f"{['Uploaded', 'Fetched'][is_fetch]}: {filename}" - else: - error = proc.stderr.decode() - message = f"ERROR:\n{error}" - if "FileExistsError" in error or "already exists" in error: - message = ( - f"WARNING: Did not overwrite <{filename}>, " - f"please consider --{'osf-' * ~is_fetch}overwrite" - ) - print(message) - return proc.returncode - - -@asyncio.coroutine -def upload_all( - osf_cmd: str, - osf_env: Mapping[str, str] = None, - path: Path = Path.cwd(), - max_runners: int = 1, -) -> None: - """ - Run all commands in a list. - - :param command_list: List of commands to run. - """ - semaphore = asyncio.Semaphore(max_runners) - - loop = asyncio.get_event_loop() - fs = [ - run_command_on_loop( - loop, semaphore, f"{osf_cmd} {f} {f.relative_to(path.parent)}", osf_env, - ) - for f in _glob_all(path) - ] - for f in asyncio.as_completed(fs): - yield from f diff --git a/tfmanager/osf.py b/tfmanager/osf.py deleted file mode 100644 index d0d6009..0000000 --- a/tfmanager/osf.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Recursive datalad downloader for OSF.""" -import json -from pathlib import Path -import asyncio -import requests -from .io import upload_all, run_command, run_all - - -OSF_EXTENSIONS = (".nii", ".nii.gz", ".gii") - - -def _osf_get(url): - r = requests.get(url) - if not r.ok: - raise RuntimeError(f"Request <{url}>: ERROR {r.status_code}") - - return json.loads(r.content)["data"] - - -def _osf_getpath(obj, parents=None): - parents = parents or [] - if obj["attributes"]["kind"] == "file" and obj["attributes"]["name"].endswith( - OSF_EXTENSIONS - ): - yield ",".join( - ("/".join(parents + [obj["attributes"]["name"]]), obj["links"]["download"],) - ) - elif obj["attributes"]["kind"] == "folder": - parents += [obj["attributes"]["name"]] - subdata = _osf_get(obj["links"]["move"]) - for subitem in subdata: - yield from _osf_getpath(subitem, parents=parents) - - -def get_project_urls(url, template_id, out_file=None): - """Download the JSON metadata at the target URL into a python dictionary.""" - for folder in _osf_get(url): - if folder["attributes"]["name"] == template_id: - template_url = folder["links"]["move"] - break - else: - raise RuntimeError(f"Template <{template_id}> not found.") - - hits = [] - for p in _osf_get(template_url): - hit = _osf_getpath(p) - if hit is None: - continue - - if isinstance(hit, str): - hits.append(hit) - else: - hits += [h for h in hit if h] - - return "\n".join(["name,link"] + sorted(hits)) - - -def upload( - template_id, osf_project, osf_user, osf_password, osf_overwrite, path, nprocs, -): - """Upload template to OSF.""" - if path.name != f"tpl-{template_id}": - path = path / f"tpl-{template_id}" - - descfile = path / "template_description.json" - if not descfile.exists(): - raise FileNotFoundError(f"Missing template description <{descfile}>") - - osf_env = { - "OSF_PROJECT": osf_project, - "OSF_USERNAME": osf_user, - "OSF_PASSWORD": osf_password, - } - loop = asyncio.get_event_loop() - loop.run_until_complete( - upload_all( - osf_cmd=f"osf upload{' -f' * osf_overwrite}", - path=path, - osf_env=osf_env, - max_runners=nprocs, - ) - ) - return json.loads(descfile.read_text()) - - -def get_template(template_id, osf_project, overwrite, path, nprocs): - """Get full template.""" - osf_env = { - "OSF_PROJECT": osf_project, - } - remote_list = ( - run_command("osf list", env=osf_env, capture_output=True,) - .stdout.decode() - .splitlines() - ) - osf_prefix = f"osfstorage/tpl-{template_id}/" - remote_list = [Path(fname) for fname in remote_list if fname.startswith(osf_prefix)] - dest_files = [(path / fname.relative_to(Path(osf_prefix))) for fname in remote_list] - - loop = asyncio.get_event_loop() - loop.run_until_complete( - run_all( - cmd_list=[ - f"osf fetch{' -f' * overwrite} {remote_file} {local_file}" - for remote_file, local_file in zip(remote_list, dest_files) - ], - env=osf_env, - max_runners=nprocs, - ) - ) From 1d06a28bb293015680fec3aad4c72a70567e937a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 09:57:56 +0100 Subject: [PATCH 2/4] docs: use Sphinx's built-in napoleon extension The standalone sphinxcontrib-napoleon (and the unused sphinxcontrib-versioning) cannot be imported on Python 3.10+, which the docs build now uses. Co-Authored-By: Claude Opus 5.5 --- docs/conf.py | 2 +- docs/requirements.txt | 2 -- setup.cfg | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3d9f06d..7403a1d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,7 +37,7 @@ "sphinx.ext.viewcode", "sphinx_click.ext", "sphinxcontrib.apidoc", - "sphinxcontrib.napoleon", + "sphinx.ext.napoleon", ] autodoc_mock_imports = [ diff --git a/docs/requirements.txt b/docs/requirements.txt index e315558..a73e4d4 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,3 @@ -git+https://github.com/AleksandarPetrov/napoleon.git@0dc3f28a309ad602be5f44a9049785a1026451b3#egg=sphinxcontrib-napoleon -git+https://github.com/rwblair/sphinxcontrib-versioning.git@39b40b0b84bf872fc398feff05344051bbce0f63#egg=sphinxcontrib-versioning nbsphinx packaging pydot>=1.2.3 diff --git a/setup.cfg b/setup.cfg index cc6bcc9..4ce7304 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,8 +56,6 @@ doc = sphinx_rtd_theme sphinx-click sphinxcontrib-apidoc ~= 0.3.0 - sphinxcontrib-napoleon - sphinxcontrib-versioning docs = %(doc)s From f6cf85852abedeaa7b83c6a7255edc5682eb56b7 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 09:59:40 +0100 Subject: [PATCH 3/4] docs: intersphinx mapping in the current Sphinx format Co-Authored-By: Claude Opus 5.5 --- docs/conf.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7403a1d..1f10c9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,7 @@ ] # Accept custom section names to be parsed for numpy-style docstrings -# of parameters. -# Requires pinning sphinxcontrib-napoleon to a specific commit while -# https://github.com/sphinx-contrib/napoleon/pull/10 is merged. +# of parameters (supported by Sphinx's built-in napoleon). napoleon_use_param = False napoleon_custom_sections = [ ("Inputs", "Parameters"), @@ -216,7 +214,7 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # -- Options for versioning extension ---------------------------------------- scv_show_banner = True From 6f9ee48e1302ad8bf053bd77f7ae3c3175b4e291 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 10:09:00 +0100 Subject: [PATCH 4/4] fix: pass the credential names matching the tokens tfmgr sets DataLad looks tokens up by credential name and, without one, uses the API host (gin.g-node.org, api.github.com). The DATALAD_CREDENTIAL_GIN_TOKEN and DATALAD_CREDENTIAL_GITHUB_TOKEN variables set from --gin-token/--gh-token were therefore ignored: DataLad fell back to a stored credential or prompted. Pass credential="gin" and credential="github" (the GitHub call had the same problem before this PR). Co-Authored-By: Claude Opus 5.5 --- tfmanager/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tfmanager/cli.py b/tfmanager/cli.py index 87d3370..43b5f9f 100644 --- a/tfmanager/cli.py +++ b/tfmanager/cli.py @@ -259,9 +259,12 @@ def add( # dataset's common data source records it in the dataset, so anyone cloning the # GitHub repository (reviewers, the intake previews, the Archive's intake) gets # the data from GIN. + # DataLad looks up tokens by credential name; without one, it uses the API host + # (gin.g-node.org, api.github.com) and ignores DATALAD_CREDENTIAL_{GIN,GITHUB}_TOKEN dl.create_sibling_gin( f"tpl-{template_id}", dataset=dataset, + credential="gin", name="gin", access_protocol="https-ssh", description=metadata["Name"], @@ -277,6 +280,7 @@ def add( dl.create_sibling_github( reponame=f"tpl-{template_id}", dataset=dataset, + credential="github", publish_depends="gin", existing="replace", access_protocol="ssh"