Editable installs for packages developed with Poetry using Flit.
Project description
poetry-lock
Poetry natively does not support editable installs (as of writing this on Jan 22, 2022). This command makes use of the Flit backend to leverage its excellent symlink support. Relevant parts of the Poetry configuration will by adpated such that no Flit related configuration needs to be added to pyproject.toml.
Example usage:
$ poetry link
Discovered modules in /projects/poetry-link/src: my_package
Extras to install for deps 'all': {'.none'}
Symlinking src/my_package -> .venv/lib/python3.10/site-packages/my_package
How it works
First, the Poetry configuration in pyproject.toml will be updated temporarily to contain the relevant parts in the format that Flit understands. The changes to the configuration include
- copy tool.poetry.plugins -> tool.flit.entrypoints
- copy tool.poetry.scripts -> tool.flit.scripts
- add tool.flit.metadata
- the module is derived automatically using setuptools.find_namespace_packages() on the src/ directory, if it exists, or otherwise on the current directory. Note that Flit only supports installing one package at a time, so it will be an error if setuptools discovers more than one package.
Then, while the configuration is in an updated state, $ flit install -s --python python is invoked. This will symlink your package into your currently active Python environment. (Note that right now, the plugin does not support auto-detecting the virtual environment automatically created for you by Poetry and the environment in which you want to symlink the package to needs to be active).
Finally, the configuration is reverted to its original state.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file poetry-link-0.1.1.tar.gz
.
File metadata
- Download URL: poetry-link-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e53aceb43a532c2e40ceaa238340da79d880b05d38de8034559306cb9d233d79 |
|
MD5 | 559d8d5f4b74311a6ebf2cdffbf8e187 |
|
BLAKE2b-256 | a1dacdeee3bf2007e9fa83e76c026e47a12ee84daad15c64fc1d0adf487f72a8 |
File details
Details for the file poetry_link-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: poetry_link-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a751c2d8fe597ededa7ba37efe04ad2ca6cf159c3c605b779ca6194b2352879e |
|
MD5 | 9b2a270fe74f8376e9298de3f5ecf19a |
|
BLAKE2b-256 | 1aa2e034ba7abf8dd5163f706e334883c49a96baa620c7b2f014b08ccdf54c93 |