pipenv-poetry-migrate


Namepipenv-poetry-migrate JSON
Version 0.5.5 PyPI version JSON
download
home_pagehttps://github.com/yhino/pipenv-poetry-migrate
Summarysimple migration script, migrate pipenv to poetry
upload_time2024-04-01 09:22:01
maintainerNone
docs_urlNone
authorYoshiyuki HINO
requires_python<4.0,>=3.8.1
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">pipenv-poetry-migrate</h1>
<p align="center">This is simple migration script, migrate pipenv to poetry.</p>

<p align="center">
    <a href="https://pypi.org/project/pipenv-poetry-migrate/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/pipenv-poetry-migrate"></a>
    <a href="https://pypi.org/project/pipenv-poetry-migrate/"><img src="https://img.shields.io/pypi/dm/pipenv-poetry-migrate" alt="PyPI - Downloads"></a>
    <a href="https://github.com/yhino/pipenv-poetry-migrate/actions/workflows/test.yml"><img src="https://github.com/yhino/pipenv-poetry-migrate/actions/workflows/test.yml/badge.svg" alt="Test"></a>
    <a href="https://codecov.io/gh/yhino/pipenv-poetry-migrate"><img src="https://codecov.io/gh/yhino/pipenv-poetry-migrate/branch/main/graph/badge.svg?token=LHZGQ8MMWT" alt="Codecov"></a>
    <a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate?ref=badge_shield"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate.svg?type=shield" alt="FOSSA Status"></a>
</p>

## :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](https://python-poetry.org/docs/master/managing-dependencies/#dependency-groups), 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.

