Skip to content

Move project URLs back under [project] in pyproject.toml - #303

Merged
ocefpaf merged 1 commit into
TEOS-10:mainfrom
sanjaygrr:fix-project-urls
Nov 4, 2026
Merged

ocefpaf merged 1 commit into
TEOS-10:mainfrom
sanjaygrr:fix-project-urls

Conversation

@sanjaygrr

Copy link
Copy Markdown
Contributor

The urls.* keys currently sit after dev = [...], so TOML puts them in [dependency-groups] instead of [project]. That has two effects on main:

  • uv pip install . (or uv sync) fails to parse the file, since dependency groups must be lists:
    TOML parse error at line 48, column 1
    48 | urls.documentation = "https://teos-10.github.io/GSW-Python/"
    invalid type: map, expected a sequence
    
  • setuptools builds fine but drops the links: an sdist built from main has no Project-URL entries in PKG-INFO, so the next PyPI release would lose the documentation/homepage/repository links (3.6.23 still has them).

This PR moves the three lines back under [project], right after dependencies.

Checked locally:

  • the built sdist has all three Project-URL entries again;
  • uv pip install -e . works, and pytest gsw/tests passes (670 passed) on Python 3.14 with numpy 2.5.4 and pandas 3.1.0;
  • pyproject-fmt 2.30.3 (the version pinned in .pre-commit-config.yaml) leaves the file unchanged.

@DocOtak

DocOtak commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

I think the relocation is good, and would personally prefer these also be under its own table (ping @ocefpaf):

[project.urls]
documentation = "https://teos-10.github.io/GSW-Python/"
homepage = "https://www.teos-10.org/"
repository = "https://github.com/TEOS-10/GSW-python"

This would match the style/examples given in the python packaging guide, in addition to being in a more expected location.

@ocefpaf

ocefpaf commented Nov 4, 2026

Copy link
Copy Markdown
Member

This would match the style/examples given in the python packaging guide, in addition to being in a more expected location.

@DocOtak we are using https://github.com/tox-dev/pyproject-fmt, that is a PyPA blessed tool to lint and fix the pyproject.toml. Looks like this is a case where the software is ahead of the docs. I don't have a strong opinion, but we would need to disable that tool for this to pass.

@ocefpaf
ocefpaf merged commit 31aecc8 into TEOS-10:main Nov 4, 2026
18 checks passed
@DocOtak

DocOtak commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

It's a config if we'd want to change: https://pyproject-fmt.readthedocs.io/en/latest/formatting.html#table-formatting

@ocefpaf

ocefpaf commented Nov 4, 2026

Copy link
Copy Markdown
Member

It's a config if we'd want to change: https://pyproject-fmt.readthedocs.io/en/latest/formatting.html#table-formatting

Sure, I meant the default/desired behavior in the docs. We had the table and the tool chose this one as the preferred/blessed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants