Skip to main content

pipenv-uv-migrate

This is simple migration script, migrate pipenv to uv.

PyPI - Python Version PyPI - Downloads Test FOSSA Status

:rocket: Get Started

Installation

$ uv tool install pipenv-uv-migrate
# -- or --
$ pipx install pipenv-uv-migrate

Migration

Step 1: Create pyproject.toml file

$ uv init

Step 2: Migrate

To migrate Pipfile to pyproject.toml.

$ pipenv-uv-migrate -f Pipfile -t pyproject.toml

When want to run dry-run mode:

$ pipenv-uv-migrate -f Pipfile -t pyproject.toml -n

Dry-run mode is pyproject.toml file does not overwrite, results are displayed on standard output.

[!Note]
If the dependency already exists in the project dependency and you want to re-migrate it, please use the --re-migrate option. However, if the dependency is removed from pipenv, the project dependency will not be removed.

$ pipenv-uv-migrate -f Pipfile -t pyproject.toml --re-migrate

Step 3: Generate lock file

$ uv lock

If there is already a uv.lock file, remove it first.

Step 4: Installing dependencies

To install the defined dependencies for your project.

$ uv sync

Example output

This is an example of a Pipfile to be migrated.

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "*"

[dev-packages]
pytest = ">=5.2"

Migrate the above file to the following pyproject.toml.

[project]
name = "migrate-sample"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
    { name = "Yoshiyuki HINO", email = "yhinoz@gmail.com" }
]
requires-python = ">=3.9"
dependencies = []

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

By executing this script, pyproject.toml is rewritten as follows.

[project]
name = "migrate-sample"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
    { name = "Yoshiyuki HINO", email = "yhinoz@gmail.com" }
]
requires-python = ">=3.9"
dependencies = [
    "requests",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
    "pytest>=5.2",
]

[!Note]
If the version of the dependent package is not specified, it will also be migrated. but the following warning will be displayed when lock or sync is performed with uv.

warning: Missing version constraint (e.g., a lower bound) for `requests`.

Please specify the version after migration.

:handshake: Contributing

  1. Fork and clone the repository, and create the development branch.
  2. Run uv sync to setup your develop environment.
  3. Do your code.
  4. Run uvx --with tox-uv tox@latest to check that your test passed.
  5. Run bash scripts/format.sh and bash scripts/lint.sh to check that you haven't warnings.
  6. Open a PR on GitHub.

Test cases

Test cases are in tests/testdata/toml, update Pipfile with additional entries and expect_pyproject.toml with expected output.

:pencil: License

FOSSA Status

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipenv_uv_migrate-0.4.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipenv_uv_migrate-0.4.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file pipenv_uv_migrate-0.4.0.tar.gz.

File metadata

  • Download URL: pipenv_uv_migrate-0.4.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipenv_uv_migrate-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b064138242563552a7397e9dbaf5c440286233eb083f2ebea73eea40342adee4
MD5 15a4e4cf8a009341b658d13edbe5c838
BLAKE2b-256 8b49593c3ecbbfae4062654632b397aa4789bdc20fdbe480a46b90b9dfd8ef2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipenv_uv_migrate-0.4.0.tar.gz:

Publisher: release.yml on yhino/pipenv-uv-migrate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipenv_uv_migrate-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pipenv_uv_migrate-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e240ce9f5e07c68454cd053e497c6885a75e65a6a4acfcddb9a78bddeebf5ce
MD5 86c2520e67edab620ad89794bd49376f
BLAKE2b-256 209b5a6db92184311a769dd91077c3237ad7fe9610be14ea94a664e274d1ec9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipenv_uv_migrate-0.4.0-py3-none-any.whl:

Publisher: release.yml on yhino/pipenv-uv-migrate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page