Skip to content

Commit ff308fc

Browse files
Version 1.1.4 supplemental update
1 parent 83cfc31 commit ff308fc

File tree

11 files changed

+61
-49
lines changed

11 files changed

+61
-49
lines changed

.appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
version: 1.0.{build}
1+
version: 1.1.{build}
22
branches:
33
only:
44
- master
55
- stable
66
skip_tags: true
77
max_jobs: 1
88
image:
9-
- Visual Studio 2017
10-
- Visual Studio 2015
9+
- Visual Studio 2022
10+
- Visual Studio 2019
1111
clone_depth: 50
1212
init:
1313
- cmd: >-

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/python:3.6.1
65
- image: circleci/python:3.7
76
- image: circleci/python:3.8
7+
- image: circleci/python:3.9
88
environment:
99
CI: cicleci
1010
DEBIAN_FRONTEND: noninteractive
@@ -41,9 +41,9 @@ jobs:
4141

4242
test:
4343
docker:
44-
- image: circleci/python:3.6.1
4544
- image: circleci/python:3.7
4645
- image: circleci/python:3.8
46+
- image: circleci/python:3.9
4747
parallelism: 2
4848
environment:
4949
CI: cicleci
@@ -88,9 +88,9 @@ jobs:
8888

8989
pytest:
9090
docker:
91-
- image: circleci/python:3.6.1
9291
- image: circleci/python:3.7
9392
- image: circleci/python:3.8
93+
- image: circleci/python:3.9
9494
parallelism: 2
9595
environment:
9696
CI: cicleci
@@ -147,7 +147,7 @@ jobs:
147147

