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
enum34
dependency breaks some installs
#48
Comments
An example of the issue in action is available here: https://travis-ci.org/murrple-1/pipenv-issue-3 I have also opened an issue with pipenv to see if there is a better workaround that I missed. |
Hmmm, so what triggers this problem for you is this:
because argon2-cffi goes for great lengths to build wheels for all relevant platforms and the requirements should be encoded correctly in the wheels. I suppose I need to additionally add protective markers for cases like yours. |
I think 8eed81a should fix it. Is there a way for you to test against master? |
Yes, that appears to work for me, and (if it means anything from a rando from the internet) I like the elegance of that solution. Per your comment about the |
Cool, thanks! |
The recommended way to specify dependencies specific to a python version is to use environment markers. One downside of using if statements to specify dependencies is that it can break applications using package managers like pipenv or poetry, where the version of python running setup.py is not necessarily the same verion of python being deployed. It would certainly be fair to blame this on the package managers themselves, but given the PEP and the fact that other packages have solved this in the same way, I think it's worth fixing on this end. See: * https://www.python.org/dev/peps/pep-0508/#environment-markers * hynek/argon2-cffi#48 * hynek/argon2-cffi@8eed81aa
First off, I'm not convinced if this should be a bug report here, but at the very least, I can suggest it.
Essentially, it seems that installing
enum34
in environments of Python 3.6 and above can break certain codebases (see: https://stackoverflow.com/q/43124775), including mine. It seemsenum34
is often loaded/imported ahead of the standard-library'senum
, and the APIs have slightly diverged since Python 3.4.Now, you may be thinking, "I know, that's why there's a check in
setup.py
" (see: https://github.com/hynek/argon2_cffi/blob/master/setup.py#L98). However, this sort of protection seems to not work really well with the more "modern" packaging solutions, likepipenv
andpoetry
(see: pypa/pipenv#924, python-poetry/poetry#758), because the python version running thesetup.py
may not be the same version being deployed, and as they generate consistent lockfiles, regardless of the running python version.It seems a nuisance, as the onus maybe should be on the package managers to figure it out. However, I would like to suggest/request that
a) the support for pre-3.4 python versions be dropped by removing the dependency on
enum34
, orb) the package be split between a
enum34
installable and non-enum34
installable. I think this can be achieved pretty easily with theextras_require
argument insetuptools
, such thatwould install without
enum34
, andwould install with
enum34
. If it helps, this project showcases the usecase in action, and this code shows how it's done.Or,
c) take advantage of environment markers in
setup.py
instead. I don't fully understand what that means or entails, so I have a hard time recommending it, but this comment seems to suggest it as an alternative to doing asys.version_info
check.If a) or b) sound logical, I can submit a PR.
The text was updated successfully, but these errors were encountered: