mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
make fmt
This commit is contained in:
parent
871a2a9740
commit
99c14c0df9
7 changed files with 10 additions and 11 deletions
|
|
@ -27,8 +27,9 @@ _VERBOSE = 0
|
||||||
|
|
||||||
# To enable pretty tracebacks:
|
# To enable pretty tracebacks:
|
||||||
# echo "export ENABLE_BACKTRACE=1;" >> ~/.bashrc
|
# echo "export ENABLE_BACKTRACE=1;" >> ~/.bashrc
|
||||||
if os.environ.get('ENABLE_BACKTRACE') == "1":
|
if os.environ.get('ENABLE_BACKTRACE') == '1':
|
||||||
import backtrace
|
import backtrace
|
||||||
|
|
||||||
backtrace.hook(align=True, strip_path=True, enable_on_envvar_only=True)
|
backtrace.hook(align=True, strip_path=True, enable_on_envvar_only=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -327,5 +328,6 @@ def bump(
|
||||||
|
|
||||||
_bump(cfg, new_version, allow_dirty)
|
_bump(cfg, new_version, allow_dirty)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
cli()
|
cli()
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ from . import version
|
||||||
|
|
||||||
log = logging.getLogger("pycalver.config")
|
log = logging.getLogger("pycalver.config")
|
||||||
|
|
||||||
Patterns = typ.List[str]
|
Patterns = typ.List[str]
|
||||||
PatternsByGlob = typ.Dict[str, Patterns]
|
PatternsByGlob = typ.Dict[str, Patterns]
|
||||||
|
|
||||||
SUPPORTED_CONFIGS = ["setup.cfg", "pyproject.toml", "pycalver.toml"]
|
SUPPORTED_CONFIGS = ["setup.cfg", "pyproject.toml", "pycalver.toml"]
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ def diff(new_version: str, file_patterns: config.PatternsByGlob) -> str:
|
||||||
content = fh.read()
|
content = fh.read()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rfd = rfd_from_content(pattern_strs, new_version, content)
|
rfd = rfd_from_content(pattern_strs, new_version, content)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
errmsg = f"No patterns matched for '{file_path}'"
|
errmsg = f"No patterns matched for '{file_path}'"
|
||||||
raise ValueError(errmsg)
|
raise ValueError(errmsg)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
|
|
||||||
__version__ = "v201307.0456-beta"
|
__version__ = "v201307.0456-beta"
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
|
|
||||||
__version__ = "v201307.0456-beta"
|
__version__ = "v201307.0456-beta"
|
||||||
|
|
|
||||||
|
|
@ -166,10 +166,12 @@ def test_incr_invalid(runner):
|
||||||
def _add_project_files(*files):
|
def _add_project_files(*files):
|
||||||
if "README.md" in files:
|
if "README.md" in files:
|
||||||
with pl.Path("README.md").open(mode="wt", encoding="utf-8") as fh:
|
with pl.Path("README.md").open(mode="wt", encoding="utf-8") as fh:
|
||||||
fh.write("""
|
fh.write(
|
||||||
|
"""
|
||||||
Hello World v201701.0002-alpha !
|
Hello World v201701.0002-alpha !
|
||||||
aka. 201701.2a0 !
|
aka. 201701.2a0 !
|
||||||
""")
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
if "setup.cfg" in files:
|
if "setup.cfg" in files:
|
||||||
with pl.Path("setup.cfg").open(mode="wt", encoding="utf-8") as fh:
|
with pl.Path("setup.cfg").open(mode="wt", encoding="utf-8") as fh:
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,7 @@ def test_iter_file_paths():
|
||||||
str(file_path) for file_path, patterns in rewrite._iter_file_paths(cfg.file_patterns)
|
str(file_path) for file_path, patterns in rewrite._iter_file_paths(cfg.file_patterns)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert file_paths == {
|
assert file_paths == {"pycalver.toml", "README.md"}
|
||||||
"pycalver.toml",
|
|
||||||
"README.md",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def test_iter_file_globs():
|
def test_iter_file_globs():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue