coleifer / peewee

a small, expressive orm -- supports postgresql, mysql, sqlite and cockroachdb
http://docs.peewee-orm.com/
MIT License
11.06k stars 1.37k forks source link

Peewee installation fails #2889

Closed SheGe closed 4 months ago

SheGe commented 4 months ago

Hi,

the installation of peewee specified in the requirements.txt file is failing with this error:

Collecting peewee
  Using cached peewee-3.17.3.tar.gz (3.0 MB)
  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'
 (stderr:   ERROR: Command errored out with exit status 1:
   command: /opt/stackstorm/virtualenvs/MY_PACK/bin/python /opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmpxnoi_0dy
       cwd: /pip-install-n9u1a_0i/peewee_6e7c882e54424ea1af25d4c0c4aa3220
  Complete output (10 lines):
  Traceback (most recent call last):
    File \"/opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py\", line 280, in <module>
      main()
    File \"/opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py\", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File \"/opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py\", line 108, in get_requires_for_build_wheel
      backend = _build_backend()
    File \"/opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py\", line 99, in _build_backend
      obj = getattr(obj, path_part)
  AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/stackstorm/virtualenvs/MY_PACK/bin/python /opt/stackstorm/virtualenvs/MY_PACK/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmpxnoi_0dy Check the logs for full command output.

More information about the system:

The problem I'm experiencing could be related to this: https://github.com/pypa/setuptools/issues/1694#issuecomment-466010982

I am confident that the issue I’m currently facing could be resolved by adding build-backend="setuptools.build_meta" into the pyproject.toml file. However, I have concerns about how this modification might affect the compatibility of your project with various Python versions currently supported.

SheGe commented 4 months ago

When I temporarily modified the stack storm configuration and removed --system-site-packages from the virtual environment creation command - the peewee installation was completed. In the systems where we use newer versions of Python, like 3.8 - the issue does not exist. This test proves the findings in the description are correct and the problem I'm experiencing is related to this pip bug with build isolation: https://github.com/pypa/pip/issues/6264 for which the fix won't released for pip versions that work with Python <= 3.6

Implementing the change I've suggested might help to keep peewee compatible with older versions of Python and different environment setups.

coleifer commented 4 months ago

I've gone ahead and tried your fix in a new version, 3.17.4. Hopefully this addresses your issue, however unlikely the circumstances required to produce it.

I hate @pypa so much it's unreal!