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.
:seedling: Use the --use-group-notation
option if you want to migrate to the new notation supported in poetry 1.2.
$ pipenv-poetry-migrate -f Pipfile -t pyproject.toml --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.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.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.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.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.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1707aa106fa9bb9a949bc54a8bda8502525414feb69b7635429393b66edf6b58 |
|
MD5 | b51acf71cb32753c5b6980e4a0c17b97 |
|
BLAKE2b-256 | 0f7aa722f61f9b6f6d4b14dd66b0415e6153e9a297df28e85c471d614ed457ba |
Hashes for pipenv_poetry_migrate-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b3c3c61bd1441ca573ed0f3cdd9e4b4b40c2e2132e5ac6aacd8bcb40ed95853 |
|
MD5 | 73a78de601fa73896b06128e5dea4af0 |
|
BLAKE2b-256 | cb35b0d17d7cbaa16b0852b5eadc60e6fe6b79094f8213f2af0151d169e59a4d |