Skip to content

Commit

Permalink
Merge pull request #25 from tylercb/add_version
Browse files Browse the repository at this point in the history
Add version
Bump version: 1.4.0 → 1.5.0
  • Loading branch information
tylercb authored Feb 6, 2024
2 parents dd564a9 + 1db0b31 commit 790f8e8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[bumpversion]
current_version = 1.4.0
current_version = 1.5.0
commit = True
tag = True

[bumpversion:file:setup.py]

[bumpversion:file:starred_repo_finder/__version__.py]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ $ starred_repo_finder --limit=50 --format=markdown Ionaru/easy-markdown-editor >

See [examples/ionaru-easy-markdown-editor.md](https://github.com/tylercb/starred_repo_finder/blob/main/examples/ionaru-easy-markdown-editor.md) for the output.

## Tools

Bump the version:

```bash
bumpversion minor
```

## Acknowledgements

This would not be possible without the following:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="starred_repo_finder",
version="1.4.0",
version="1.5.0",
description="A simple command line tool to find and explore GitHub repositories through stargazers for a given repository.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down
1 change: 1 addition & 0 deletions starred_repo_finder/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.5.0"
2 changes: 2 additions & 0 deletions starred_repo_finder/cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import click
from .starred_repo_finder import get_repos_starred_by_same_users, print_results
from .__version__ import __version__


@click.command()
@click.version_option(version=__version__, prog_name="starred_repo_finder")
@click.argument("repo_name")
@click.option(
"--limit",
Expand Down
19 changes: 19 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
from click.testing import CliRunner
from starred_repo_finder.cli import cli
from starred_repo_finder.__version__ import __version__


class TestCLIVersion(unittest.TestCase):
def test_version_output(self):
"""Test if `--version` option returns the current version."""
runner = CliRunner()
result = runner.invoke(cli, ["--version"])
expected_output = f"starred_repo_finder, version {__version__}\n"

self.assertEqual(result.exit_code, 0)
self.assertIn(expected_output, result.output)


if __name__ == "__main__":
unittest.main()

0 comments on commit 790f8e8

Please sign in to comment.