55
66import nox
77import platformdirs
8- from dotenv import load_dotenv
8+
99from nox .command import CommandFailed
1010from nox .sessions import Session
1111
1818SCRIPTS_FOLDER : Path = REPO_ROOT / "scripts"
1919TEMPLATE_FOLDER : Path = REPO_ROOT / "{{cookiecutter.project_name}}"
2020
21-
22- # Load environment variables from .env and .env.local (if present)
23- _env_file : Path = REPO_ROOT / ".env"
24- _env_local_file : Path = REPO_ROOT / ".env.local"
25- if _env_file .exists ():
26- load_dotenv (_env_file )
27- if _env_local_file .exists ():
28- load_dotenv (_env_local_file , override = True )
29-
3021APP_AUTHOR : str = os .getenv ("COOKIECUTTER_ROBUST_PYTHON_APP_AUTHOR" , "robust-python" )
3122COOKIECUTTER_ROBUST_PYTHON_CACHE_FOLDER : Path = Path (
3223 platformdirs .user_cache_path (
5849@nox .session (python = DEFAULT_TEMPLATE_PYTHON_VERSION , name = "generate-demo" )
5950def generate_demo (session : Session ) -> None :
6051 """Generates a project demo using the cookiecutter-robust-python template."""
61- session .install ("cookiecutter" , "cruft" , "platformdirs" , "loguru" , "python-dotenv" , " typer" )
52+ session .install ("cookiecutter" , "cruft" , "platformdirs" , "loguru" , "typer" )
6253 session .run ("python" , GENERATE_DEMO_SCRIPT , * GENERATE_DEMO_OPTIONS , * session .posargs )
6354
6455
@@ -136,7 +127,7 @@ def test(session: Session) -> None:
136127@nox .session (python = DEFAULT_TEMPLATE_PYTHON_VERSION , name = "update-demo" )
137128def update_demo (session : Session , add_rust_extension : bool ) -> None :
138129 session .log ("Installing script dependencies for updating generated project demos..." )
139- session .install ("cookiecutter" , "cruft" , "platformdirs" , "loguru" , "python-dotenv" , " typer" )
130+ session .install ("cookiecutter" , "cruft" , "platformdirs" , "loguru" , "typer" )
140131
141132 session .log ("Updating generated project demos..." )
142133 args : list [str ] = [* UPDATE_DEMO_OPTIONS ]
@@ -161,7 +152,7 @@ def release_template(session: Session):
161152 session .skip ("Git not available." )
162153
163154 session .log ("Checking Commitizen availability via uvx." )
164- session .run ("cz" , "--version" , successcodes = [0 ])
155+ session .run ("cz" , "--version" , success_codes = [0 ])
165156
166157 increment = session .posargs [0 ] if session .posargs else None
167158 session .log (
0 commit comments