Install Python development environment
(context: Context)
| 76 | |
| 77 | @task |
| 78 | def env_py(context: Context): |
| 79 | """Install Python development environment""" |
| 80 | for py_proj in [ |
| 81 | DOCS_DIR, |
| 82 | # Docs installs non-editable versions of packages - ensure |
| 83 | # we overwrite that by installing projects afterwards. |
| 84 | *PY_PROJECTS, |
| 85 | ]: |
| 86 | py_proj_toml_tools = toml.load(py_proj / "pyproject.toml")["tool"] |
| 87 | if "hatch" in py_proj_toml_tools: |
| 88 | install_func = install_hatch_project |
| 89 | elif "poetry" in py_proj_toml_tools: |
| 90 | install_func = install_poetry_project |
| 91 | else: |
| 92 | raise Exit(f"Unknown project type: {py_proj}") |
| 93 | with context.cd(py_proj): |
| 94 | install_func(context, py_proj) |
| 95 | |
| 96 | |
| 97 | @task |