pip wheel conditional dependencies

0 votes
While working on a virtualenv for developing a python package, I use to issue a "pip wheel ." to generate all wheel archives needed for the package. I start using conditional dependencies by listing them in the setup tools extras_require parameter. Is it possible to generate the wheel archives of a specific conditional dependency?

I am looking for something like: pip wheel ".[conditional_feature]" is not supported. (at least on python-2.7) Note that I can install these dependencies in the virtualenv with: pip install -e ".[conditional_feature]"
May 7, 2019 in Python by ana1504.k
• 7,910 points
1,305 views

1 answer to this question.

0 votes
With the latest version (2017) of the pypa trio (pip,setuptools, wheel) you can now use conditional requirements directly. Here is an example with extra_requires that install various versions of lxml on different OSes:

extras_require={
        ':platform_system == "Windows"': ['lxml == 3.6.0'],
        ':platform_system == "Linux"': ['lxml == 3.6.4'],
        ':platform_system == "Darwin"': ['lxml == 3.6.4'],

},
You can do a lot more than this of course with even more complex expressions.
answered May 7, 2019 by SDeb
• 13,300 points

Related Questions In Python

+1 vote
1 answer

Can installin pip for python install dependencies aswell?

As long as the dependency is listed ...READ MORE

answered Sep 26, 2018 in Python by Priyaj
• 58,020 points
873 views
+4 votes
6 answers

Does Python have a ternary conditional operator like C does?

Yes, the syntax is: a if condition else ...READ MORE

answered Apr 13, 2018 in Python by Nietzsche's daemon
• 4,260 points
2,478 views
0 votes
1 answer

Install pip in Python 3.4

Don't worry! Python already comes in default ...READ MORE

answered May 1, 2018 in Python by aayushi
• 750 points
3,421 views
0 votes
1 answer

How to install Python MySQLdb module using pip?

It's easy to do, but hard to ...READ MORE

answered Aug 20, 2018 in Python by charlie_brown
• 7,720 points
2,291 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
0 votes
1 answer

What are the ternary conditional operator in Python?

The Ternary Conditional operator was added in ...READ MORE

answered Sep 19, 2018 in Python by SDeb
• 13,300 points
725 views
0 votes
11 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP