Skip to content

invalid pyproject.toml #899

Closed
Closed
@Rongronggg9

Description

@Rongronggg9
  • asyncpg version: irrelevant
  • PostgreSQL version: irrelevant
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce the issue with a local PostgreSQL install?: irrelevant
  • Python version: Python 3.10.3 (main, Mar 18 2022, 05:09:31) [GCC 10.2.1 20210110] on linux
  • Platform: Linux ecd864aa501c 5.10.60-sunxi64 #21.08.1 SMP Wed Aug 25 18:29:57 UTC 2021 aarch64 GNU/Linux
  • Do you use pgbouncer?: irrelevant
  • Did you install asyncpg with pip?: yes
  • If you built asyncpg locally, which version of Cython did you use?: irrelevant
  • Can the issue be reproduced under both asyncio and uvloop?: irrelevant

In most cases, it is not really a problem because we have prebuilt wheels. However, this is not true for aarch64 (#870). I'd always built it by myself, but after a recent update of Python (or setuptools or some other?), I could never build it successfully.

After some tests, I found this issue occurs on amd64 too.

According to PEP 621, [project] must contain the name of the project.


sudo docker run --rm -it python:3.10-slim bash
apt-get update && apt-get install -y build-essential git --no-install-recommends
pip install -U pip setuptools

Build from PyPI:

pip install asyncpg --no-binary :all:

Or, Build from source:

pip install git+https://github.com/MagicStack/asyncpg.git@master

Output:

Collecting git+https://github.com/MagicStack/asyncpg.git@master
Cloning https://github.com/MagicStack/asyncpg.git (to revision master) to /tmp/pip-req-build-1y0lh4k8
Running command git clone --filter=blob:none --quiet https://github.com/MagicStack/asyncpg.git /tmp/pip-req-build-1y0lh4k8
Resolved https://github.com/MagicStack/asyncpg.git to commit a2f093df6aceec7842709eaf92c5ff9df093efae
Running command git submodule update --init --recursive -q
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [515 lines of output]
/tmp/pip-build-env-mutsvdr9/overlay/lib/python3.10/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` must contain ['name'] properties
DESCRIPTION:
Data structure for the **project** table inside ``pyproject.toml`` (as
initially defined in :pep:`621`)

GIVEN VALUE:
{
"requires-python": ">=3.6"
}

OFFENDING RULE: 'required'

DEFINITION:
...
...
<omitted>
...
...

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py",line 363, in <module>
main()
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py",line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.10/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-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 248, in <module>
setuptools.setup(
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 77, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 122, in setup
dist.parse_config_files()
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 836, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/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-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 114, in read_configuration
validate(subset, filepath)
File "/tmp/pip-build-env-9b_16u9a/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 43, in validate
raise error from None
ValueError: invalid pyproject.toml config: `project`
[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.
hint: See above for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions