Skip to content

Introduce a Depndency Lock File for Development #4796

@harshil21

Description

@harshil21

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

Now that uv is well known and established in python community and adopted by many projects, we should consider using some more uv features in our repository.

Describe the solution you'd like

Here's what we can initially change:

  1. The CI for unit tests can use uv built python's, along with using uv commands to setup the job and install dependencies.
  2. Commiting the uv.lock file to the repo to increase reproduciblity across different machines.
  3. Using uv build instead of the build package in the CI.
  4. Using uv publish to release to pypi. They mention that it works through GH actions too, but I don't know how it plays with our specific setup, maybe @Bibo-Joshi can determine if it's a good enough fit.
  5. In the future, we could try using the uv build-backend too.

Another idea I had would be to provide a "demo" app, so one could do something like:

uvx python-telegram-bot echobot

and this would run echobot.py (we'd have to read the bot token from stdin or env var).

Describe alternatives you've considered

Not using uv and staying outdated

Additional context

I don't think it's worth replacing all mentions of pip install with something like uv add, but I think we should at least acknowledge the existence of uv in the readme/docs somewhere to encourage more adoption. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚙️ documentationaffected functionality: documentation🔗 pythonrelated technology: python

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions