mitsuhiko / pipsi

pip script installer
Other
2k stars 133 forks source link

Allow passing python version number for `install --python`, use `venv` for Python 3 #142

Closed reorx closed 6 years ago

reorx commented 6 years ago
  1. Allow passing python version number for install --python

    e.g. pipsi install --python 2, this will find the python2 executable in $PATH, and use it to create virtualenv for installing package. This concept is borrowed from pipenv which has the similar usage like pipenv --python 2, makes it easier to specify python interpreter, because getting the full path is always a pain.

  2. Add PIPSY_PYTHON as env var binding for --python, makes it possible to set the default python interpreter from shell rc file.

  3. Use venv if python interpreter is python 3. setup.py also determines install_requires by python version, and virtualenv will only be required for python 2. Though virtualenv is OK, it's quite clear that venv is the more official and standard way for python 3. Besides, it's good to see a dependency could be removed, glory to Python 3 :D

Some other subtle changes including:

Could be removed if you think it's not necessary for the project.

RonnyPfannschmidt commented 6 years ago

i just resolved the conflicts using the GH UI

reorx commented 6 years ago

Add another two commits to solve the ci tests.

cs01 commented 6 years ago

Regarding Pipfile and Pipfile.lock

1.) Under what circumstances would these be used? If the answer is unclear, maybe it should not be part of pipsi. If the answer is clear, can it be added to documentation somewhere? 2.) Who is responsible for updating the .lock file, and when should it be done?

RonnyPfannschmidt commented 6 years ago

@cs01 thanks for the note

@reorx please remove those 2 from the project

reorx commented 6 years ago

@cs01 actually they are not part of the pipsi package, that's why they are not included in MANIFEST.in file. It's intended to be used for developing purpose, by running pipenv shell you can quickly make a virtual environment with dependencies (specified in Pipfile) installed.

For question 2, Pipfile.lock is only updated when pipenv update/lock is called, or dependencies are modified by pipenv install/uninstall. Whoever wants to change developing tools (tox, pytest etc), or change the real dependencies of pipsi itself, is responsible for updating the lock file (or even Pipfile). This should be done by the time the changes happen.

It's indeed a kind of personal choice, so remove them is OK, maybe better for sticking out the main purpose of this PR.

RonnyPfannschmidt commented 6 years ago

will merge after green

reorx commented 6 years ago

@RonnyPfannschmidt great, is the current status considered green now?

RonnyPfannschmidt commented 6 years ago

thanks for the ping,i got sidetracked

taion commented 6 years ago

Would it be possible to cut a new release with this fix? It would be nice not to have to install from master.