Files
fundor333.com/content/post/2024/why-do-i-disinstall-pipenv-and-use-only-poetry/index.md
Fundor333 89ddedb948 Minor fix
2024-07-11 11:29:25 +02:00

4.5 KiB

title, date, feature_link, feature_text, tags, slug, categories, description, type, mp-syndicate-to, images, keywords
title date feature_link feature_text tags slug categories description type mp-syndicate-to images keywords
Why Do I Disinstall Pipenv and Use Only Poetry? 2024-07-10T11:34:15+01:00 https://www.midjourney.com/home/ by IA Midjourney
poetry
pipenv
pyproject
pyenv
why-do-i-disinstall-pipenv-and-use-only-poetry
dev
coding
I choose to don't use pipenv and move to poetry and pyproject and other stuff for dev with python post
https://brid.gy/publish/twitter
https://brid.gy/publish/mastodon

Some time ago I wrote about my preference to write Terminal Commands for what I need 1 and thant was not all.

Sometime More than often I need to build the same basic project for make a Terminal Command and I usualy use makefile2 for the building of the project or the command specific for this or that particolar project3 .

So I develop with git and pyproject a "blank" project as template for my personal python project.

The main idea is to build something with all I need for python, not only the "booring stuff". I toke some ispiration from other post and project of mine 4 5

VEnv

Starting the .venv

I love the .venv and all the cleaner workspace which came with it but I choose, at the begginning, the wrong tool.

In the beginning, I wrote all my project with a pipfile6 in mind.

If it is a personal project you need to run only on your machine and not relese anyware else it is a great tool. But with the new white hairs I change my mind.

I find usefull have all ready for mass distribuition of some of my code or having a simpler system to install as a command one script made in Click and, because pyproject will be the new standard, I try it.

PyProject without a tool is horrible. It's easy to read butyou need to know all the parameters and keywords soo...

And I need others tools which are inside dedicate dotfiles so I search for something more funtional and easy to use and poetry was suggested to me.

Poetry

Poetry is a terminal tool for creating and manipolation of venv and pyproject.toml's files. With some expirience I add more stuff in the pyproject for the basic.

Pre-Commit and Editor-config

Some time I work at night or with time restriction I make error or make something not python-like but spaghetti-like and this is bad. Spaghetti code

For this reason I add pre-commit7 and editorconfig for autofix all this minor error. And because I add pre-commit I add more dotfiles for configurations of all the parts of the project and the tools.

With pre-commit setted for your project you have an automatic way to check your code and valitated the new code without pushing and "waysting" CI cycles 8 .

Editor config if one of the best thing I find on the web. It is divided in two part:

  1. A config file (.editorconfig) with the indication for all the type of the file of the project and how they must be formatted9
  2. A checker (IDE, IDE Plugin, CI) which format the code following the .editorconfig file

Conclusion

This is a generic python project but you can do it for all the type of projects and make your personal templating repo of Github


  1. [Why I Stop Making Script and Start to Make Bash Terminal Commands]({{< ref "/post/2023/why-i-stop-making-script-and-start-to-make-bash-terminal-commands" >}} "Why I Stop Making Script and Start to Make Bash Terminal Commands") ↩︎

  2. [The team makefile]({{< ref "/post/2021/the-team-makefile" >}} "The team makefile") ↩︎

  3. How to create a self-documenting Makefile ↩︎

  4. [Dotfiles, bot and yaml files]({{< ref "/post/2020/dotfiles-bot-yaml" >}} "Dotfiles, bot and yaml files") ↩︎

  5. [From DevOps to GitOps]({{< ref "/post/2021/from-devops-to-gitops" >}} "From DevOps to GitOps") ↩︎

  6. [Pipenv e come tutto è in uno]({{< ref "/post/2017/pipenv-e-come-tutto-e-in-uno" >}} "Pipenv e come tutto è in uno") ↩︎

  7. Using pre-commit hooks to write better code ↩︎

  8. Sometime you have a slow CI or a "premium" CI so the cycles are a fine resource to keep. ↩︎

  9. I have a multifile format file done by me but if you need to start you can generate your own here ↩︎