zetonteam / zeton_django

Hacktoberfest
Apache License 2.0
10 stars 2 forks source link

feat: add poetry #79

Closed szmktk closed 2 weeks ago

szmktk commented 1 month ago

This merge request adds support for poetry package management tool.

Using Poetry over requirements.txt offers several advantages:

I validated the backend app manually after building a new docker image.

Steps to test this locally:

  1. checkout add-poetry branch
  2. run make build command to build a new Docker image that contains dependencies managed by poetry
  3. generate a token and verify endpoint operation using swagger-ui
miniMax18 commented 1 month ago

Very nice feature for one of the next update. If We will need this good poetry :). I am open to discuss that topic.

szmktk commented 1 month ago

@miniMax18 what is there to discuss? In JavaScript you have package.json file with dependencies and devDependencies to tell actual runtime project dependencies from test/development ones. On top of that you have a package-lock.json (or yarn.lock or whaetver) that ensures every developer gets the same version of every dependency (including transitive dependencies).

These are (among many others) the problems that poetry aims to solve. Problems we did not yet face, but probably will and I'm convinced it's silly not to prevent them easily now. If we're going to have a stable CI/CD pipeline for this project that I insist on having poetry in.

miniMax18 commented 1 month ago

@szmktk this some like "procedure" We need to know what we use(or will use). Thanks for that quality explain from JS world :). Nevertheless I know poetry tool from fast api product. I recommend @szmktk idea 👍 to adapt poetry in Zeton 💯

szmktk commented 3 weeks ago

@szmktk this some like "procedure" We need to know what we use(or will use).

@miniMax18 Here's a breakdown of the most common poetry commands:

So when you would like to add a new library just use poetry add new_library instead of editing requirements.txt file. This command will edit both pyproject.toml and poetry.lock files for you. :wink:

szmktk commented 2 weeks ago

add info in readme.md

Done :ok_hand: