diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index e93f7d9..8a37e59 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,4 @@ -# Code of Conduct - bumpr +# Code of Conduct - bumpx ## Our Pledge diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d26b6a..8193ac9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to bumpr +# Contributing to bumpx First off, thanks for taking the time to contribute! ❤️ @@ -31,7 +31,7 @@ The community looks forward to your contributions. 🎉 ## Code of Conduct This project and everyone participating in it is governed by the -[bumpr Code of Conduct](https://github.com/datagouv/bumpx/blob/main/CODE_OF_CONDUCT.md). +[bumpx Code of Conduct](https://github.com/datagouv/bumpx/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to <>. @@ -109,7 +109,7 @@ Once it's filed: ### Suggesting Enhancements -This section guides you through submitting an enhancement suggestion for bumpr, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. +This section guides you through submitting an enhancement suggestion for bumpx, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. #### Before Submitting an Enhancement @@ -126,7 +126,7 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/datago - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. -- **Explain why this enhancement would be useful** to most bumpr users. You may also want to point out the other projects that solved it better and which could serve as inspiration. +- **Explain why this enhancement would be useful** to most bumpx users. You may also want to point out the other projects that solved it better and which could serve as inspiration. @@ -140,7 +140,7 @@ Both tools are required and should be installed on your system. #### Setting up your environment -- Clone the project: `git clone git@github.com:noirbizarre/bumpr.git` +- Clone the project: `git clone git@github.com:datagouv/bumpx.git` - Install pre-commit hooks: `pre-commit install` - Install dependencies: `poetry install` - List available tasks: `pre-commit run inv -l` diff --git a/README.md b/README.md index abcdb89..4e74791 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Bump'X requires Python `>=3.9` (and `<4.0`) You can install Bump'X with pip: ```bash -pip install bumpr +pip install bumpx ``` ## Usage @@ -37,7 +37,7 @@ pip install bumpr You can use directly the command line to setup every parameter: ```bash -bumpr fake/__init__.py README.rst -M -ps dev +bumpx fake/__init__.py README.rst -M -ps dev ``` But Bump'X is designed to work with a configuration file (`bumpr.rc` by defaults). @@ -50,7 +50,7 @@ Some features are only availables with the configuration file like: Here's an exemple: ```ini -[bumpr] +[bumpx] file = fake/__init__.py vcs = git tests = tox @@ -81,13 +81,13 @@ This way you only have to specify which part you want to bump on the command line: ```bash -bumpr -M # Bump the major -bumpr # Bump the default part aka. patch +bumpx -M # Bump the major +bumpx # Bump the default part aka. patch ``` ## Documentation -The documentation for the upstream project [Bump'R](https://github.com/noirbizarre/bumpr) is hosted on Read the Docs: +The documentation for the upstream project [Bump'X](https://github.com/datagouv/bumpx) is hosted on Read the Docs: - [Stable](https://bumpr.readthedocs.io/en/stable/) [![Stable documentation status](https://readthedocs.org/projects/bumpr/badge/?version=stable)](https://bumpr.readthedocs.io/en/stable/?badge=stable) - [Development](https://bumpr.readthedocs.io/en/latest/) [![Latest documentation Status](https://readthedocs.org/projects/bumpr/badge/?version=latest)](https://bumpr.readthedocs.io/en/latest/?badge=latest) diff --git a/bumpr.rc b/bumpr.rc index 48bed12..388d42c 100644 --- a/bumpr.rc +++ b/bumpr.rc @@ -1,4 +1,4 @@ -[bumpr] +[bumpx] file = pyproject.toml regex = version\s*=\s*"(?P.+?)" vcs = git @@ -12,7 +12,7 @@ publish = poetry publish --build -vv -n clean = poetry run inv clean files = README.md - bumpr/__about__.py + bumpx/__about__.py [bump] unsuffix = true diff --git a/bumpx/hooks.py b/bumpx/hooks.py index aeb7df3..81faf30 100644 --- a/bumpx/hooks.py +++ b/bumpx/hooks.py @@ -1,12 +1,9 @@ import logging from os.path import exists -from typing import TYPE_CHECKING +from typing import Optional from .helpers import BumprError, execute -if TYPE_CHECKING: - from typing import Optional - logger = logging.getLogger(__name__) __all_ = ( diff --git a/poetry.lock b/poetry.lock index e8b206d..e0cf0de 100644 --- a/poetry.lock +++ b/poetry.lock @@ -308,13 +308,13 @@ files = [ [[package]] name = "invoke" -version = "1.7.3" +version = "2.2.0" description = "Pythonic task execution" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "invoke-1.7.3-py3-none-any.whl", hash = "sha256:d9694a865764dd3fd91f25f7e9a97fb41666e822bbb00e670091e3f43933574d"}, - {file = "invoke-1.7.3.tar.gz", hash = "sha256:41b428342d466a82135d5ab37119685a989713742be46e42a3a399d685579314"}, + {file = "invoke-2.2.0-py3-none-any.whl", hash = "sha256:6ea924cc53d4f78e3d98bc436b08069a03077e6f85ad1ddaa8a116d7dad15820"}, + {file = "invoke-2.2.0.tar.gz", hash = "sha256:ee6cbb101af1a859c7fe84f2a264c059020b0cb7fe3535f9424300ab568f6bd5"}, ] [[package]] @@ -1059,4 +1059,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "a5f89299409c528b65641641de103c61f00b5f97a4a07aed902cde8881f5fae8" +content-hash = "e62d7b808b68106e84978171eccd23120d56eac8822c4ab67a992cb46d05386c" diff --git a/pyproject.toml b/pyproject.toml index 4254470..8657ec8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ mkdocs-include-markdown-plugin = {version = "^3.2.3", optional = true} [tool.poetry.group.dev.dependencies] coverage = "^7.2.1" -invoke = "^1.6.0" +invoke = "^2.2.0" mock = "^4.0.3" mypy = "^0.931" pytest = "^7.2.2" @@ -52,7 +52,7 @@ pytest-sugar = "^0.9.4" ruff = "^0.7.3" [tool.poetry.scripts] -bumpr = 'bumpr.__main__:main' +bumpx = 'bumpx.__main__:main' [build-system] requires = ["poetry-core>=1.0.0"] @@ -73,7 +73,7 @@ python_version = "3.11" exclude = "doc/*.py" [tool.coverage.run] -source = ["bumpr"] +source = ["bumpx"] branch = true omit = [ "tests/*", diff --git a/tasks.py b/tasks.py index 6aee0d2..d5ceb12 100644 --- a/tasks.py +++ b/tasks.py @@ -25,8 +25,8 @@ LINTERS = ( ("pyproject.toml validation", "poetry check"), - ("Static Analysis", "ruff bumpr"), - ("Type checking", "mypy bumpr"), + ("Static Analysis", "ruff bumpx"), + ("Type checking", "mypy bumpx"), ) FORMATTERS = ( ("Sort imports using isort", "isort"), diff --git a/tests/test_config.py b/tests/test_config.py index cba661d..033b034 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -24,7 +24,7 @@ def bumprc(request, mocker, mock_ini): marker = request.node.get_closest_marker("bumprc") if marker: data = marker.args[0] - mocker.patch("bumpr.config.exists", return_value=True) + mocker.patch("bumpx.config.exists", return_value=True) yield mock_ini(data) else: yield diff --git a/tests/test_helpers.py b/tests/test_helpers.py index acbd331..ff828d2 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -12,7 +12,7 @@ def check_call(mocker): @pytest.fixture(name="check_output") def check_output_mock(mocker): - yield mocker.patch("bumpr.helpers.check_output") + yield mocker.patch("bumpx.helpers.check_output") class ExecuteTest: diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 2b95140..f84286b 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -141,21 +141,21 @@ def setUp(self, mocker): self.hook = CommandsHook(self.releaser) def test_bump(self, mocker): - execute = mocker.patch("bumpr.hooks.execute") + execute = mocker.patch("bumpx.hooks.execute") self.hook.bump([]) execute.assert_called_once_with( "bump command", replacements=mocker.ANY, verbose=mocker.ANY, dryrun=False ) def test_prepare(self, mocker): - execute = mocker.patch("bumpr.hooks.execute") + execute = mocker.patch("bumpx.hooks.execute") self.hook.prepare([]) execute.assert_called_once_with( "prepare command", replacements=mocker.ANY, verbose=mocker.ANY, dryrun=False ) def test_bump_dryrun(self, mocker): - execute = mocker.patch("bumpr.hooks.execute") + execute = mocker.patch("bumpx.hooks.execute") self.hook.dryrun = True self.hook.bump([]) execute.assert_called_once_with( @@ -163,7 +163,7 @@ def test_bump_dryrun(self, mocker): ) def test_prepare_dryrun(self, mocker): - execute = mocker.patch("bumpr.hooks.execute") + execute = mocker.patch("bumpx.hooks.execute") self.hook.dryrun = True self.hook.prepare([]) execute.assert_called_once_with( diff --git a/tests/test_releaser.py b/tests/test_releaser.py index 397bba8..c5401e4 100644 --- a/tests/test_releaser.py +++ b/tests/test_releaser.py @@ -59,7 +59,7 @@ def test_constructor_with_hooks(workspace, mocker): mock = mocker.MagicMock() mock.key = key hooks.append(mock) - mocker.patch("bumpr.releaser.HOOKS", hooks) + mocker.patch("bumpx.releaser.HOOKS", hooks) releaser = Releaser(config) @@ -75,7 +75,7 @@ def test_test(workspace, mocker): } ) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") releaser.test() @@ -93,7 +93,7 @@ def test_skip_test(workspace, mocker): } ) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") releaser.test() @@ -109,7 +109,7 @@ def test_publish(workspace, mocker): ) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") releaser.publish() @@ -129,7 +129,7 @@ def test_clean(workspace, mocker): } ) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") releaser.clean() @@ -231,7 +231,7 @@ def test_push_no_commit(workspace, mocker): def test_release_wihtout_vcs_or_commands(workspace, mocker): config = Config({"file": "fake.py", "files": [str(workspace.readme)]}) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") commit = mocker.patch.object(releaser, "commit") releaser.release() @@ -416,7 +416,7 @@ def test_release_dryrun(workspace, mocker): } ) releaser = Releaser(config) - execute = mocker.patch("bumpr.releaser.execute") + execute = mocker.patch("bumpx.releaser.execute") vcs = mocker.patch.object(releaser, "vcs") releaser.release() assert not execute.called diff --git a/tests/test_vcs.py b/tests/test_vcs.py index 0378081..6f36955 100644 --- a/tests/test_vcs.py +++ b/tests/test_vcs.py @@ -9,13 +9,13 @@ class BaseVCSTest: def test_execute_verbose(self, mocker): vcs = BaseVCS(verbose=True) - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") vcs.execute("cmd arg") execute.assert_called_with("cmd arg", verbose=True) def test_execute_quiet(self, mocker): vcs = BaseVCS(verbose=False) - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") vcs.execute("cmd arg") execute.assert_called_with("cmd arg", verbose=False) @@ -25,7 +25,7 @@ def test_validate_ok(self, workspace, mocker): workspace.mkdir(".git") git = Git() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "?? new.py" git.validate() execute.assert_called_with("git status --porcelain", verbose=False) @@ -33,7 +33,7 @@ def test_validate_ok(self, workspace, mocker): def test_validate_ko_not_git(self, workspace, mocker): git = Git() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") with pytest.raises(BumprError): git.validate() assert execute.called is False @@ -42,7 +42,7 @@ def test_validate_ko_not_clean(self, workspace, mocker): workspace.mkdir(".git") git = Git() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "?? new.py")) with pytest.raises(BumprError): git.validate() @@ -51,7 +51,7 @@ def test_validate_ko_not_clean(self, workspace, mocker): def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir(".git") git = Git() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "?? new.py")) git.validate(dryrun=True) @@ -93,7 +93,7 @@ def test_validate_ok(self, workspace, mocker): workspace.mkdir(".hg") mercurial = Mercurial() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "?? new.py" mercurial.validate() execute.assert_called_with("hg status -mard", verbose=False) @@ -101,7 +101,7 @@ def test_validate_ok(self, workspace, mocker): def test_validate_ko_not_mercurial(self, workspace, mocker): mercurial = Mercurial() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") with pytest.raises(BumprError): mercurial.validate() assert execute.called is False @@ -110,7 +110,7 @@ def test_validate_ko_not_clean(self, workspace, mocker): workspace.mkdir(".hg") mercurial = Mercurial() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "?? new.py")) with pytest.raises(BumprError): mercurial.validate() @@ -120,7 +120,7 @@ def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir(".hg") mercurial = Mercurial() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "?? new.py")) mercurial.validate(dryrun=True) execute.assert_called_with("hg status -mard", verbose=False) @@ -159,7 +159,7 @@ def test_validate_ok(self, workspace, mocker): workspace.mkdir(".bzr") bazaar = Bazaar() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "? new.py" bazaar.validate() execute.assert_called_with("bzr status --short", verbose=False) @@ -167,7 +167,7 @@ def test_validate_ok(self, workspace, mocker): def test_validate_ko_not_bazaar(self, workspace, mocker): bazaar = Bazaar() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") with pytest.raises(BumprError): bazaar.validate() assert execute.called is False @@ -176,7 +176,7 @@ def test_validate_ko_not_clean(self, workspace, mocker): workspace.mkdir(".bzr") bazaar = Bazaar() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "? new.py")) with pytest.raises(BumprError): bazaar.validate() @@ -186,7 +186,7 @@ def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir(".bzr") bazaar = Bazaar() - execute = mocker.patch("bumpr.vcs.execute") + execute = mocker.patch("bumpx.vcs.execute") execute.return_value = "\n".join((" M modified.py", "? new.py")) bazaar.validate(dryrun=True) @@ -209,7 +209,7 @@ def test_tag_annotate(self, mocker, caplog): record = caplog.record_tuples[0] - assert record[0] == "bumpr.vcs" + assert record[0] == "bumpx.vcs" assert record[1] == logging.WARNING def test_commit(self, mocker):