-
Notifications
You must be signed in to change notification settings - Fork 3k
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
How to run pip from sources (fixes #5747) #5752
Changes from 4 commits
240f9dc
1f68c1f
d16d77d
7d4f7e3
1e2a5c4
80e7374
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,61 @@ This document is meant to get you setup to work on pip and to act as a guide and | |
reference to the the development setup. If you face any issues during this | ||
process, please `open an issue`_ about it on the issue tracker. | ||
|
||
Development tools | ||
Running Developent Version | ||
========================== | ||
|
||
Clone git repository and change dir into it: | ||
|
||
.. code-block:: console | ||
|
||
$ git clone https://github.com/pypa/pip | ||
$ cd pip | ||
|
||
Then run `python src/pip`: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there needs to be a big fat warning here on why this works and that this absolutely doenst work for running the testsuite that ensure pip works ^^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The explanation why it works is below. And there is no visible way to run tests without |
||
|
||
.. code-block:: console | ||
|
||
$ python src/pip | ||
|
||
That's it! | ||
|
||
You may want to skip to next chapter, or read on for full details. | ||
|
||
Running `src/pip` will load all `pip` modules and | ||
`dependencies <https://github.com/pypa/pip/tree/master/src/pip/_vendor)>`_ | ||
from the clone directory. This way they do not need to be installed on your | ||
system. The process of bundling dependencies with a project sources is called | ||
`vendoring`, but because there is no PEP for that, other Python won't work | ||
this way and still require `pip` for installation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes no sense. Why would there be a PEP for vendoring? What do you mean by "other Python won't work this way"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I said that to warn people that vendoring in If there is a way for other project to adopt |
||
|
||
If you want to practice `virtualenv` development, then `pip` inside can be | ||
relinked directly to development sources by installing it in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is very confusingly worded. If you're just saying "this is how you use virtualenv for development" then fine, but it doesn't read like that. And anyway, using virtualenv and editable installs for development isn't a workflow that's specifically for pip, so while this section might be helpful for the odd person who doesn't know how to do it, it's not really needed in general. Also, this is much more reliable than your proposed "just run pip" approach, so I'd rather see this as the default approach, with your suggestion only recommended for people who (for whatever reason - I can't honestly think of any reasonable ones) don't want to use a virtualenv. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't like the wording too, but I want to explain the how
Which look like undocumented - you won't find find this mode in setuptools docs, which refer to Last time I tried to use
When you say Sorry, I am in a rush again. Can't smile. :) |
||
`development mode`. `pip install -e .` does that. This needs to be done only | ||
once. | ||
|
||
Full setup for `virtualenv` in `devpip` subdir: | ||
|
||
.. code-block:: console | ||
|
||
$ virtualenv .devpip | ||
$ source .devpip/bin/activate | ||
# ^^^ Linux only, on Windows run `.devpip/Scripts/activate.bat` | ||
(.devpip)$ pip install -e . | ||
|
||
To avoid activating `virtualenv` every time to test `pip`, you can use full path | ||
to the executable to run development version: | ||
|
||
.. code-block:: console | ||
|
||
$ .devpip/bin/pip --version | ||
pip 18.1.dev0 from /home/techtonik/p/pip/src/pip (python 2.7) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor point: It would be better to show examples using Python 3.x. Python 2 is not something we should be encouraging people to use. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. Will do. But I will have to use |
||
|
||
$ pip --version | ||
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7) | ||
$ python src/pip --version | ||
pip 18.1.dev0 from /home/techtonik/p/pip/src/pip (python 2.7) | ||
|
||
Development Tools | ||
================= | ||
|
||
pip uses :pypi:`tox` for testing against multiple different Python environments | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Describe how to run `pip` from source, and how it vendors dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't say why anyone would want to do this (apart from running the tests, which as you say this approach doesn't work for...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skipped the intro, because I feel like this part should be in TL;DR section. People who don't needed it can easily skip this section. In fact, I think the auditory of development docs are only two groups of people - newcomers (setup), and occasional contributors who forget things (me).
My goal is to have a quick reference for rebasing and manual testing that my patches still work. For that I need only a single
python src/pip
line. But I would like to help people coming for aneasy
orgood-first-issue
from funnels (marketing) like OpenHatch and upcoming HacktoberFest to have more fun withpip
thanvirtualenv
. Just grab someone experienced from Ruby or Node.js background and ask them to runpip
from sources. These are the people that I have in mind.