GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing setuptools.pypa.io — Development Mode (a.k.a. “Editable Installs”) - setuptools 84.2.1 documentation Development Mode (a.k.a. “Editable Installs”)¶When creating a Python project, developers usually want to implement and test changes iteratively, before cutting a release and preparing a distribution archive. In normal circumstances this can be quite cumbersome and require the developers
to manipulate the To facilitate iterative exploration and experimentation, setuptools allows users to instruct the Python interpreter and its import machinery to load the code under development directly from the project folder without having to copy the files to a different location in the disk. This means that changes in the Python source code can immediately take place without requiring a new installation. You can enter this “development mode” by performing an editable installation inside of a virtual environment,
using pip’s $ cd your-python-project $ python -m venv .venv # Activate your environment with: # `source .venv/bin/activate` on Unix/macOS # or `.venv\Scripts\activate` on Windows $ pip install --editable . # Now you have access to your package # as if it was installed in .venv $ python -c "import your_python_project" An “editable installation” works very similarly to a regular install with
When you’re done with a given development task, you can simply uninstall your
package (as you would normally do with Please note that, by default an editable install will expose at least all the files that would be available in a regular installation. However, depending on the file and directory organization in your project, it might also expose as a side effect files that would not be normally available. This is allowed so you can iteratively create new Python modules. Please have a look on the following section if you are looking for a different behaviour. Virtual Environments You can think about virtual environments as “isolated Python runtime deployments” that allow users to install different sets of libraries and tools without messing with the global behaviour of the system. They are a safe way of testing new projects and can be created easily
with the Please note however that depending on your operating system or distribution,
sudo apt install python3-venv Alternatively, you can also try installing virtualenv. More information is available on the Python Packaging User Guide on Install packages in a virtual environment using pip and venv. Note Changed in version v64.0.0: Editable installation hooks implemented according to PEP 660. Support for namespace packages is still EXPERIMENTAL. “Strict” editable installs¶When thinking about editable installations, users might have the following expectations:
Unfortunately these expectations are in conflict with each other.
To solve this problem pip install -e . --config-settings editable_mode=strict In this mode, new files won’t be exposed and the editable installs will
try to mimic as much as possible the behavior of a regular install.
Under the hood, Warning Strict editable installs require auxiliary files to be placed in a
Please be careful to not remove this directory while testing your project, otherwise your editable installation may be compromised. You can remove the Note Added in version v64.0.0: Added new strict mode for editable installations. The exact details of how this mode is implemented may vary. Limitations¶
Attention Editable installs are not a perfect replacement for regular installs in a test environment. When in doubt, please test your projects as installed via a regular wheel. There are tools in the Python ecosystem, like tox or nox, that can help you with that (when used with appropriate configuration). Legacy Behavior¶If your project is not compatible with the new “editable installs” or you wish
to replicate the legacy behavior, for the time being you can also perform the
installation in the pip install -e . --config-settings editable_mode=compat This installation mode will try to emulate how Warning The How editable installations work¶Advanced topic There are many techniques that can be used to expose packages under development
in such a way that they are available as if they were installed.
Depending on the project file structure and the selected mode, A non-exhaustive list of implementation mechanisms is presented below. More information is available on the text of PEP 660.
Attention
Debugging Tips¶If encountering problems installing a project in editable mode, follow these recommended steps to help debug:
After following the steps above, if the problem still persists and you think this is related to how setuptools handles editable installations, please submit a reproducible example at the bug tracker. Notes |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |