Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
setup.py does not play nicely with pipenv #525
With the new pipenv, which is recommended by python.org now, there are issues with using os.sys_version in setup.py to determine which dependencies to install.
It appears that since pipenv technically runs in your main python environment rather than inside the virtualenv it manages, setup.py detects that python version. So for example I use python 3.6 as my main python, but have a few legacy projects which are on 2.7 for now. If I use pipenv then weasyprint's setup.py sees python 3.6 in os.sys_version and sets an incorrect version of CairSVG in the requirements.
Would it be possible to use the
Please also see pypa/pipenv#924
Well… I can understand the problem and I'd like to solve it, but I don't understand how
I have not tested this in setup.py, but my understanding is that you should be able to use the environment markers in
https://hynek.me/articles/conditional-python-dependencies/ discusses using them in setup.py in
If I've understood correctly, you can remove the bit checking
No problem, I'm glad to see that it works. Working on getting several projects migrated over to using pipenv has definitely been a bit of a learning experience.
I just did a bit more digging and while you may not want to rely on it just yet due to newness, it appears setuptools 36.2.0 added the ability to use the environment markers within