theskumar / theskumar/python-dotenv
Consider using bashlex
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 8.9k
- Forks
- 581
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hi.
I've been using .env files for a while, namely to setup variable and load python virtual environments, also with stuff like autoenv.
This means that my .env files have bash code, like if statements, sourcing other scripts, commands, functions.
dotenvs limited reader code just uses a couple regexs that can't handle much more than export statements. And this is something some people might not be expecting.
Suggestion:
- use bashlex to parse the
.envfiles. https://github.com/idank/bashlex - gather variables defined only at the top level
- implement variable substitution (quite easy to implement) e.g.
${VARNAME:-fallback} - recursively source other sourced scripts, e.g.
.envincludes the linesource .envrc.
This would be a reimplementation of the module, so perhaps something for a major release ?
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.
Línea de trabajo
The issue proposes replacing dotenv's limited reader with bashlex. Start by locating the existing .env reader and reviewing bashlex's parsing model; done means top-level variables, ${VARNAME:-fallback} substitution, and recursive source handling work for files such as .env sourcing .envrc, with the scope suitable for a major release.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bash, python
- Área
- devops, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100