```toml
[[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.

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

```toml
[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

1. Fork and clone the repository, and create the development branch.
2. Run `poetry install` to setup your develop environment.
3. Do your code.
4. Run `bash scripts/test.sh` to check that your test passed.
5. Run `bash scripts/format.sh` and `bash scripts/lint.sh` to check that you haven't warnings.
6. 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

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate?ref=badge_large)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yhino/pipenv-poetry-migrate",
    "name": "pipenv-poetry-migrate",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Yoshiyuki HINO",
    "author_email": "yhinoz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/30/b9d90beb460a2be8085a832fb6bd69d888ebd5b29fb882ca6224ead29a30/pipenv_poetry_migrate-0.5.5.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">pipenv-poetry-migrate</h1>\n<p align=\"center\">This is simple migration script, migrate pipenv to poetry.</p>\n\n<p align=\"center\">\n    <a href=\"https://pypi.org/project/pipenv-poetry-migrate/\"><img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/pipenv-poetry-migrate\"></a>\n    <a href=\"https://pypi.org/project/pipenv-poetry-migrate/\"><img src=\"https://img.shields.io/pypi/dm/pipenv-poetry-migrate\" alt=\"PyPI - Downloads\"></a>\n    <a href=\"https://github.com/yhino/pipenv-poetry-migrate/actions/workflows/test.yml\"><img src=\"https://github.com/yhino/pipenv-poetry-migrate/actions/workflows/test.yml/badge.svg\" alt=\"Test\"></a>\n    <a href=\"https://codecov.io/gh/yhino/pipenv-poetry-migrate\"><img src=\"https://codecov.io/gh/yhino/pipenv-poetry-migrate/branch/main/graph/badge.svg?token=LHZGQ8MMWT\" alt=\"Codecov\"></a>\n    <a href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate?ref=badge_shield\"><img src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate.svg?type=shield\" alt=\"FOSSA Status\"></a>\n</p>\n\n## :rocket: Get Started\n\n### Installation\n\n    $ pip install -U poetry pipenv-poetry-migrate\n\n### Migration\n\n#### Step 1: Create `pyproject.toml` file\n\n    $ poetry init\n\n#### Step 2: Migrate\n\nTo migrate `Pipfile` to `pyproject.toml`.\n\n    $ pipenv-poetry-migrate -f Pipfile -t pyproject.toml\n\nWhen want to run dry-run mode:\n\n    $ pipenv-poetry-migrate -f Pipfile -t pyproject.toml -n\n\nDry-run mode is `pyproject.toml` file does not overwrite, results are displayed on standard output.\n\n> [!Note]  \n> If the dependency already exists in the poetry dependency and you want to re-migrate it, please use the `--re-migrate` option.\n> However, if the dependency is removed from pipenv, the poetry dependency is not removed.\n>\n>     $ pipenv-poetry-migrate -f Pipfile -t pyproject.toml --re-migrate\n\n> [!Note]  \n> The default behavior is to migrate with the [group notation](https://python-poetry.org/docs/master/managing-dependencies/#dependency-groups), which has been available since Poetry 1.2.0.\n> If you want to migrate with `dev-dependencies` notation, please use the `--on-use-group-notation` option.\n> \n>     $ pipenv-poetry-migrate -f Pipfile -t pyproject.toml --no-use-group-notation\n\n#### Step 3: Generate lock file\n\n    $ poetry lock\n\nIf there is already a `poetry.lock` file, remove it first.\n\n#### Step 4: Installing dependencies\n\nTo install the defined dependencies for your project.\n\n    $ poetry install\n\n### Example output\n\nThis is an example of a Pipfile to be migrated.\n\n```toml\n[[source]]\nurl = \"https://pypi.python.org/simple\"\nverify_ssl = true\nname = \"pypi\"\n\n[packages]\nrequests = \"*\"\n\n[dev-packages]\npytest = \"^5.2\"\n```\n\nMigrate the above file to the following pyproject.toml.\n\n```toml\n[tool.poetry]\nname = \"migration-sample\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"Yoshiyuki HINO <yhinoz@gmail.com>\"]\n\n[tool.poetry.dependencies]\npython = \"^3.7\"\n\n[tool.poetry.group.dev.dependencies]\n\n[build-system]\nrequires = [\"poetry-core\"]\nbuild-backend = \"poetry.core.masonry.api\"\n```\n\nBy executing this script, pyproject.toml is rewritten as follows.\n\n```toml\n[tool.poetry]\nname = \"migration-sample\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"Yoshiyuki HINO <yhinoz@gmail.com>\"]\n\n[tool.poetry.dependencies]\npython = \"^3.7\"\nrequests = \"*\"\n\n[tool.poetry.group.dev.dependencies]\npytest = \"^5.2\"\n\n[build-system]\nrequires = [\"poetry-core\"]\nbuild-backend = \"poetry.core.masonry.api\"\n```\n\n## :handshake: Contributing\n\n1. Fork and clone the repository, and create the development branch.\n2. Run `poetry install` to setup your develop environment.\n3. Do your code.\n4. Run `bash scripts/test.sh` to check that your test passed.\n5. Run `bash scripts/format.sh` and `bash scripts/lint.sh` to check that you haven't warnings.\n6. Open a PR on GitHub.\n\n### Test cases\n\nTest cases are in `tests/toml`, update `Pipfile` with additional entries and `expect_pyproject.toml` with expected output.\n\n\n## :pencil: License\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyhino%2Fpipenv-poetry-migrate?ref=badge_large)\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "simple migration script, migrate pipenv to poetry",
    "version": "0.5.5",
    "project_urls": {
        "Homepage": "https://github.com/yhino/pipenv-poetry-migrate",
        "Repository": "https://github.com/yhino/pipenv-poetry-migrate"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2927b9d13191b143f9be2b267a14c12f1cc9df7c374764d811dcb8d91fc5f8af",
                "md5": "38e36b614e47b81673a6577e4ddc9b3a",
                "sha256": "3a61a34020aef3b2fad474e1703cd5103a3433e5dfd4c49e5ba6fb3808cfb239"
            },
            "downloads": -1,
            "filename": "pipenv_poetry_migrate-0.5.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "38e36b614e47b81673a6577e4ddc9b3a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 10672,
            "upload_time": "2024-04-01T09:21:59",
            "upload_time_iso_8601": "2024-04-01T09:21:59.396521Z",
            "url": "https://files.pythonhosted.org/packages/29/27/b9d13191b143f9be2b267a14c12f1cc9df7c374764d811dcb8d91fc5f8af/pipenv_poetry_migrate-0.5.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca30b9d90beb460a2be8085a832fb6bd69d888ebd5b29fb882ca6224ead29a30",
                "md5": "b843a148c10a4a634ae5a31978631a3d",
                "sha256": "87e99d7516a7a5ec85a8d815e6be7fe7761bd378f5feb2abfc15225bb1cc23df"
            },
            "downloads": -1,
            "filename": "pipenv_poetry_migrate-0.5.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b843a148c10a4a634ae5a31978631a3d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 9341,
            "upload_time": "2024-04-01T09:22:01",
            "upload_time_iso_8601": "2024-04-01T09:22:01.111468Z",
            "url": "https://files.pythonhosted.org/packages/ca/30/b9d90beb460a2be8085a832fb6bd69d888ebd5b29fb882ca6224ead29a30/pipenv_poetry_migrate-0.5.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 09:22:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yhino",
    "github_project": "pipenv-poetry-migrate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pipenv-poetry-migrate"
}
        
Elapsed time: 0.28789s