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: 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:
poetry install
# get environment setupmake test
# run the tests
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
Hashes for pipenv_poetry_migrate-0.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fabd8147363bbbf4e7239fec576c28ea9e09251465a998cf1f4a82d2587aa795 |
|
MD5 | 4ecfb2a08d5a769fe1d47bd817417186 |
|
BLAKE2b-256 | 515299eb9d6bdf27b84a9166ff1ee53616cf4405e934b33471adf1bccdd192ad |
Hashes for pipenv_poetry_migrate-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a7a3eee0a7fb3996cc3ea967d24f54f52ff125697dc15880e003fcb8b4f7d8 |
|
MD5 | e6b453367d50cbcc3c843ef8eeb7ea5f |
|
BLAKE2b-256 | ee86d071d175ca5878f71dff3e806bb17ec4edf2b65f0e7fdc6d985db40eacda |