-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project setup + Use humanize from MC6809
- Loading branch information
Showing
18 changed files
with
428 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ | |
from dragonpy.vectrex.machine import run_Vectrex | ||
|
||
|
||
__version__ = '0.9.2' | ||
# See https://packaging.python.org/en/latest/specifications/version-specifiers/ | ||
__version__ = '0.9.3' | ||
__author__ = 'Jens Diemer <[email protected]>' | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import sys | ||
|
||
import rich_click as click | ||
from cli_base.cli_tools import git_history | ||
from cli_base.cli_tools.verbosity import OPTION_KWARGS_VERBOSE, setup_logging | ||
from rich import print # noqa | ||
|
||
from dragonpy.cli_app import cli | ||
|
||
|
||
@cli.command() | ||
@click.option('-v', '--verbosity', **OPTION_KWARGS_VERBOSE) | ||
def update_readme_history(verbosity: int): | ||
""" | ||
Update project history base on git commits/tags in README.md | ||
Will be exited with 1 if the README.md was updated otherwise with 0. | ||
Also, callable via e.g.: | ||
python -m cli_base update-readme-history -v | ||
""" | ||
setup_logging(verbosity=verbosity) | ||
updated = git_history.update_readme_history(verbosity=verbosity) | ||
exit_code = 1 if updated else 0 | ||
if verbosity: | ||
print(f'{exit_code=}') | ||
sys.exit(exit_code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
from unittest import TestCase | ||
|
||
from bx_py_utils.auto_doc import assert_readme_block | ||
from cli_base.cli_tools.git_history import get_git_history | ||
|
||
import dragonpy | ||
from dragonpy.cli_dev import PACKAGE_ROOT | ||
from cli_base.cli_tools import git_history | ||
|
||
|
||
class ReadmeHistoryTestCase(TestCase): | ||
def test_readme_history(self): | ||
git_history = get_git_history( | ||
current_version=dragonpy.__version__, | ||
add_author=False, | ||
) | ||
history = '\n'.join(git_history) | ||
assert_readme_block( | ||
readme_path=PACKAGE_ROOT / 'README.md', | ||
text_block=f'\n{history}\n', | ||
start_marker_line='[comment]: <> (✂✂✂ auto generated history start ✂✂✂)', | ||
end_marker_line='[comment]: <> (✂✂✂ auto generated history end ✂✂✂)', | ||
) | ||
updated = git_history.update_readme_history(verbosity=2) | ||
self.assertFalse(updated, 'README.md was not updated: Commit changes!') |
Oops, something went wrong.