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

Clarification re: installation #582

Closed
bhrutledge opened this issue Oct 22, 2017 · 3 comments
Closed

Clarification re: installation #582

bhrutledge opened this issue Oct 22, 2017 · 3 comments
Labels
docs Documentation related

Comments

@bhrutledge
Copy link
Contributor

The README suggests pip install pip-tools, but it's not clear what environment that should be run in. Some of the options that I see:

  1. System Python (e.g., distributed with OS): generally not recommended
  2. Third-party Python (e.g., Homebrew, python.org, pyenv, Anaconda)
  3. Virtual environment dedicated to pip-tools
  4. Each project's virtual environment

In my case, I chose option 3, using pipsi to streamline adding it to my PATH. I've installed other tools like fabric and cookiecutter in a similar manner, whereas I install things like flake8 using option 4.

I think option 1 or 2 would be safer with pip install --user.

@vphilippon vphilippon added the docs Documentation related label Oct 23, 2017
@vphilippon
Copy link
Member

vphilippon commented Oct 23, 2017

Considering the pip-sync command, it needs to be installed in the same virtualenv that you want to sync, which is each project virtualenv, because pip-sync will simply perform packages install/uninstall in the current active virtual environment.
That means option 4.

I don't know much about pipsi, but if tools installed with pipsi are available when in another virtualenv (like a given project's virtualenv), then it could work (or cause horrible unforeseen side-effect). If you want to give us you're feedback on how the pip-sync command work in these condition, it could be good to know, and document if needed.

At the moment, I think that option 4 is the only fully valid option that will work with pip-tools as a whole (not only pip-compile). That should indeed be clarified in the doc.

@bhrutledge
Copy link
Contributor Author

I've been using pip-sync successfully with pipsi, which I think makes sense based on your description. But, I'm happy to update the docs to suggest option 4, as that seems the easiest and least surprising.

On that note: is there any suggestion for including pip-tools as a development requirement in setup.py or a .in file?

@vphilippon
Copy link
Member

vphilippon commented Oct 23, 2017

@bhrutledge It might not seem like it, but that's a pretty loaded question right there. It points back to the broader question "how do I deal with dev requirements in Python", and there's not a single viewpoint on this in the community, AFAIK.

Although, I'm not an expert on all the fancy options available in setup.py using setuptools, but I would be very careful about including pip-tools somewhere in a setup.py. I would deal with pip-tools the same way you deal with pip. If there was a "dev_requires" section in setup.py, it could be the right spot, although it would need some testing to make sure everything goes smoothely.

Personally, I keep my dev packages in a separate dev_requirements.in/.txt. But in the end, it comes down to using a way that fits your need, as long as you're aware that this is part of your "python environment tooling", like pip is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related
Projects
None yet
Development

No branches or pull requests

2 participants