Skip to content

Conversation

@falkoschindler
Copy link
Contributor

@falkoschindler falkoschindler commented Oct 21, 2025

Motivation

I'd like to see how our project setup would look like based on uv.

Implementation

This PR is almost 100% AI-generated:

  1. pyproject.toml - Converted from Poetry format to PEP 621 standard format:

    • Changed [tool.poetry] to [project]
    • Converted dependencies to standard format
    • Moved optional dependencies to [project.optional-dependencies]
    • Created [dependency-groups] section for dev dependencies (uv standard)
    • Updated build system to use hatchling instead of Poetry
    • Preserved all important security and version comments
  2. .github/workflows/test.yml - Updated to use uv:

    • Replaced abatilo/actions-poetry@v4 with astral-sh/setup-uv@v7
    • Removed cache: "poetry" (uv handles caching automatically)
    • Changed poetry install to uv sync --all-extras --group dev
    • Changed poetry run to uv run
  3. .github/workflows/publish.yml - Updated to use uv:

    • Replaced Poetry setup with uv
    • Changed version setting to use sed instead of poetry version
    • Updated build command to uv build
    • Updated publish command to uv publish with UV_PUBLISH_TOKEN
  4. fly.dockerfile - Updated to use uv:

    • Removed Poetry installation
    • Added uv installation from official Docker image
    • Changed poetry install to uv sync with appropriate flags
    • Updated to use uv pip install --system
  5. development.dockerfile - Updated to use uv:

    • Removed Poetry installation
    • Added uv installation
    • Changed to uv sync --all-extras
  6. CONTRIBUTING.md - Updated documentation:

    • Added uv installation instructions
    • Changed setup command from pip install -e . to uv sync --all-extras --group dev
  7. poetry.lock - Deleted (replaced with uv.lock)

  8. uv.lock - Generated with all dependencies resolved (164 packages)

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
    • Let's wait for the build pipeline.
  • Pytests are not necessary.
  • Documentation has been updated.

@falkoschindler falkoschindler added the infrastructure Type/scope: GitHub Actions and IDE label Oct 21, 2025
@evnchn
Copy link
Collaborator

evnchn commented Oct 21, 2025

@falkoschindler good thing to give this a shot, and I appreciate your bravery and efforts in kick-starting this big change, but we may want to do this at the later end of 3.x?

One thing immediately that I need to point out because I did look into this:

pyproject.toml - Converted from Poetry format to PEP 621 standard format

Consider uvx migrate-to-uv (https://github.com/mkniewallner/migrate-to-uv) because AI may not be accurate. AI have been observed to miss lines while copying stuff verbatim, even.

@EmberLightVFX
Copy link
Contributor

I tried migrate-to-uv before, it works great!
For NiceGUI I'm currently using UV to create a venv, uv pip install poetry to install poetry and then run like normal.
Personally I do like UV more than Poetry, mostly as you install UV outside a python instance so I don't need to install python on a new system and it's quite faster, but that's just me 😄

@falkoschindler
Copy link
Contributor Author

@codingpaula @pascalzauberzeug I wonder if our dynamic versioning will still work. Claude recommended to keep the "poetry-dynamic-versioning" build system. What do you think? Maybe we simply have to try it out.

@falkoschindler falkoschindler added this to the 3.4 milestone Nov 21, 2025
@falkoschindler falkoschindler added the review Status: PR is open and needs review label Nov 21, 2025
@falkoschindler falkoschindler marked this pull request as ready for review November 21, 2025 10:03
@pascalzauberzeug
Copy link
Contributor

@falkoschindler I think you just have to install it locally to test it. Since version 3.0.0 is hardcoded, it should be easy to see

@falkoschindler
Copy link
Contributor Author

@pascalzauberzeug

uv pip install -e .
uv run python -c 'import nicegui; print(nicegui.__version__)'

Output:

3.0.4.dev0

This doesn't look right...

@pascalzauberzeug
Copy link
Contributor

@falkoschindler 😞 I will look into it

@pascalzauberzeug
Copy link
Contributor

There seems to be no dynamic versioning in uv

@himbeles
Copy link
Contributor

himbeles commented Nov 26, 2025

There is, if you use poetry-dynamic-versioning and the poetry build backend, as you already do.
It is just not properly configured. As pointed out in the review above.

Alternatively, you can use hatchling + uv-dynamic-versioning.

codingpaula
codingpaula previously approved these changes Dec 1, 2025
rodja
rodja previously approved these changes Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Type/scope: GitHub Actions and IDE review Status: PR is open and needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants