Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Consider replacing Hatch with uv for project and dependency management

Ouverte
#199 4 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
À clarifier
Activité
Active
Stack technique
python

Piste de recherche

Commencez par le pyproject.toml du projet et les commandes Hatch listées pour la construction, les environnements, les scripts, la gestion des versions, le linting et les tests. Comparez ces responsabilités avec uv, notamment le uv.lock proposé, et examinez function-template-python pour sa configuration héritée. Le travail sera considéré comme terminé lorsque les gains et les pertes auront été documentés et qu’une décision aura été prise quant au remplacement de Hatch dans les deux projets.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement
What problem are you facing?

When I created this SDK in November 2023, the Python build and project management space was crowded. There was Hatch, Poetry, PDM, Flit, setuptools, and probably others I'm forgetting. There wasn't a clear winner. I picked Hatch because it was a PyPA project, it had a clean pyproject.toml-based configuration, and it covered everything I needed: environments, scripts, building, versioning, and linting (via its Ruff integration).

Today we use Hatch for:

  • Building wheels and sdists (hatch build), using hatchling as the PEP 517 build backend.
  • Environments with isolated dependencies — a generate env for protoc, a docs env for pdoc, and a hatch-static-analysis env for Ruff.
  • Scripts like hatch run generate:protoc and hatch run docs:generate.
  • Version management — reading the version from __version__.py at build time.
  • Linting via hatch fmt, which wraps Ruff.
  • Testing via hatch test, which wraps pytest.

function-template-python uses the same setup, and any new functions built from it will inherit it.

Hatch works. I don't have a concrete problem with it.

What I do have is a growing sense that the ecosystem has converged on uv in the ~18 months since I made this choice. uv didn't exist when I picked Hatch — its first release was February 2024, three months after this SDK. Since then it's grown to 82k GitHub stars (vs Hatch's 7.2k and Poetry's 34.3k) and 14,600 dependent repositories (vs Hatch's 1,800). It has a full-time team at Astral and ships releases at a pace that's hard to ignore.

We already use Astral's Ruff for linting and formatting, and I'm interested in their ty type checker too. Adopting uv would mean our Python build toolchain is entirely Astral: uv for project management, Ruff for linting, and potentially ty for type checking. That's less build plumbing for contributors to learn and install.

uv would also give us a lockfile (uv.lock) for pinning transitive dependencies, which Hatch doesn't support. We pin direct dependencies today but have no control over what versions of their transitive dependencies get installed.

How could this Function help solve your problem?

I think we should evaluate replacing Hatch with uv for project and dependency management in this SDK and in function-template-python. I'll follow up with a comment breaking down what we'd gain and what we'd lose.

Langage dominant
Python
Étoiles
12
Forks
15
Merge moyen
1 j 12 h
PR mergées (30 j)
7

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de crossplane/function-sdk-python

Toutes les issues de crossplane/function-sdk-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.