Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t install graphene-django due to bug in promise install_requires definition #90

Open
ValkoVolodya opened this issue Jan 3, 2021 · 5 comments

Comments

@ValkoVolodya
Copy link

Hello!

Tried to compile my requirements file via pip-compile, that contains:

graphene-django==2.10.1
graphene==2.1.8

but get an error:

 error in promise setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in typing>=3.6.4; python_version < '3.5' at ; python_version < '3.5'

Error is here:
https://github.com/syrusakbary/promise/blob/master/setup.py#L60

@ValkoVolodya
Copy link
Author

@syrusakbary can you please help?

@tdaff
Copy link

tdaff commented Feb 17, 2021

@ValkoVolodya that looks like an environment marker, rather than a typo. pip-compile version 2 or newer should at least be parsing them correctly jazzband/pip-tools#647 and filtering them.

@ValkoVolodya
Copy link
Author

@tdaff , yeah, thanks, now I see, that is valid, but I use version 5.2.0 of pip-compile, but problem is still here( Maybe something wrong with pip-compile itself..

@ValkoVolodya
Copy link
Author

I asked about this problem in pip-tools repo - jazzband/pip-tools#1327 and problem is that wheel file for version 2.3 is not downloaded - https://pypi.org/project/promise/#files for now I try to pin older version with wheel downloaded

@webknjaz
Copy link

To be fair, this setup.py problem is also legitimate. Uploading a wheel will help but it is a band-aid.

Inline env markers aren't well-supported by old setuptools so this will only work if the end-users know that they need to have a minimum setuptools version of 36.2 0 upfront. And when you migrate to using a declarative setup.cfg config, it will be 36.2.7.

A more portable solution would be to use markers in the nameless extras definitions (this seems to be supported since v0.7):

-    extras_require={"test": tests_require},
+    extras_require={
+        ":python_version < '3.5'": ["typing>=3.6.4"],
+        "test": tests_require,
+    },
     install_requires=[
-        "typing>=3.6.4; python_version < '3.5'",
         "six"
     ],

Although, my ultimate recommendation is to use PEP517. To activate it, simply add a pyproject.toml with the minimum or pinned version of setuptools and wheel. This way, pip will know to provision the right versions of build deps when building from sdist.
Also, for building the dists for publishing, it is now recommended to use https://github.com/pypa/build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants