(file: Path, bump_type: t.Optional[str] = None)
| 133 | |
| 134 | |
| 135 | def _bump_pyproject_toml(file: Path, bump_type: t.Optional[str] = None): |
| 136 | # Load config |
| 137 | content = file.read_text(encoding="utf-8") |
| 138 | config = tomli.loads(content) |
| 139 | project = t.cast(dict, config["project"]) |
| 140 | |
| 141 | # Extract meta |
| 142 | package = project["name"] |
| 143 | version = project["version"] |
| 144 | |
| 145 | # Bump version |
| 146 | next_version = _get_version_update( |
| 147 | package=package, |
| 148 | version=version, |
| 149 | bump_type_selector=bump_type, |
| 150 | ) |
| 151 | if next_version is None: |
| 152 | click.echo(f"* Skipping {package}") |
| 153 | return |
| 154 | |
| 155 | click.echo(f"* Bumping {package} {version} -> {next_version}") |
| 156 | content = content.replace(f'version = "{version}"', f'version = "{next_version}"') |
| 157 | file.write_text(content, encoding="utf-8") |
| 158 | |
| 159 | |
| 160 | def _bump_package(file: Path, bump_type: t.Optional[str] = None): |
no test coverage detected
searching dependent graphs…