Skip to content

Commit 96a3e22

Browse files
[UPDATE] Version bump for next release (PR #71)
* [UPDATE] Version bump for next release (- WIP #62 -) c633ddc * [REGRESSION] Fixups for quality related to Version bump for next release changes (- WIP #62 -) e88d128 * [STYLE] Removed useless else from if-else (- WIP PR #71 -) 322eac6 * [PATCH] Added changes suggested in code-review (- WIP PR #71 -) e88b987
1 parent 3fa44e5 commit 96a3e22

File tree

7 files changed

+460
-65
lines changed

7 files changed

+460
-65
lines changed

.stickler.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ addons:
99
# GitHub project metadata
1010
project:
1111
name: reactive-firewall/python-repo
12-
version: 1.1.0
12+
version: 1.1.5
1313
description: Python Repo Template
1414
# Commands to prepare for build_command
1515
# ** likely specific to your build **

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ This repo is basically my template for new repos/projects
33

44
# CI Template:
55

6-
By default this template will assume that the Travis CI Service and Circle-CI Service are used for CI/CD
6+
By default this template will assume that the GHA Service and Circle-CI Service are used for CI/CD
77

88
# Status
99

1010
### master:
11-
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=master)](https://travis-ci.org/reactive-firewall/python-repo)
11+
[![CI](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml/badge.svg?branch=master)](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml)
1212
[![CircleCI](https://circleci.com/gh/reactive-firewall/python-repo/tree/master.svg?style=svg)](https://circleci.com/gh/reactive-firewall/python-repo/tree/master)
13+
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=master)](https://travis-ci.org/reactive-firewall/python-repo)
1314
[![Appveyor](https://ci.appveyor.com/api/projects/status/6gggp1wpbnnjokm4/branch/master?svg=true)](https://ci.appveyor.com/project/reactive-firewall/python-repo/branch/master)
1415
[![Python 3](https://pyup.io/repos/github/reactive-firewall/python-repo/python-3-shield.svg)](https://pyup.io/repos/github/reactive-firewall/PiAP-python-tools/)
1516
[![Updates](https://pyup.io/repos/github/reactive-firewall/python-repo/shield.svg)](https://pyup.io/repos/github/reactive-firewall/python-repo/)
@@ -24,8 +25,9 @@ By default this template will assume that the Travis CI Service and Circle-CI Se
2425
![commits-since](https://img.shields.io/github/commits-since/reactive-firewall/python-repo/stable.svg?maxAge=9000)
2526

2627
### Stable:
27-
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=stable)](https://travis-ci.org/reactive-firewall/python-repo)
28+
[![CI](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml/badge.svg?branch=stable&event=pull_request)](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml)
2829
[![CircleCI](https://circleci.com/gh/reactive-firewall/python-repo/tree/stable.svg?style=svg)](https://circleci.com/gh/reactive-firewall/python-repo/tree/stable)
30+
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=stable)](https://travis-ci.org/reactive-firewall/python-repo)
2931
[![Appveyor](https://ci.appveyor.com/api/projects/status/6gggp1wpbnnjokm4/branch/stable?svg=true)](https://ci.appveyor.com/project/reactive-firewall/python-repo/branch/stable)
3032
[![code coverage](https://codecov.io/gh/reactive-firewall/python-repo/branch/stable/graph/badge.svg)](https://codecov.io/gh/reactive-firewall/python-repo/branch/stable/)
3133
[![code coverage](https://codecov.io/gh/reactive-firewall/python-repo/branch/stable/graph/badge.svg)](https://codecov.io/gh/reactive-firewall/python-repo/branch/stable/)
@@ -71,7 +73,7 @@ make clean ; # cleans up for next test
7173
# Next steps:
7274

7375
Like automation? Then integrate away, this template can take it!
74-
(hint: @travis-ci, @houndci-bot, @pyup-bot, @stickler-ci, @circleci, @codecov-io, @lemurheavy, @coverallsapp, @codeclimate)
76+
(hint: @coderabbitai, @travis-ci, @houndci-bot, @pyup-bot, @circleci, @codecov-io, @lemurheavy, @coverallsapp, @codeclimate)
7577

7678
Not in a rush? Then be sure to edit the badges in the README.
7779
(hint: `sed -e 's/python-repo/MY-NEW-REPO' ./README.md`)

pythonrepo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"""This is pythonrepo module Template."""
2424

2525

26-
__version__ = """1.1.4"""
27-
"""This is version 1.1.4 of pythonrepo Template"""
26+
__version__ = """1.1.5"""
27+
"""This is version 1.1.5 of pythonrepo Template"""
2828

2929

3030
try:

setup.cfg

Lines changed: 73 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
11
[metadata]
22
name = pythonrepo
3-
version = 1.1.4
3+
version = 1.1.5
44
author = Mr. Walls
5-
author-email = [email protected]
6-
summary = python-repo template
7-
description = file: README.md
8-
home-page = https://github.com/reactive-firewall/python-repo
9-
download-url = https://github.com/reactive-firewall/python-repo.git
10-
license = file: LICENSE.md
5+
author_email = [email protected]
6+
description = python-repo template
7+
long_description = file:README.md
8+
long_description_content_type = text/markdown
9+
url = https://github.com/reactive-firewall/python-repo
10+
download_url = https://github.com/reactive-firewall/python-repo.git
1111
classifiers =
12-
Development Status :: 4 - Beta
13-
Operating System :: POSIX :: Linux
14-
Programming Language :: Python
15-
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3.12
17-
Programming Language :: Python :: 3.11
18-
Programming Language :: Python :: 3.10
19-
Programming Language :: Python :: 3.9
20-
Programming Language :: Python :: 3.8
21-
Programming Language :: Python :: 3.7
22-
Programming Language :: Python :: 3.6
23-
Programming Language :: Python :: 3.5
24-
Programming Language :: Python :: 3.4
25-
Programming Language :: Python :: 3.3
26-
Programming Language :: Python :: 2.7
27-
Topic :: Security
12+
Development Status :: 4 - Beta
13+
Operating System :: MacOS :: MacOS X
14+
Operating System :: POSIX :: Linux
15+
Programming Language :: Python
16+
Programming Language :: Python :: 3
17+
Programming Language :: Python :: 3.14
18+
Programming Language :: Python :: 3.13
19+
Programming Language :: Python :: 3.12
20+
Programming Language :: Python :: 3.11
21+
Programming Language :: Python :: 3.10
22+
Programming Language :: Python :: 3.9
23+
Programming Language :: Python :: 3.8
24+
Programming Language :: Python :: 3.7
25+
Programming Language :: Python :: 3.6
26+
Programming Language :: Python :: 3.5
27+
Programming Language :: Python :: 3.4
28+
Programming Language :: Python :: 3.3
29+
Programming Language :: Python :: 2.7
30+
Topic :: Software Development :: Libraries :: Python Modules
31+
Topic :: Security
32+
license = MIT
33+
license_files =
34+
LICENSE[.md]*
35+
36+
platform = any
37+
project_urls =
38+
Bug Tracker = https://github.com/reactive-firewall/python-repo/issues
39+
License = https://github.com/reactive-firewall/python-repo/LICENSE.md
40+
41+
[bdist_rpm]
42+
url = https://github.com/reactive-firewall/python-repo.git
2843

2944
[bdist_wheel]
3045
universal=1
@@ -33,9 +48,42 @@ universal=1
3348
packages = pythonrepo
3449

3550
[options]
51+
zip_safe = true
52+
py_modules = pythonrepo
53+
test_suite = tests
54+
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.* !=3.15.*
55+
setup_requires =
56+
setuptools>=45.0.0
57+
wheel>=0.37.0
58+
build>=1.1.1
59+
3660
packages = find:
3761

62+
3863
[options.packages.find]
64+
where =
65+
pythonrepo/
66+
tests/
67+
*.py
68+
include =
69+
pythonrepo
3970
exclude =
40-
docs
41-
tests
71+
docs
72+
tests
73+
74+
[options.extras_require]
75+
testing =
76+
# upstream
77+
pytest >= 7
78+
pytest-checkdocs >= 2.4
79+
pytest-flake8
80+
coverage >= 6.3
81+
pytest-cov >= 4.0.0; \
82+
# coverage seems to make PyPy extremely slow
83+
python_implementation != "PyPy"
84+
pytest-enabler >= 1.0.1
85+
# local
86+
flake8 >= 5.0
87+
virtualenv >= 15.0.1
88+
wheel >= 0.37.0
89+
pip >= 21.0

setup.py

Lines changed: 107 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Python Repo Template
55
# ..................................
6-
# Copyright (c) 2017-2020, Kendrick Walls
6+
# Copyright (c) 2017-2024, Kendrick Walls
77
# ..................................
88
# Licensed under MIT (the "License");
99
# you may not use this file except in compliance with the License.
@@ -17,46 +17,133 @@
1717
# See the License for the specific language governing permissions and
1818
# limitations under the License.
1919

20+
"""Sets up the package.
21+
22+
Minimal Acceptance Testing:
23+
24+
Testcase 0: Just setup test fixtures by importing pythonrepo.
25+
26+
>>> import pythonrepo
27+
>>>
28+
>>> pythonrepo.__package__ is not None
29+
True
30+
>>>
31+
32+
"""
2033

2134
try:
35+
import os
36+
import warnings
37+
warnings.simplefilter("default") # Change the filter in this process
38+
os.environ["PYTHONWARNINGS"] = "default" # Also affect subprocesses
2239
from setuptools import setup
2340
from setuptools import find_packages
41+
with warnings.catch_warnings():
42+
warnings.simplefilter("ignore")
43+
try:
44+
from setuptools.config import read_configuration
45+
except Exception:
46+
from setuptools.config.setupcfg import read_configuration
2447
except Exception:
25-
raise ImportError("""Not Implemented.""")
48+
raise NotImplementedError("""[CWE-440] Not Implemented.""")
2649

2750

2851
def readFile(filename):
29-
"""Helper Function to read files"""
52+
"""Will attempt to read the file at with the given filename or path.
53+
54+
Used as a helper function to read files and return strings with the content.
55+
56+
Testing:
57+
58+
First setup test fixtures by importing pythonrepo.
59+
60+
>>> import pythonrepo
61+
>>>
62+
63+
Testcase 0: Should have Function readFile() WHEN loading setup.py.
64+
65+
>>> pythonrepo.readFile is not None
66+
True
67+
>>> type(pythonrepo.readFile) is type(1)
68+
False
69+
>>>
70+
71+
"""
3072
theResult = None
31-
if filename in ("""README.md""", """LICENSE.md"""):
32-
try:
33-
with open(str("""./{}""").format(str(filename))) as file:
34-
theResult = file.read()
35-
except Exception:
36-
theResult = str(
37-
"""See https://github.com/reactive-firewall/python-repo/{}"""
38-
).format(filename)
39-
return theResult
73+
try:
74+
if str("""E.md""") not in filename:
75+
raise NotImplementedError("""[CWE-440] Not Implemented.""")
76+
with open(str("""./{}""").format(str(filename))) as f:
77+
theResult = f.read()
78+
except Exception:
79+
theResult = str(
80+
"""See https://github.com/reactive-firewall/python-repo/{}"""
81+
).format(filename)
82+
return str(theResult)
4083

4184

4285
try:
43-
with open("""./requirements.txt""") as f:
44-
requirements = f.read().splitlines()
86+
with open("""./requirements.txt""") as rfile:
87+
requirements = rfile.read().splitlines()
4588
except Exception:
4689
requirements = None
4790

91+
92+
conf_dict = None
93+
94+
95+
with warnings.catch_warnings():
96+
warnings.simplefilter("ignore")
97+
conf_dict = read_configuration("""setup.cfg""", ignore_option_errors=True)
98+
99+
48100
readme = readFile("""README.md""")
101+
"""The multi-line description and/or summary of this program."""
102+
49103
SLA = readFile("""LICENSE.md""")
104+
"""The "Software License Agreement" of this program."""
105+
106+
try:
107+
class_tags = [
108+
str("""Development Status :: 4 - Beta"""),
109+
str("""Environment :: Console"""),
110+
str("""Intended Audience :: Developers"""),
111+
str("""Operating System :: MacOS :: MacOS X"""),
112+
str("""Operating System :: POSIX :: Linux"""),
113+
str("""License :: OSI Approved :: MIT License"""),
114+
str("""Programming Language :: Python :: 3"""),
115+
str("""Programming Language :: Python :: 3 :: Only"""),
116+
str("""Programming Language :: Python :: 3.14"""),
117+
str("""Programming Language :: Python :: 3.13"""),
118+
str("""Programming Language :: Python :: 3.12"""),
119+
str("""Programming Language :: Python :: 3.11"""),
120+
str("""Programming Language :: Python :: 3.10"""),
121+
str("""Programming Language :: Python :: 3.9"""),
122+
str("""Programming Language :: Python :: 3.8"""),
123+
str("""Programming Language :: Python :: 3.7"""),
124+
str("""Programming Language :: Python :: 3.6"""),
125+
str("""Programming Language :: Python :: 3.5"""),
126+
str("""Programming Language :: Python :: 3.4"""),
127+
str("""Programming Language :: Python :: 2.7"""),
128+
str("""Topic :: Software Development :: Libraries :: Python Modules""")
129+
]
130+
except Exception:
131+
class_tags = str("""Development Status :: 4 - Beta""")
50132

51133
setup(
52-
name="""pythonrepo""",
53-
version="""1.1.4""",
54-
description="""Python Repo""",
134+
name=conf_dict["""metadata"""]["""name"""],
135+
version=conf_dict["""metadata"""]["""version"""],
136+
description=conf_dict["""metadata"""]["""description"""],
55137
long_description=readme,
138+
long_description_content_type="""text/markdown""",
139+
zip_safe=True,
140+
include_package_data=True,
56141
install_requires=requirements,
57-
author="""reactive-firewall""",
58-
author_email="""[email protected]""",
59-
url="""https://github.com/reactive-firewall/python-repo.git""",
142+
author=conf_dict["""metadata"""]["""author"""],
143+
author_email=conf_dict["""metadata"""]["""author_email"""],
144+
classifiers=class_tags,
145+
url=conf_dict["""metadata"""]["""url"""],
146+
download_url=conf_dict["""metadata"""]["""download_url"""],
60147
license=SLA,
61148
packages=find_packages(exclude=("""tests""", """docs""")),
62149
)

0 commit comments

Comments
 (0)