Python environment management in LabThings config file
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
The issue does not name implementation files or tests. Read the configuration format and how it maps each Thing to its class, then review how the project currently documents Python dependencies; the issue frames this as discussion and leaves the format and scope undecided. Done would require a decided approach for representing package requirements and generating a requirements.in file.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Is your feature request related to a problem? Please describe.
A LabThings server is configured by a config file that specifies the class for each Thing. That depends on all of the relevant packages existing in the current Python environment, which isn't guaranteed.
Describe the solution you'd like
The LabThings config file could include the package name (which isn't always the same as the module name) for each Thing. It could even include a version and/or hash. LabThings would then be able to parse a config file and produce a requirements.in file that's able to be interpreted by pip or uv. Said file could then be compiled into a version-locked requirements.txt file (including package hashes) for a reproducible environment.
It will take a bit of thought to figure out a format that works without unnecessary duplication of information, especially when specifying software versions and thinking about version locking/pinning. It is also important to make sure we don't duplicate work that's already done much better by tools like pip, uv and so on. However, I think it could be pretty valuable if the config file is able to act as a single source of truth for the required Python environment.
I am not convinced we want to enter the murky waters of LabThings managing python environments directly. That feels like a big step up in software complexity. However, if it can play nicely with environment management tools (e.g. by generating a requirements.in) that might be very useful.
For example, the OpenFlexure management server could allow someone to configure the labthings config file, which in turn generates a requirements.in that allows it to ensure that the packages required for a given configuration are installed. Thinking that through, it might not play nicely with projects that substantially customise the LabThings server, because this creates a sort of chicken-and-egg problem (you'd need that package before you can load the config file...). I think it could still be useful, but exactly what takes priority would need careful thought. It would probably work better if server customisations could be fully specified through the config file, that's a sizeable change to how it's currently run though.
Describe alternatives you've considered
The obvious alternative is using the existing config file together with a requirements.in or requirements.txt file. There's something appealing to me about linking individual Things to packages rather than specifying the two independently.
Additional context
This issue is mostly me recording some thoughts from a conversation with a colleague at HTT, it's here to prompt discussion rather than immediate implementation.
- Langage dominant
- Python
- Étoiles
- 10
- Forks
- 4
- Merge moyen
- 4 j 15 h
- PR mergées (30 j)
- 11
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de labthings/labthings-fastapi
-
Tests can fail on `anyio < 4.14`Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
labthings/labthings-fastapi#438 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
labthings/labthings-fastapi#435 ·
Les mainteneurs répondent en général sous 3 jours
-
Consider atomic JSON writesPeut-être à nouveau libre @ashiishe2-oss l’a pris il y a 26 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
labthings/labthings-fastapi#412 · 3 commentaires ·
Les mainteneurs répondent en général sous 3 jours
-
Use `Exception.add_note`Ouvertedrop-python-version
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
labthings/labthings-fastapi#354 · 2 commentaires ·
Les mainteneurs répondent en général sous 3 jours
-
Log propagation issueOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
labthings/labthings-fastapi#312 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de labthings/labthings-fastapi
Issues similaires
-
bug feature request
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Qiskit/qiskit-obp#156 ·
-
perf(batch-jobs): discover-misses reads the state list without running the whole stage reportOuverteaction-item enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
getcommunityone/open-navigator#1658 ·
Les mainteneurs répondent en général sous 1 jour
-
review-panel severity:low
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
kristovatlas/coin-accounting#636 ·
Les mainteneurs répondent en général sous 1 jour