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 in Python by ana1504.k
• 7,390 points
18 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 by SDeb
• 12,200 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
• 56,160 points
39 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
97 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
64 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,710 points
69 views
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 122 views
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
• 12,200 points
42 views
0 votes
11 answers