Skip to main content

pipenv-poetry-migrate

This is simple migration script, migrate pipenv to poetry.

PyPI - Python Version PyPI - Downloads build Codecov FOSSA Status

:rocket: Get Started

Installation

$ pip install -U poetry pipenv-poetry-migrate

Migration

Step 1: Create pyproject.toml file

$ poetry init

Step 2: Migrate

To migrate Pipfile to pyproject.toml.

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

When want to run dry-run mode:

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

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

Note: The default behavior is to migrate with the group notation, which has been available since Poetry 1.2.0. If you want to migrate with dev-dependencies notation, please use the --on-use-group-notation option.

$ pipenv-poetry-migrate -f Pipfile -t pyproject.toml --no-use-group-notation

Step 3: Generate lock file

$ poetry lock

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

Step 4: Installing dependencies

To install the defined dependencies for your project.

$ poetry install

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.

[tool.poetry]
name = "migration-sample"
version = "0.1.0"
description = ""
authors = ["Yoshiyuki HINO <yhinoz@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.group.dev.dependencies]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

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

[tool.poetry]
name = "migration-sample"
version = "0.1.0"
description = ""
authors = ["Yoshiyuki HINO <yhinoz@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.7"
requests = "*"

[tool.poetry.group.dev.dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

:handshake: Contributing

To run tests:

  1. poetry install # get environment setup
  2. make test # run the tests

Test cases are in tests/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_poetry_migrate-0.4.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

pipenv_poetry_migrate-0.4.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipenv_poetry_migrate-0.4.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.66.0 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.17

File hashes

Hashes for pipenv_poetry_migrate-0.4.0.tar.gz
Algorithm Hash digest
SHA256 428297173072d3d8d82db7e267c467b5219d84ae1f0829a878a2d2221404500e
MD5 673a8940e113d342178f16b13219945c
BLAKE2b-256 37ac5402ee2c372ba28c68416232cf15e5d749f03376669875ea39afc502021e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipenv_poetry_migrate-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.4 tqdm/4.66.0 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.17

File hashes

Hashes for pipenv_poetry_migrate-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93f1f3b7106d3ceb26fa69da62177d3cca6f1c7cb13ed0981dacd274620227d9
MD5 1caececb11133b854a6322babd958c05
BLAKE2b-256 03956321633de86cee14c0c7fa8e1997055e903e85b44bcac8e8085c7d8161c0

See more details on using hashes here.

Supported by

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