Skip to content

Conversation

@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Oct 22, 2025

While trying to package this wonderful program to Nixpkgs, I encountered the need for these 2 changes.

  • Fix licenses identifiers:
  • Standardize scripts definition in pyproject.toml & setup.py

Reference:

keywords = ["dictionary", "glossary"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are lots of these lines on Github. Why do we have to remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I'm not an expert in Python packaging, but I have a bit of experience and it seems counter productive that there are both pyproject.toml and a setup.py. Nowadays, you should be able to get along with only the first. Without this removal, with Nixpkgs' packaging which uses pypa/build, we get the error:

pypa build flags: --no-isolation --outdir dist/ --wheel
* Getting build dependencies for wheel...
/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsWarning: `license` overwritten by `pyproject.toml`
  corresp(dist, value, root_dir)
/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsWarning: `extras_require` overwritten in `pyproject.toml` (optional-dependencies)
  corresp(dist, value, root_dir)
Traceback (most recent call last):
  File "/nix/store/436hp1arg079l5q1l5pifk6mzzj4bcwn-python3.13-pyproject-hooks-1.2.0/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    main()
    ~~~~^^
  File "/nix/store/436hp1arg079l5q1l5pifk6mzzj4bcwn-python3.13-pyproject-hooks-1.2.0/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/436hp1arg079l5q1l5pifk6mzzj4bcwn-python3.13-pyproject-hooks-1.2.0/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
    self.run_setup()
    ~~~~~~~~~~~~~~^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
    exec(code, locals())
    ~~~~^^^^^^^^^^^^^^^^
  File "<string>", line 121, in <module>
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/__init__.py", line 115, in setup
    return distutils.core.setup(**attrs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 160, in setup
    dist.parse_config_files()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/dist.py", line 756, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 73, in apply_configuration
    return _apply(dist, config, filepath)
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 61, in apply
    dist._finalize_license_expression()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/nix/store/a53syg4q2wk1jhw24gqnib37pkgacndy-python3.13-setuptools-80.9.0/lib/python3.13/site-packages/setuptools/dist.py", line 430, in _finalize_license_expression
    raise InvalidConfigError(
    ...<3 lines>...
    )
setuptools.errors.InvalidConfigError: License classifiers have been superseded by license expressions (see https://peps.python.org/pep-0639/). Please remove:

License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel

@ilius ilius changed the title Fix a few packaging details Fix a few packaging details (PEP 639) Oct 22, 2025
@ilius ilius merged commit f86c91e into ilius:master Oct 22, 2025
9 checks passed
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