mreineck / ducc

Fork of https://gitlab.mpcdf.mpg.de/mtr/ducc to simplify external contributions
GNU General Public License v2.0
13 stars 12 forks source link

Installation process complains about "invalid pyproject.toml" #10

Closed mreineck closed 1 year ago

mreineck commented 1 year ago

Since a few weeks I'm observing behaviour like the following when building/installing the package:

/usr/lib/python3/dist-packages/setuptools/config/pyprojecttoml.py:129: _InvalidFile: The given `pyproject.toml` file is invalid and would be ignored.
    !!

    ############################
    # Invalid `pyproject.toml` #
    ############################

    Any configurations in `pyproject.toml` will be ignored.
    Please note that future releases of setuptools will halt the build process
    if an invalid file is given.

    To prevent setuptools from considering `pyproject.toml` please
    DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.

!!

  if _skip_bad_config(project_table, orig_setuptools_table, dist):

I have tried various things but didn't manage to get rid of the warning or have Python tell me in which respect pyproject.toml is "invalid".

Since I fear that this will break completely at some point (if I understand correctly, building without pyproject.toml will not work any more in he future), I thought I'd rather ask for expert help now ... @ziotom78, @zonca, do you have any advice?

zonca commented 1 year ago

sorry, don't know how to help here. What happens if you remove the [project] section from pyproject.toml?

mreineck commented 1 year ago

If I remove that, the warning goes away. But according to the warning, this "prevents setuptools from considering pyproject.toml", and if I understand correctly, this is not what I want. (I introduced pyproject.toml only fairly recently, since it was claimed that this was the way to go with Python package configuration...)

mreineck commented 1 year ago

Short update on this: I think I managed to fix the pyproject.tom file. This is what it looks now:

[project]
requires-python = ">=3.7"
name = "ducc0"
readme = "README.md"
authors = [
  {name = "Martin Reinecke", email = "martin@mpa-garching.mpg.de"},
]
dynamic = ["license", "description", "version", "urls", "classifiers"]

[build-system]
requires = ["setuptools >= 40.6.0", "pybind11 >= 2.6.0", "numpy >= 1.17.0"]
build-backend = "setuptools.build_meta"