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.3.tar.gz
.
File metadata
- Download URL: poetry-link-0.1.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.10.1 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92cd1bd4fd9b1d65c3a88e443304d0981e98d732cfd3db957ae89944c54793bd |
|
MD5 | 049fa2e4ff5749c1ba95fac5e798c776 |
|
BLAKE2b-256 | 574445d3d1e0537693ecf87d257fd767b01bd2780aff826413d595c0814efa41 |
File details
Details for the file poetry_link-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: poetry_link-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.10.1 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b29d77d85241100e89e7089adea33ebddd03aadc5758705000ca6b00ee5af25e |
|
MD5 | f73b068ce6f97f073e52c4933ed37575 |
|
BLAKE2b-256 | 543a30124d52d78da771e4ff5a264d95f72fad62a4b7d2c3d7c25900394f2752 |