poetry-workspace-plugin
Poetry workspace plugin for Python monorepos. Inspired by Yarn Workspaces.
Adds a new subcommand group, poetry workspace, which is used to create, manage and inspect nested Python projects.
# Create a new python project at the specified path, tracked in the current project
poetry workspace new libs/my-library
# Add an existing python project to the current project's workspaces
poetry workspace add libs/my-existing-library
# List the current workspaces
poetry workspace list
# Run a command in every workspace:
poetry workspace run command
# Run a command in specified workspaces:
poetry workspace run --targets=my-library,my-existing-library -- command
# List dependees of a particular workspace (from among the list of workspaces).
poetry workspace dependees my-library
# Unlink a workspace from the current project
poetry remove workspace my-library
# Unlink and delete a workspace from the current project
poetry remove workspace my-library --delete
Common patterns
Testing affected workspaces
After making a change to a workspace, you can run tests for all affected workspaces like so:
poetry workspace run --targets=$(poetry workspace dependees --csv my-library) -- pytest tests/
Planned commands
The following are currently possible e.g via poetry workspace run poetry build, but this would be more succint:
# Build or publish all workspaces:
poetry workspace build
poetry workspace publish
# Build specified workspaces:
poetry workspace --targets=my-library build
# Publish specified workspaces:
poetry workspace --targets=my-library publish
Metadata regarding workspaces is stored under tool.poetry.workspaces:
[tool.poetry.workspace]
workspaces = {
my-library = "libs/my-library"
}
Installation
This project is not currently packaged and so must be installed manually.
Clone the project with the following command:
git clone https://github.com/jacksmith15/poetry-workspace-plugin.git
Development
Install dependencies:
pyenv shell 3.9.4 # Or other 3.9.x
pre-commit install # Configure commit hooks
poetry install # Install Python dependencies
Run tests:
poetry run inv verify
License
This project is distributed under the MIT license.
Metadata
Release files for poetry-workspaces 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| poetry-workspaces-0.1.0.tar.gz | 7.2 kB | Without provenance | Details for poetry-workspaces-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| poetry_workspaces-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for poetry_workspaces-0.1.0-py3-none-any.whl |
Total release size: 17.0 kB
Release files / poetry-workspaces-0.1.0.tar.gz
| Download URL | poetry-workspaces-0.1.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
525b2563558870d138bdce1537dfcad5ec4d4bbb057a4357af64aaee548027e8
|
|
BLAKE2b-256 checksum How to use checksums |
3ac2d4cca1f50494deb403e97c38096f658fdfb1be2dfc9dfdbef9b90ee740d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0a2 CPython/3.9.4 Linux/5.8.0-63-generic
|
Release files / poetry_workspaces-0.1.0-py3-none-any.whl
| Download URL | poetry_workspaces-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0111277dfc6132e54dce66903cc99ea70669491c0d8b1c35e47225c22b71277
|
|
BLAKE2b-256 checksum How to use checksums |
9baac6513c22c9d3a6d06b70596f9372056fa53aa769f655836dff476893c91e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0a2 CPython/3.9.4 Linux/5.8.0-63-generic
|
Security for poetry-workspaces 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.