-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ramonhagenaars/release/1.2.0
Release/1.2.0
- Loading branch information
Showing
11 changed files
with
178 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,9 @@ | |
[run] | ||
omit = | ||
setup.py | ||
SConstruct.py | ||
*/docs/* | ||
*/test_resources/* | ||
tests/* | ||
test_resources/* | ||
include = | ||
barentsz/* |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import subprocess | ||
|
||
_CHECK_ONLY = 'check' in COMMAND_LINE_TARGETS | ||
_CONTINUE = 'continue' in COMMAND_LINE_TARGETS | ||
_SUBJECT = 'barentsz' | ||
|
||
|
||
def _exec(cmd: str) -> None: | ||
print(f'>>> {cmd}') | ||
exit_code = subprocess.call(cmd, shell=True) | ||
if exit_code != 0 and not _CONTINUE: | ||
print(f'Exiting with {exit_code}') | ||
Exit(exit_code) | ||
|
||
|
||
# COMBINATIONS: | ||
|
||
if 'all' in COMMAND_LINE_TARGETS: | ||
COMMAND_LINE_TARGETS += ['format', 'quality'] | ||
|
||
if 'quality' in COMMAND_LINE_TARGETS: | ||
COMMAND_LINE_TARGETS += ['test', 'doctest', 'coverage', 'pycodestyle', 'pylint', 'mypy', 'complexity'] | ||
|
||
if 'format' in COMMAND_LINE_TARGETS: | ||
COMMAND_LINE_TARGETS += ['autoflake', 'isort'] | ||
|
||
|
||
# QUALITY: | ||
|
||
if 'test' in COMMAND_LINE_TARGETS: | ||
_exec('python -m unittest discover tests') | ||
|
||
if 'doctest' in COMMAND_LINE_TARGETS: | ||
_exec('python -m doctest README.md') | ||
|
||
if 'coverage' in COMMAND_LINE_TARGETS: | ||
_exec('coverage run -m unittest discover tests') | ||
_exec('coverage report -m --fail-under=100') | ||
|
||
if 'pycodestyle' in COMMAND_LINE_TARGETS: | ||
_exec(f'pycodestyle {_SUBJECT} -v --config=setup.cfg') | ||
|
||
if 'pylint' in COMMAND_LINE_TARGETS: | ||
_exec(f'pylint --rcfile=setup.cfg {_SUBJECT}') | ||
|
||
if 'mypy' in COMMAND_LINE_TARGETS: | ||
_exec(f'mypy {_SUBJECT} --show-error-codes --disallow-untyped-defs') | ||
|
||
if 'complexity' in COMMAND_LINE_TARGETS: | ||
_exec(f'radon cc {_SUBJECT}') | ||
_exec(f'radon cc {_SUBJECT} -nc --total-average') | ||
_exec(f'xenon {_SUBJECT} --max-absolute B --max-modules A --max-average A') | ||
|
||
|
||
# FORMAT: | ||
|
||
if 'autoflake' in COMMAND_LINE_TARGETS: | ||
cmd = f'autoflake {_SUBJECT}/_here.py --recursive --in-place --remove-unused-variables --expand-star-imports' | ||
if _CHECK_ONLY: | ||
cmd += ' --check' | ||
_exec(cmd) | ||
|
||
if 'isort' in COMMAND_LINE_TARGETS: | ||
cmd = f'isort {_SUBJECT} --recursive --quiet' | ||
if _CHECK_ONLY: | ||
cmd += ' --check' | ||
_exec(cmd) | ||
|
||
Exit(0) |
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,16 +1,12 @@ | ||
from barentsz._discover import ( | ||
discover, | ||
discover_paths, | ||
discover_packages, | ||
discover_module_names, | ||
discover_modules, | ||
discover_attributes, | ||
discover_classes, | ||
discover_functions, | ||
discover_attributes, | ||
) | ||
from barentsz._here import ( | ||
here, | ||
) | ||
from barentsz._meta import ( | ||
__version__, | ||
discover_module_names, | ||
discover_modules, | ||
discover_packages, | ||
discover_paths, | ||
) | ||
from barentsz._here import here | ||
from barentsz._meta import __version__ |
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,5 +1,5 @@ | ||
__title__ = 'barentsz' | ||
__version__ = '1.1.0' | ||
__version__ = '1.2.0' | ||
__author__ = 'Ramon Hagenaars' | ||
__author_email__ = '[email protected]' | ||
__description__ = 'For discovering modules, classes, functions and attributes.' | ||
|
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,3 @@ | ||
from typing import Callable | ||
|
||
ClsPredicate = Callable[[type], bool] |
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
Oops, something went wrong.