Giter Site home page Giter Site logo

pipenv-poetry-migrate's Introduction

pipenv-poetry-migrate

FOSSA Status

This is simple migration script, migrate pipenv to poetry.

Install

$ pip install -U pipenv-poetry-migrate

Usage

$ 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.

Migration

Step 0: Install packages

$ pip install poetry pipenv-poetry-migrate

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

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

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 <[email protected]>"]

[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 <[email protected]>"]

[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"

License

FOSSA Status

pipenv-poetry-migrate's People

Contributors

fossabot avatar yhino avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.