()
| 23 | |
| 24 | |
| 25 | def get_default_version_provider() -> Literal[ |
| 26 | "commitizen", "cargo", "composer", "npm", "pep621", "poetry", "uv" |
| 27 | ]: |
| 28 | pyproject_path = Path("pyproject.toml") |
| 29 | if pyproject_path.is_file(): |
| 30 | # TOML files are UTF-8 by specification, whatever the locale encoding |
| 31 | if "[tool.poetry]" in pyproject_path.read_text(encoding="utf-8"): |
| 32 | return "poetry" |
| 33 | if Path("uv.lock").is_file(): |
| 34 | return "uv" |
| 35 | return "pep621" |
| 36 | |
| 37 | if Path("setup.py").is_file(): |
| 38 | return "pep621" |
| 39 | |
| 40 | if Path("Cargo.toml").is_file(): |
| 41 | return "cargo" |
| 42 | |
| 43 | if Path("package.json").is_file(): |
| 44 | return "npm" |
| 45 | |
| 46 | if Path("composer.json").is_file(): |
| 47 | return "composer" |
| 48 | |
| 49 | return "commitizen" |
| 50 | |
| 51 | |
| 52 | def get_default_config_filename() -> Literal["pyproject.toml", ".cz.toml"]: |
nothing calls this directly
no outgoing calls
no test coverage detected