simple migration script, migrate pipenv to poetry
Project description
pipenv-poetry-migrate
This is simple migration script, migrate pipenv to poetry.
: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]
If the dependency already exists in the poetry dependency and you want to re-migrate it, please use the--re-migrate
option. However, if the dependency is removed from pipenv, the poetry dependency is not removed.$ pipenv-poetry-migrate -f Pipfile -t pyproject.toml --re-migrate
[!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 withdev-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
- Fork and clone the repository, and create the development branch.
- Run
poetry install
to setup your develop environment. - Do your code.
- Run
bash scripts/test.sh
to check that your test passed. - Run
bash scripts/format.sh
andbash scripts/lint.sh
to check that you haven't warnings. - Open a PR on GitHub.
Test cases
Test cases are in tests/toml
, update Pipfile
with additional entries and expect_pyproject.toml
with expected output.
:pencil: License
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
File details
Details for the file pipenv_poetry_migrate-0.5.11.tar.gz
.
File metadata
- Download URL: pipenv_poetry_migrate-0.5.11.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5012c73ef5512e7e4348d4b822ae8b44b63e6116253dd71476fdbf3d016b81a3 |
|
MD5 | 6d4f19761d44e79744a87128751f7b1e |
|
BLAKE2b-256 | fb6951154557cf30e7069ad5fb77ef1fa6abd4c8501bc81c5534ab24cbd9a05b |
Provenance
The following attestation bundles were made for pipenv_poetry_migrate-0.5.11.tar.gz
:
Publisher:
release.yml
on yhino/pipenv-poetry-migrate
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pipenv_poetry_migrate-0.5.11.tar.gz
- Subject digest:
5012c73ef5512e7e4348d4b822ae8b44b63e6116253dd71476fdbf3d016b81a3
- Sigstore transparency entry: 145783222
- Sigstore integration time:
- Predicate type:
File details
Details for the file pipenv_poetry_migrate-0.5.11-py3-none-any.whl
.
File metadata
- Download URL: pipenv_poetry_migrate-0.5.11-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f5019f3d6f62a622a5c3277878ee130dc3b3d9bc9d053efb01d94ca21d3cbb |
|
MD5 | 2b10ba7b8c7a609c52e390da28b7f284 |
|
BLAKE2b-256 | 1a047acb0e7c24cf0499dbdd7454958cf99fbe0c13275b81df057eedb074f41c |
Provenance
The following attestation bundles were made for pipenv_poetry_migrate-0.5.11-py3-none-any.whl
:
Publisher:
release.yml
on yhino/pipenv-poetry-migrate
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pipenv_poetry_migrate-0.5.11-py3-none-any.whl
- Subject digest:
75f5019f3d6f62a622a5c3277878ee130dc3b3d9bc9d053efb01d94ca21d3cbb
- Sigstore transparency entry: 145783225
- Sigstore integration time:
- Predicate type: