Poetry to uv tool. To migrate from a poetry managed repo to uv.
Project description
convert-poetry2uv
The convert_poetry2uv.py script is meant to easily convert the pyproject.toml to be consumed by uv instead of poetry.
Poetry v2 came out after this tool. The tool has been modified to work with poetry v2 format as well. Please create an issue/PR if you find any issues.
It has a dry-run flag, to have a temporary file to validate the output. When not running the dry-run the original file is saved with a .org extension.
uv run convert_poetry2uv.py <path to file> [-n]
You may need to make some manual changes. The layout might not be exactly to your liking. I would recommend using Even better toml in VSCode. Just open the newly generated toml file and save. It will format the file according to the toml specification.
Caveats
- If you were using the poetry build-system, it is removed in the generated pyproject.toml.
- if you had optional dev groups, the dev group libraries will be used, the optional flag is removed
Using as a tool
The script can be run as a tool using uvx
uvx convert-poetry2uv --help
uv instructions
Once the pyproject.toml is converted, you can use uv to manage your project. To start fresh, the .venv directory is removed followed by the creation and sync of the .venv directory.
rm -rf .venv
uv venv # or 'uv venv -p 3.12' to specify a python version
uv sync
With this you are good to go and are able to validate the migration was a success.
Pypi
The script is also available on pypi as convert-poetry2uv
pip install convert-poetry2uv
Contribute
Though I've tried to make it as complete as possible, it is not guaranteed to work for all cases. Feel free to contribute to the code or create an issue with the toml file that is not converted correctly.
Versions/Releases
The version is automatically updated with python-semantic-release. Take note of the pyproject.toml to see which keywords can be added to the commit message to ensure the correct version is released. The release is created when merged to main.
Trusted Publisher
Note to self: When a new github workflow is required, don't forget to add the new workflow to the trusted publisher list.
Links
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convert_poetry2uv-0.3.11.tar.gz.
File metadata
- Download URL: convert_poetry2uv-0.3.11.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d34463038889849aa8d70319a73dbab1a4f459522415b22d56996f34c666fe7
|
|
| MD5 |
5af80a1f4a7044e2eac8b95f2163e0fc
|
|
| BLAKE2b-256 |
094c5f23584795883bd14145350e68f118878dd6537430ee6f81f1d44da1c78b
|
Provenance
The following attestation bundles were made for convert_poetry2uv-0.3.11.tar.gz:
Publisher:
sem-release.yaml on bartdorlandt/convert_poetry2uv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convert_poetry2uv-0.3.11.tar.gz -
Subject digest:
2d34463038889849aa8d70319a73dbab1a4f459522415b22d56996f34c666fe7 - Sigstore transparency entry: 746539186
- Sigstore integration time:
-
Permalink:
bartdorlandt/convert_poetry2uv@d2251d1001e0f490c595cac35c79078d59b6796e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bartdorlandt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sem-release.yaml@d2251d1001e0f490c595cac35c79078d59b6796e -
Trigger Event:
push
-
Statement type:
File details
Details for the file convert_poetry2uv-0.3.11-py3-none-any.whl.
File metadata
- Download URL: convert_poetry2uv-0.3.11-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f44477574c6d5eddae36d160c115462dc99a4aef6c9e471167671d6e5a6963e
|
|
| MD5 |
80ac53d5e1339002eb6969116949d314
|
|
| BLAKE2b-256 |
ed24c231eb97793d61db9112836905545b514afd3bbfb4d116c0acddd6f2323c
|
Provenance
The following attestation bundles were made for convert_poetry2uv-0.3.11-py3-none-any.whl:
Publisher:
sem-release.yaml on bartdorlandt/convert_poetry2uv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convert_poetry2uv-0.3.11-py3-none-any.whl -
Subject digest:
3f44477574c6d5eddae36d160c115462dc99a4aef6c9e471167671d6e5a6963e - Sigstore transparency entry: 746539192
- Sigstore integration time:
-
Permalink:
bartdorlandt/convert_poetry2uv@d2251d1001e0f490c595cac35c79078d59b6796e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bartdorlandt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sem-release.yaml@d2251d1001e0f490c595cac35c79078d59b6796e -
Trigger Event:
push
-
Statement type: