2323]
2424DEFAULT_PYTHON_VERSION : str = PYTHON_VERSIONS [- 1 ]
2525
26- REPO_ROOT : Path = Path (__file__ ).parent
26+ REPO_ROOT : Path = Path (__file__ ).parent .resolve ()
27+ SCRIPTS_FOLDER : Path = REPO_ROOT / "scripts"
2728CRATES_FOLDER : Path = REPO_ROOT / "rust"
2829PACKAGE_NAME : str = "{{cookiecutter.package_name}}"
2930GITHUB_USER : str = "{{cookiecutter.github_user}}"
@@ -44,31 +45,16 @@ def setup_repo(session: Session) -> None:
4445@nox .session (python = None , name = "setup-git" )
4546def setup_git (session : Session ) -> None :
4647 """Set up the git repo for the current project."""
47- session .run ("git" , "init" )
48- session .run ("git" , "branch" , "-M" , "main" )
49-
5048 session .run (
51- "git " , "remote " , "add" , "origin " , f"https://github.com/ { GITHUB_USER } / { PACKAGE_NAME } .git" , "|| " , "true"
49+ "python " , SCRIPTS_FOLDER / "setup-git.py " , REPO_ROOT , "-u " , GITHUB_USER , "-n " , PACKAGE_NAME , external = True
5250 )
53- session .run ("git" , "remote" , "set-url" , "origin" , f"https://github.com/{ GITHUB_USER } /{ PACKAGE_NAME } .git" )
54- session .run ("git" , "fetch" , "origin" )
55-
56- session .run ("git" , "push" , "-u" , "origin" , "main" )
57- session .run ("git" , "checkout" , "-b" , "develop" , "main" )
58- session .run ("git" , "push" , "-u" , "origin" , "develop" )
59-
60- session .run ("git" , "add" , "." )
61- session .run ("git" , "commit" , "-m" , "feat: initial commit" )
62- session .run ("git" , "push" , "origin" , "develop" )
6351
6452
6553@nox .session (python = None , name = "setup-venv" )
6654def setup_venv (session : Session ) -> None :
67- session .run ("uv" , "lock" , external = True )
68- session .run ("uv" , "venv" , ".venv" , external = True )
69- session .run ("uv" , "python" , "install" , PYTHON_VERSIONS [0 ], external = True )
70- session .run ("uv" , "python" , "pin" , PYTHON_VERSIONS [0 ], external = True )
71- session .run ("uv" , "sync" , "--all-groups" , external = True )
55+ session .run (
56+ "python" , SCRIPTS_FOLDER / "setup-venv.py" , REPO_ROOT , "-p" , PYTHON_VERSIONS [0 ], external = True
57+ )
7258
7359
7460@nox .session (python = DEFAULT_PYTHON_VERSION , name = "pre-commit" )
0 commit comments