Skip to content

Conversation

@tpgillam
Copy link
Collaborator

@tpgillam tpgillam commented Jun 2, 2025

Minor tweak to match the specification for the license field: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license

@tpgillam tpgillam requested a review from blankjul June 2, 2025 10:46
@tpgillam tpgillam self-assigned this Jun 2, 2025
@blankjul
Copy link
Collaborator

blankjul commented Jun 7, 2025

does this new definition break anything?

When in the pymoo folder, I ran make compile and without adding the {} expression I got:

ValueError: invalid pyproject.toml config: `project.license`.
configuration error: `project.license` must be valid exactly by one definition (2 matches found):

    - keys:
        'file': {type: string}
      required: ['file']
    - keys:
        'text': {type: string}
      required: ['text']

make: *** [compile] Error 1

@tpgillam
Copy link
Collaborator Author

tpgillam commented Jun 8, 2025

Interesting - reading further at the link above:

If you get a build error that license should be a dict/table, your build backend doesn’t yet support the new format. See the above section for more context. The now deprecated format is described in PEP 621.

From our pyproject.toml, we specify that we should be using setuptools>=77 as our build backend:

pymoo/pyproject.toml

Lines 37 to 39 in ba1f02a

[build-system]
requires = ["setuptools>=77", "numpy", "Cython>=0.29"]
build-backend = "setuptools.build_meta"

Looking at our Makefile, the compile target won't actually make use of this specification. Rather it'll be using whatever python command is on the path when it's run. Can you check that, in this environment, you're using a new enough version of setuptools please?

(A slightly more resilient approach, in my opinion, is to use a tool like uv when developing the package. I find it allows me to be very lazy, since it will automatically keep an environment up-to-date with whatever requirements are specified in the pyproject.toml :) )

@blankjul blankjul merged commit 4861ec5 into main Jun 8, 2025
22 of 23 checks passed
@blankjul
Copy link
Collaborator

blankjul commented Jun 8, 2025

in fact I had a really old version installed. must be during testing. with the new version it actually complains if it is not a string.

@tpgillam tpgillam deleted the tg/license branch October 23, 2025 08:30
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.

2 participants