cggh / scikit-allel

A Python package for exploring and analysing genetic variation data
MIT License
283 stars 49 forks source link

pyproject.yaml `project` must contain ['name'] properties error #397

Closed risoms closed 11 months ago

risoms commented 1 year ago

We are observing that the pyproject.yaml may be missing the required property name. I've included the Traceback when attempting to install the library.

Collecting scikit-allel>=1.3.2
  Downloading scikit-allel-1.3.6.tar.gz (9.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.7/9.7 MB 79.8 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      [scikit-allel] setup extensions with cython
      Compiling allel/opt/model.pyx because it changed.
      Compiling allel/opt/stats.pyx because it changed.
      Compiling allel/opt/io_vcf_read.pyx because it changed.
      [1/3] Cythonizing allel/opt/io_vcf_read.pyx
      [2/3] Cythonizing allel/opt/model.pyx
      [3/3] Cythonizing allel/opt/stats.pyx
      Traceback (most recent call last):
        File "/opt/repos/<redacted>/ve/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/repos/<redacted>/ve/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/repos/<redacted>/ve/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 100, in <module>
        File "<string>", line 96, in setup_package
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 159, in setup
          dist.parse_config_files()
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 898, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/config/pyprojecttoml.py", line 66, in apply_configuration
          config = read_configuration(filepath, True, ignore_option_errors, dist)
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/config/pyprojecttoml.py", line 128, in read_configuration
          validate(subset, filepath)
        File "/tmp/pip-build-env-7j0_t8v5/overlay/lib/python3.7/site-packages/setuptools/config/pyprojecttoml.py", line 55, in validate
          raise ValueError(f"{error}\n{summary}") from None
      ValueError: invalid pyproject.toml config: `project`.
      configuration error: `project` must contain ['name'] properties
      [end of output]
asgiraldoc commented 1 year ago

I got the same error:

Collecting scikit-allel
  Using cached scikit-allel-1.3.6.tar.gz (9.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      [scikit-allel] setup extensions with cython
      Compiling allel/opt/model.pyx because it changed.
      Compiling allel/opt/stats.pyx because it changed.
      Compiling allel/opt/io_vcf_read.pyx because it changed.
      [1/3] Cythonizing allel/opt/io_vcf_read.pyx
      [2/3] Cythonizing allel/opt/model.pyx
      [3/3] Cythonizing allel/opt/stats.pyx
      Traceback (most recent call last):
        File "/Users/asgiraldoc/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/asgiraldoc/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/asgiraldoc/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 100, in <module>
        File "<string>", line 96, in setup_package
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 159, in setup
          dist.parse_config_files()
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 898, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 66, in apply_configuration
          config = read_configuration(filepath, True, ignore_option_errors, dist)
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 128, in read_configuration
          validate(subset, filepath)
        File "/private/var/folders/0x/t2l6jz6512s8dv0ytz3sc5nm0000gn/T/pip-build-env-zjttdxk9/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 55, in validate
          raise ValueError(f"{error}\n{summary}") from None
      ValueError: invalid pyproject.toml config: `project`.
      configuration error: `project` must contain ['name'] properties
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
leshaker commented 1 year ago

same here

leshaker commented 1 year ago

added a PR to fix it here #398

BinglanLi commented 12 months ago

Is there any plan to merge the pull request and release a fixed version? It would really help.

tcztzy commented 4 months ago

In new version setuptools, pyproject.toml has the higher priority over setup.py or other stuffs, so if I install this package, I will get this error message

--- stdout:
[scikit-allel] setup extensions with cython
--- stderr:
/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: _MissingDynamic: `readme` defined outside of `pyproject.toml` is ignored.
!!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `readme = '``scikit-allel``\n================\n\nA Python package for exploratory analysis of large scale genetic variation data.\n\n* Documentation: http://scikit-allel.readthedocs.org\n* Source code: https://github.com/cggh/scikit-allel\n* Download: https://pypi.python.org/pypi/scikit-allel\n\n.. image:: https://zenodo.org/badge/7890/cggh/scikit-allel.svg\n   :target: https://zenodo.org/badge/latestdoi/7890/cggh/scikit-allel\n\n.. image:: https://readthedocs.org/projects/scikit-allel/badge/?version=latest\n    :target: http://scikit-allel.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://travis-ci.org/cggh/scikit-allel.svg?branch=master\n    :target: https://travis-ci.org/cggh/scikit-allel\n\n.. image:: https://ci.appveyor.com/api/projects/status/1fna2yr9uht0u296?svg=true\n    :target: https://ci.appveyor.com/project/alimanfoo/scikit-allel\n\n\nDevelopment status\n******************\n\nPlease note that scikit-allel is no longer under active development\nand is now in "maintenance-only" mode. The intended successor\nproject is `sgkit <https://github.com/pystatgen/sgkit>`__ (the Statistical\nGenetics Toolkit) which should support all the functionality of sckit-allel,\nbut provide better scaling, performance and maintainability.\nSgkit is not yet at feature parity with scikit-allel and is therefore\nnot ready for all applications, but we welcome `contributions\n<https://pystatgen.github.io/sgkit/latest/contributing.html>`__!\n'`

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `readme` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table

        To prevent this problem, you can list `readme` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
serveral error message for other fields like readme
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 100, in <module>
  File "<string>", line 96, in setup_package
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 159, in setup
    dist.parse_config_files()
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/_virtualenv.py", line 22, in parse_config_files
    result = old_parse_config_files(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 631, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py", line 69, in apply_configuration
    return _apply(dist, config, filepath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 57, in apply
    _apply_project_table(dist, config, root_dir)
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 83, in _apply_project_table
    corresp(dist, value, root_dir)
  File "/Users/tcztzy/Library/Caches/uv/.tmpEikewo/.venv/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 164, in _long_description
    file = val.get("file") or []
           ^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

I fix this installation error by removing the [project] section in pyproject.toml.