drf-forms / drf-schema-adapter

Making using Django with frontend libraries and frameworks DRYer
http://drf-schema-adapter.readthedocs.io/en/latest/
MIT License
157 stars 40 forks source link

Unable to install drf-schema-adapter with setuptools>=67 #75

Closed soerenbe closed 1 year ago

soerenbe commented 1 year ago

Hi everyone, since today a lot of our pipelines failed. After some investigation I found the cause in a version incompatibility of setuptools=>67 and drf-schema-adapter.

I get following error:

error in drf-schema-adapter setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
          djangorestframework>=3.12<4.0

This may match with the changelog of setuptools: https://github.com/pypa/setuptools/blob/main/CHANGES.rst

Relevant part:

3790: Bump vendored version of :pypi:packaging to 23.0 (:pypi:pyparsing is no longer required and was removed). As a consequence, users will experience a more strict parsing of requirements. Specifications that don't comply with PEP 440 and PEP 508 will result in build errors.

I am not a packaging specialist, but I think a minor change in https://github.com/drf-forms/drf-schema-adapter/blob/f51f7a29000df23ff7d74720dc121d310222e3ab/setup.py#L43 would fix this.

Steps to reproduce

[sob@host ] ~/tmp$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy
[sob@host ] ~/tmp$ virtualenv venv
created virtual environment CPython3.10.6.final.0-64 in 75ms
[sob@host ] ~/tmp$ source venv/bin/activate
(venv) [sob@host ] ~/tmp$ pip install --upgrade setuptools
Requirement already satisfied: setuptools in ./venv/lib/python3.10/site-packages (65.5.0)
Collecting setuptools
  Using cached setuptools-67.0.0-py3-none-any.whl (1.1 MB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 65.5.0
    Uninstalling setuptools-65.5.0:
      Successfully uninstalled setuptools-65.5.0
Successfully installed setuptools-67.0.0

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
(venv) [sob@host ] ~/tmp$ pip install drf-schema-adapter
Collecting drf-schema-adapter
  Downloading drf-schema-adapter-3.0.0.tar.gz (33 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      error in drf-schema-adapter setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
          djangorestframework>=3.12<4.0
                             ~~~~~~^
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
nanuxbe commented 1 year ago

Thanks to both of you, I'll merge @rixx's PR