Skip to content

Commit

Permalink
Rename old references to make cli pass (#5)
Browse files Browse the repository at this point in the history
* rename

* update invoke

* rebuild lock

* fix: remove condition for older python versions

* fix: rename old references

* fix: rename old references

* fix: typo
  • Loading branch information
Pierlou authored Nov 14, 2024
1 parent 01d6feb commit ea31b55
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 56 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code of Conduct - bumpr
# Code of Conduct - bumpx

## Our Pledge

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to bumpr
# Contributing to bumpx

First off, thanks for taking the time to contribute! ❤️

Expand Down Expand Up @@ -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 <>.

Expand Down Expand Up @@ -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

Expand All @@ -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. <!-- this should only be included if the project has a GUI -->
- **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.

<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->

Expand All @@ -140,7 +140,7 @@ Both tools are required and should be installed on your system.

#### Setting up your environment

- Clone the project: `git clone [email protected]:noirbizarre/bumpr.git`
- Clone the project: `git clone [email protected]:datagouv/bumpx.git`
- Install pre-commit hooks: `pre-commit install`
- Install dependencies: `poetry install`
- List available tasks: `pre-commit run inv -l`
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Bump'X requires Python `>=3.9` (and `<4.0`)
You can install Bump'X with pip:

```bash
pip install bumpr
pip install bumpx
```

## Usage

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).
Expand All @@ -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
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions bumpr.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[bumpr]
[bumpx]
file = pyproject.toml
regex = version\s*=\s*"(?P<version>.+?)"
vcs = git
Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions bumpx/hooks.py
Original file line number Diff line number Diff line change
@@ -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_ = (
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]
Expand All @@ -73,7 +73,7 @@ python_version = "3.11"
exclude = "doc/*.py"

[tool.coverage.run]
source = ["bumpr"]
source = ["bumpx"]
branch = true
omit = [
"tests/*",
Expand Down
4 changes: 2 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,29 @@ 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(
"bump command", replacements=mocker.ANY, verbose=mocker.ANY, dryrun=True
)

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(
Expand Down
14 changes: 7 additions & 7 deletions tests/test_releaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()

Expand All @@ -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()

Expand All @@ -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()

Expand All @@ -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()

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit ea31b55

Please sign in to comment.