Skip to content
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

Add support for pythonX.Y -m piptools .... #402

Closed
AndreLouisCaron opened this issue Oct 17, 2016 · 3 comments
Closed

Add support for pythonX.Y -m piptools .... #402

AndreLouisCaron opened this issue Oct 17, 2016 · 3 comments
Labels
PR wanted Feature is discussed or bug is confirmed, PR needed

Comments

@AndreLouisCaron
Copy link
Contributor

I work with both Python 2.7 and Python 3.5 regularly. The dependency resolution process uses the Python version in multiple different ways and I'm afraid that running with both might not give the same result depending on the Python version.

For this reason, I don't have a global alias to pip-compile et al.. I could of course use a virtualenv just for running piptools, but that's quite inconvenient (especially for projects that don't use Tox). What I do have is a global alias to pythonX.Y (Linux) and py -X.Y (Windows).

The most convenient way to use pip-tools in this context is to support the python -m piptools ... CLI syntax, which requires a piptools.__main__ module.

That way, when I work on a Python 2.7 project:

py -2.7 -m piptools compile requirements.txt  # compiles for Python 2.7

And when I switch to a Python 3.5 project:

py -3.5 -m piptools compile requirements.txt  # compiles for Python 3.5

Are you open to such a change if I'm willing to put some time into it?

Thanks!

@nvie nvie added the PR wanted Feature is discussed or bug is confirmed, PR needed label Oct 17, 2016
@nvie
Copy link
Member

nvie commented Oct 17, 2016

This would be great. If anyone wants to contribute this, I'd encourage that.

@Groxx
Copy link

Groxx commented Mar 5, 2017

For virtualenvs-per-python-binary, have you seen pipsi? https://github.com/mitsuhiko/pipsi
It essentially does this for you. And there's a way to specify python 2/3 when doing so. Very much recommended, since otherwise you end up polluting the global pip install with all kinds of incompatible stuff :|

Run-as-module is convenient in its own right tho, good idea! And probably lots easier to use with automation.

@AndreLouisCaron
Copy link
Contributor Author

@Groxx Didn't know about pipsi. Thanks for the suggestion, but it's not quite what I'm looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR wanted Feature is discussed or bug is confirmed, PR needed
Projects
None yet
Development

No branches or pull requests

3 participants