Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Katalogas Python package manager #1456

Open
varzgalys opened this issue Jan 24, 2025 · 2 comments
Open

Katalogas Python package manager #1456

varzgalys opened this issue Jan 24, 2025 · 2 comments
Labels
story User Story

Comments

@varzgalys
Copy link

varzgalys commented Jan 24, 2025

Migrate from "poetry" to "uv" (https://pypi.org/project/uv/, https://docs.astral.sh/uv/)

  • Faster,
  • More convenient for DevOps team.

Migration plan:

To replace Poetry with uv in the spinta repository, you'll need to update the following files:

1. pyproject.toml and lock files

Poetry uses pyproject.toml to manage dependencies in custom format. UV uses that same file as well but in sandart format.
There is one project wich will allow that conversion - https://pypi.org/project/migrate-to-uv/, which automates migration process - just run uvx migrate-to-uv

And it will:
Convert Poetry dependencies to uv dependencies
Migrated the lock file
Deletes old files like:
rm poetry.lock
rm poetry.toml
Creates uv.lock

2. Requirements.txt

requirements.txt is not created by default with UV, we need to freeze when for requirements.txt:
uv pip freeze > requirements.txt
And install when later needed with:
uv pip sync requirements.txt
requirements.txt won't be updated once you add a package through UV

3. README.md and Notes flles where Poetry is mentioned

If installation instructions/information mention Poetry, replace them with UV. Also, mention a case from step 2 where needed.

4. Docker

Dockerfile does not use poetry and is fully really on requirements.txt and can be supported by implementing step 2.

5. Deployment processes (scripts attached below)

During the deployment poetry is used - spinta is installed inside the server as a Python package - https://pypi.org/project/spinta/. So poetry removal should not break the deployment process as long as pyproject.toml is updated correctly

Definition of Done (steps to confirm):

  1. No poetry is installed, poetry is no longer used anywhere inside the codebase
  2. Tests do pass on freshly created Python environment (imitate new developer onboarding with a new setup)
  3. Test & Prod environments are still "deployable" and have no issues when releasing changes.

Related

@sirex
Copy link
Contributor

sirex commented Jan 28, 2025

Gera mintis, tik reikėtu atlikti analize ir migracijos planą, peržiūrinti, kaip dabar atliekami diegimai į prod/test ir dev aplinkas, atnaujinti readme ir notes failus.

Siūlyčiau tai daryti, kaip #1049 užduoties dalį, atskirai Katalogui ir Agentui. Kadangi automatinį diegimą į laikinas testavimo aplinkas, reikės replikuoti ir nuolatinei testavimo ir prod aplinkoms.

Reikia daugiau analizės su paaiškinimu, koks bus migracijos planas, kaip dabartinis Poetry turės būti konvertuotas į uv.

@varzgalys
Copy link
Author

Pridejau migracijos planą.
#1049 Trūksta aprašymo, bet galime ir susieti patogumui jei reikia

@TomasLie TomasLie added the story User Story label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story User Story
Projects
None yet
Development

No branches or pull requests

3 participants