I want to contribute some changes to a python package which is using github. I have forked it. It is a library I am using in a project (in a python 3.5.1 virtual environment).
The documentation at https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support tell me how to install from a github fork, and it goes on to mention "editable installs" (https://pip.pypa.io/en/latest/reference/pip_install/#editable-installs) which basically does "development mode"
If it is a pure python package does it matter if I skip editable mode?
(since there would be no build steps necessary as I would only be changing python code. This would mean I can keep using the same import statements.)
When you pip install
without editable mode, the package is copied into your Python environment (such as env/lib/python3.5/site-packages
). You can, of course, edit it right there, as it’s usually just a bunch of Python files, but that is inconvenient.
When you pip install
with editable mode, pip
only sets up a link from your environment to wherever the source code is. So, you can clone your GitHub fork into a convenient directory like ~/projects/libraryX
, then do pip install -e ~/projects/libraryX
, and keep editing the code at ~/projects/libraryX
while your changes are immediately reflected in the environment where you installed it.
This all applies to pure Python packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With