The story of moving from Pipenv to Poetry

The team members complained that Pipenv's lock wasn't over yet ... I will move to Poetry, which seems to solve this problem!

It is a story.

It's a story you often see: smiley:

Premise

--There is a private PyPI index server --Do not change the version description method --Moving packages and dev-packages respectively --Move if you can script

Moving tool

poetry # 1701 and poetry # 663 When you look at it There seems to be a dephell or one-liner method, It didn't feel like meeting the above assumptions.

So I made a tool called pipenv-poetry-migrate: tada: I don't have a test because it feels like I've hit it, but I'll write it in the future: bow:

Moving procedure

Step 0: Install poetry, pipenv-poetry-migration

Install poetry using the officially recommended method (https://python-poetry.org/docs/#installation). Install pipenv-poetry-migration with the following command.

$ pip install -U pipenv-poetry-migration

Step 1: Create pyproject.toml

First, create pyproject.toml to move to.

$ poetry init

Leave the dependent packages empty by answering no.

Step 2: Run the moving script

$ pipenv-poetry-migrate -f Pipfile -t pyproject.toml

Nothing is output, but dependent packages, scripts, etc. are moved to pyproject.toml.

Step 3: Create a lock file

$ poetry lock

Even if you're using a private PyPI index server, it should work because the settings have been moved. It may fail if there is a pre-release package. In that case, modify pyproject.toml.

Step 4: Install dependent packages in virtual environment

$ poetry install

If it ends normally, the construction of the virtual environment is completed.

I haven't finished moving yet

There are other moves besides Pipfile.

Is it around here? Don't forget to edit it. I think that this will change depending on the state of the project and repository, so I will fold it: bow:

The end

I think there are various pros and cons, but it was one of the various methods.

If you like pipenv-poetry-migrate, I hope you will continue to use it. We are also waiting for miscellaneous issues, PR, etc.!

Recommended Posts

The story of moving from Pipenv to Poetry
The story of copying data from S3 to Google's TeamDrive
After all, the story of returning from Linux to Windows
The story of pep8 changing to pycodestyle
Change the decimal point of logging from, to.
The story of sys.path.append ()
From the introduction of pyethapp to the execution of contract
The story of launching a Minecraft server from Discord
The story of wanting to buy Ring Fit Adventure
The story of using circleci to build manylinux wheels
The story of building Zabbix 4.4
[Apache] The story of prefork
Migrate from requirements.txt to pipenv
The story of switching from WoSign to Let's Encrypt for a free SSL certificate
The story of porting code from C to Go and getting hooked (and to the language spec)
[Python] I started Poetry & Impression that I moved from Pipenv to poetry
The story of introducing jedi (python auto-completion package) to emacs
The story of a Django model field disappearing from a class
How to calculate the amount of calculation learned from ABC134-D
The story of Python and the story of NaN
The story of participating in AtCoder
Existence from the viewpoint of Python
The story of the "hole" in the file
The story of remounting the application server
Supplement to the explanation of vscode
The story of writing a program
[Python] Try to graph from the image of Ring Fit [OCR]
A story that struggled to handle the Python package of PocketSphinx
Read all the contents of proc / [pid] ~ From cwd to loginuid ~
Read all the contents of proc / [pid] ~ From map_files to numa_maps ~
Read all the contents of proc / [pid] ~ From oom_adj to sessionid ~
[Pythonista] The story of making an action to copy selected text
From the introduction of JUMAN ++ to morphological analysis of Japanese with Python
Read all the contents of proc / [pid] ~ from attr to cpuset ~
The story of failing to update "calendar.day_abbr" on the admin screen of django
From the introduction of GoogleCloudPlatform Natural Language API to how to use it
The story of an error in PyOCR
Script to change the description of fasta
10 methods to improve the accuracy of BERT
How to check the version of Django
The story of verifying the open data of COVID-19
zoom I tried to quantify the degree of excitement of the story at the meeting
The story of making Python an exe
Learning notes from the beginning of Python 1
Omit BOM from the beginning of the string
Using Poetry with Fish (Migration from Pipenv)
Wikipedia goes from the era of writing to the era of creation ~ Automatic generation from Twitter
The story of making an immutable mold
The story of manipulating python global variables
How to operate Linux from the console
I tried to extract and illustrate the stage of the story using COTOHA
The story of trying deep3d and losing
The story of deciphering Keras' LSTM model.predict
How to access the Datastore from the outside
Summary of vtkThreshold (updated from time to time)
Get the song name from the title of the video you tried to sing
The story of blackjack A processing (python)
I tried the common story of using Deep Learning to predict the Nikkei 225
The story of trying to push SSH_AUTH_SOCK obsolete on screen with LD_PRELOAD
Learning notes from the beginning of Python 2
A story about creating a program that will increase the number of Instagram followers from 0 to 700 in a week