148148
lint:
149149
docker:
150-
- image: circleci/python:3.6.1
150+
- image: circleci/python:3.8
151151
environment:
152152
CI: cicleci
153153
DEBIAN_FRONTEND: noninteractive

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ coverage.xml
4747
codecov_env
4848
*,cover
4949
.hypothesis/
50+
test-reports/*
5051

5152
# Translations
5253
*.mo

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
License - MIT
22

3-
Copyright (c) 2017-2020 Mr. Walls
3+
Copyright (c) 2017-2022 Mr. Walls
44

55
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ PHONY: must_be_root cleanup
5959

6060
build:
6161
$(QUIET)$(ECHO) "No need to build. Try make -f Makefile install"
62+
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile text 2>/dev/null || true
6263

6364
init:
6465
$(QUIET)$(ECHO) "$@: Done."
@@ -84,7 +85,7 @@ purge: clean uninstall
8485
test: cleanup
8586
$(QUIET)coverage run -p --source=pythonrepo -m unittest discover --verbose -s ./tests -t ./ || python3 -m unittest discover --verbose -s ./tests -t ./ || python -m unittest discover --verbose -s ./tests -t ./ || DO_FAIL=exit 2 ;
8687
$(QUIET)coverage combine 2>/dev/null || true
87-
$(QUIET)coverage report --include=pythonrepo* 2>/dev/null || true
88+
$(QUIET)coverage report -m --include=pythonrepo* 2>/dev/null || true
8889
$(QUIET)$(DO_FAIL);
8990
$(QUIET)$(ECHO) "$@: Done."
9091

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
templates_path = ['_templates']
3333

3434
# The suffix of source filenames.
35-
source_suffix = '.rst'
35+
source_suffix = '.md'
3636

3737
# The encoding of source files.
3838
# source_encoding = 'utf-8-sig'
@@ -51,7 +51,7 @@
5151
# The short X.Y version.
5252
version = 'v1.1'
5353
# The full version, including alpha/beta/rc tags.
54-
release = 'v1.1.1'
54+
release = 'v1.1.4'
5555

5656
# The language for content autogenerated by Sphinx. Refer to documentation
5757
# for a list of supported languages.
File renamed without changes.

pythonrepo/__init__.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Python Repo Template
44
# ..................................
5-
# Copyright (c) 2017-2019, Kendrick Walls
5+
# Copyright (c) 2017-2022, Kendrick Walls
66
# ..................................
77
# Licensed under MIT (the "License");
88
# you may not use this file except in compliance with the License.
@@ -17,25 +17,33 @@
1717
# limitations under the License.
1818

1919

20-
__version__ = """1.1.1"""
21-
"""This is version 1.1.1 of pythonrepo Template"""
20+
__package__ = """pythonrepo"""
21+
22+
23+
__module__ = """pythonrepo"""
24+
25+
26+
__name__ = """pythonrepo"""
27+
28+
29+
__version__ = """1.1.4"""
30+
"""This is version 1.1.4 of pythonrepo Template"""
2231

2332

2433
try:
2534
import sys
2635
import os
27-
if 'pythonrepo' in __file__:
36+
if str(__module__) in __file__:
2837
__parentPath = os.path.join(
2938
os.path.dirname(__file__), '..'
3039
)
3140
sys.path.insert(0, os.path.abspath(__parentPath))
32-
except Exception as ImportErr:
33-
print(str(type(ImportErr)))
34-
print(str(ImportErr))
35-
print(str((ImportErr.args)))
36-
ImportErr = None
37-
del ImportErr
38-
raise ImportError(str("pythonrepo Failed to Import"))
41+
except Exception as err:
42+
baton = ImportError(err, str("[CWE-758] Module failed completely."))
43+
baton.module = __module__
44+
baton.path = __file__
45+
baton.__cause__ = err
46+
raise baton
3947

4048

4149
try:

pythonrepo/pythonrepo.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,26 @@
1818
# limitations under the License.
1919

2020

21+
__module__ = """pythonrepo"""
22+
23+
24+
# __name__ = """pythonrepo"""
25+
26+
2127
try:
2228
import sys
2329
import argparse
2430
except Exception as err:
25-
# Show Error Info
26-
print(str(type(err)))
27-
print(str(err))
28-
print(str(err.args))
29-
print(str(""))
30-
# Clean up Error
31-
err = None
31+
# Collect Error Info
32+
baton = ImportError(err, str("[CWE-758] Module failed completely."))
33+
baton.module = __module__
34+
baton.path = __file__
35+
baton.__cause__ = err
3236
# Throw more relevant Error
33-
raise ImportError(str("Error Importing Python"))
37+
raise baton
3438

3539

36-
__prog__ = str("""pythonrepo""")
40+
__prog__ = str(__module__)
3741
"""The name of this program is PythonRepo"""
3842

3943

@@ -49,7 +53,7 @@
4953
"""Contains the short epilog of the program CLI help text."""
5054

5155

52-
__version__ = """1.1.1"""
56+
__version__ = """1.1.4"""
5357
"""The version of this program."""
5458

5559

@@ -95,16 +99,9 @@ def parseArgs(arguments=None):
9599
return parser.parse_known_args(arguments)
96100

97101

98-
def __checkToolArgs(args=None):
99-
"""Handles None case for arguments as a helper function."""
100-
if args is None:
101-
args = [None]
102-
return args
103-
104-
105-
def useTool(tool, arguments=None):
102+
def useTool(tool, *arguments):
106103
"""Handler for launching the functions."""
107-
arguments = __checkToolArgs(arguments)
104+
# arguments = __checkToolArgs(arguments)
108105
if (tool is not None) and (tool in TASK_OPTIONS.keys()):
109106
try:
110107
# print(str("launching: " + tool))
@@ -117,11 +114,11 @@ def useTool(tool, arguments=None):
117114
return None
118115

119116

120-
def main(argv=None):
117+
def main(*argv):
121118
"""The Main Event."""
122119
try:
123120
try:
124-
args, extra = parseArgs(argv)
121+
args, extra = parseArgs(*argv)
125122
service_cmd = args.some_task
126123
useTool(service_cmd, extra)
127124
except Exception:

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pythonrepo
3-
version = 1.1.3
3+
version = 1.1.4
44
author = Mr. Walls
55
author-email = [email protected]
66
summary = python-repo template
@@ -13,6 +13,8 @@ classifiers =
1313
Operating System :: POSIX :: Linux
1414
Programming Language :: Python
1515
Programming Language :: Python :: 3
16+
Programming Language :: Python :: 3.9
17+
Programming Language :: Python :: 3.8
1618
Programming Language :: Python :: 3.7
1719
Programming Language :: Python :: 3.6
1820
Programming Language :: Python :: 3.5

tests/test_basic.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,19 @@ def test_the_help_command(self):
6868

6969
def test_corner_case_example(self):
7070
"""Example Test case for bad input directly into function."""
71-
theResult = False
71+
theResult = True
7272
try:
7373
from .context import pythonrepo
7474
if pythonrepo.__name__ is None:
7575
theResult = False
76-
from pythonrepo import pythonrepo as pythonrepo
77-
self.assertIsNone(pythonrepo.useTool(None))
78-
self.assertIsNone(pythonrepo.useTool("JunkInput"))
79-
theResult = True
76+
from pythonrepo import pythonrepo as _pythonrepo
77+
self.assertIsNone(_pythonrepo.useTool(None, None), """None, None Failed""")
78+
self.assertIsNone(_pythonrepo.useTool(None, []), """None, [] Failed""")
79+
self.assertIsNone(_pythonrepo.useTool(tool=None), """None Failed""")
80+
self.assertIsNone(_pythonrepo.useTool("JunkInput"), """junk Failed""")
81+
self.assertTrue(theResult)
8082
except Exception:
83+
self.fail("""Test Failed""")
8184
theResult = False
8285
assert theResult
8386

0 commit comments

Comments
 (0)