Python environment management in LabThings config file
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 4
- Merge medio
- 4 d 15 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de labthings/labthings-fastapi
-
Tests can fail on `anyio < 4.14`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
labthings/labthings-fastapi#438 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
labthings/labthings-fastapi#435 ·
Los mantenedores suelen responder en 3 días
-
Consider atomic JSON writesQuizá libre de nuevo @ashiishe2-oss la tomó hace 26 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
labthings/labthings-fastapi#412 · 3 comentarios ·
Los mantenedores suelen responder en 3 días
-
Use `Exception.add_note`Abiertodrop-python-version
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
labthings/labthings-fastapi#354 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Log propagation issueAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
labthings/labthings-fastapi#312 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de labthings/labthings-fastapi
Issues similares
-
bug feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Qiskit/qiskit-obp#156 ·
-
perf(batch-jobs): discover-misses reads the state list without running the whole stage reportAbiertoaction-item enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
getcommunityone/open-navigator#1658 ·
Los mantenedores suelen responder en 1 día
-
review-panel severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kristovatlas/coin-accounting#636 ·
Los mantenedores suelen responder en 1 día