IA-Generative / Streamlit-dsfr

https://pypi.org/project/streamlit-dsfr/
0 stars 1 forks source link

Set _RELEASE with docker build env ? #85

Closed victorjourne closed 9 months ago

victorjourne commented 9 months ago

https://github.com/IA-Generative/Streamlit-dsfr/blob/cb2cdf72c7ba1902c81b2c92bd074243d927a464/Dockerfile#L148

matiboux commented 9 months ago

See the __init__.py for more context: https://github.com/IA-Generative/Streamlit-dsfr/blob/cb2cdf72c7ba1902c81b2c92bd074243d927a464/app/app/streamlit_dsfr/__init__.py#L22-L43

The behavior depends on the environment:

The _RELEASE flag value is constant but defined at initialization (at run time), so we cannot rely on a dynamic environment variable.

Another strategy would have been to use init different source code for each environment. However, using the release flag is the recommended strategy in Streamlit project templates and avoids code duplication.