jdtuck / fdasrsf_python

elastic fda python code
http://research.tetonedge.net
BSD 3-Clause "New" or "Revised" License
52 stars 18 forks source link

installation error: invalid pyproject.toml #23

Closed Quentin62 closed 2 years ago

Quentin62 commented 2 years ago

When running (in a docker with python:3.8 and python:3.9 images)

pip3 install -U fdasrsf

I have this error since today

Collecting fdasrsf
  Using cached fdasrsf-2.3.7.tar.gz (4.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error

  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmpelryhh0r get_requires_for_build_wheel /tmp/tmpv1bzmm5d
       cwd: /tmp/pip-install-qf0uz0qv/fdasrsf
  Complete output (39 lines):
  regenerated: 'build/_DP.c'
  /tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py:100: _ExperimentalProjectMetadata: Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.
    warnings.warn(msg, _ExperimentalProjectMetadata)
  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']

  generating build/_DP.c
  Traceback (most recent call last):
    File "/tmp/tmpelryhh0r", line 280, in <module>
      main()
    File "/tmp/tmpelryhh0r", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/tmp/tmpelryhh0r", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 91, in <module>
      setup(
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 122, in setup
      dist.parse_config_files()
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 836, in parse_config_files
      pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 52, in apply_configuration
      config = read_configuration(filepath, True, ignore_option_errors, dist)
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 114, in read_configuration
      validate(subset, filepath)
    File "/tmp/pip-build-env-9zfv7t3n/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 43, in validate
      raise error from None
  ValueError: invalid pyproject.toml config: `project.license`
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmpelryhh0r get_requires_for_build_wheel /tmp/tmpv1bzmm5d Check the logs for full command output.

when I remove your pyproject.toml, the installation works fine.

It might be related to the new version of setuptools released yesterday

Quentin62 commented 2 years ago

https://peps.python.org/pep-0621/#example

pyproject.toml

[project]
name = "fdasrsf"
version = "2.3.7"
description = "functional data analysis using the square root slope framework"
authors = [
  {email = "jdtuck@sandia.gov"},
  {name = "J. Derek Tucker"}
]
license = {file = "LICENSE.txt"}
readme = "README.md"
requires-python = ">=3.6"

keywords = ["functional data analysis"]

dependencies=[
        "Cython",
        "matplotlib",
        "numpy",
        "scipy",
        "joblib",
        "patsy",
        "tqdm",
        "six",
        "numba",
        "GPy",
        "cffi>=1.0.0",
        "pyparsing",
    ]

classifiers = [
    'License :: OSI Approved :: BSD License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Topic :: Scientific/Engineering',
    'Topic :: Scientific/Engineering :: Mathematics',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.6',
]

[project.urls]
homepage = "http://research.tetonedge.net"
repository = "https://github.com/jdtuck/fdasrsf_python"
documentation = "https://fdasrsf-python.readthedocs.io/en/latest/"

[build-system]
requires = ["setuptools>=46.0", "wheel", "cffi>=1.0.0", "Cython", "numpy"]  # PEP 518 - what is required to build
build-backend = "setuptools.build_meta"
vnmabus commented 2 years ago

I had the same error today, and I have proposed a PR that should fix it: #24.