Skip to content

Commit

Permalink
Accept .bumpver.toml as a valid config file (#223)
Browse files Browse the repository at this point in the history
* Accept .bumpver.toml as a valid config file

---------

Co-authored-by: Manuel Barkhau <mbarkhau@gmail.com>
  • Loading branch information
XF-FW and mbarkhau authored Oct 13, 2023
1 parent e906776 commit 0cc48cf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/bumpver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
FilePatternsItem = typ.Tuple[str, typ.List[Pattern]]


SUPPORTED_CONFIGS = ["setup.cfg", "pyproject.toml", "pycalver.toml", "bumpver.toml"]
SUPPORTED_CONFIGS = [
"setup.cfg",
"pyproject.toml",
"pycalver.toml",
"bumpver.toml",
".bumpver.toml",
]


class TagScope(str, enum.Enum):
Expand Down Expand Up @@ -61,6 +67,7 @@ def _pick_config_filepath(path: pl.Path) -> pl.Path:
config_candidates: typ.List[pl.Path] = [
path / "pycalver.toml",
path / "bumpver.toml",
path / ".bumpver.toml",
path / "pyproject.toml",
path / "setup.cfg",
]
Expand Down Expand Up @@ -635,6 +642,11 @@ def init(
]
""".lstrip()

DEFAULT_TOML_DOT_BUMPVER_STR = """
".bumpver.toml" = [
'current_version = "{version}"',
]
""".lstrip()

DEFAULT_TOML_PYPROJECT_STR = """
"pyproject.toml" = [
Expand Down Expand Up @@ -697,6 +709,7 @@ def default_config(ctx: ProjectContext) -> str:
"pyproject.toml": DEFAULT_TOML_PYPROJECT_STR,
"pycalver.toml" : DEFAULT_TOML_PYCALVER_STR,
"bumpver.toml" : DEFAULT_TOML_BUMPVER_STR,
".bumpver.toml" : DEFAULT_TOML_DOT_BUMPVER_STR,
"setup.py" : DEFAULT_TOML_SETUP_PY_STR,
"README.rst" : DEFAULT_TOML_README_RST_STR,
"README.md" : DEFAULT_TOML_README_MD_STR,
Expand Down

0 comments on commit 0cc48cf

Please sign in to comment.