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
• 5,990 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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:

        ':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
• 9,540 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,120 points
+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
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
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
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
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
• 9,540 points
0 votes
10 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.