Skip to content

Commit 16ba919

Browse files
[PATCH] fixup for PR #89 regressions and linting
1 parent bfcf1bf commit 16ba919

File tree

8 files changed

+533
-142
lines changed

8 files changed

+533
-142
lines changed

docs/conf.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
Example:
3030
>>> import conf
3131
>>> conf.project
32-
'python-repo'
32+
'pythonrepo'
3333
>>> conf.version
34-
'1.1'
34+
'2.0'
3535
"""
3636

3737
import sys
@@ -41,7 +41,7 @@
4141
from urllib.parse import quote
4242

4343
# If you have custom documentation extensions, add them here
44-
sys.path.insert(0, os.path.abspath(".."))
44+
import docs.utils
4545
from docs.utils import (
4646
_validate_git_ref, # noqa
4747
slugify_header, # noqa
@@ -64,6 +64,7 @@
6464
# add these directories to sys.path here. If the directory is relative to the
6565
# documentation root, use os.path.abspath to make it absolute, like shown here.
6666

67+
sys.path.insert(0, os.path.abspath(".."))
6768
# sys.path.insert(1, os.path.abspath("tests")) # uncomment to add tests docs
6869
sys.path.insert(1, os.path.abspath("pythonrepo"))
6970

@@ -151,9 +152,9 @@
151152
# built documents.
152153
#
153154
# The short X.Y version.
154-
version = "v2.0"
155+
version = "2.0"
155156
# The full version, including alpha/beta/rc tags.
156-
release = "v2.0.0b0"
157+
release = f"v${version}.0b0"
157158

158159
# The language for content autogenerated by Sphinx. Refer to documentation
159160
# for a list of supported languages.
@@ -258,7 +259,7 @@
258259
# html_title = None
259260

260261
# A shorter title for the navigation bar. Default is the same as html_title.
261-
html_short_title = "Project Docs"
262+
html_short_title = "Project Docs"
262263

263264
# The name of an image file (relative to this directory) to place at the top
264265
# of the sidebar.
@@ -472,7 +473,7 @@
472473

473474
suffix: str = "/issues/%s"
474475

475-
extlinks: dict[str,tuple] = {
476+
extlinks: dict[str, tuple] = {
476477
"issue": (
477478
f"{linkcode_url_prefix}/{suffix}",
478479
"issue #%s"
@@ -481,17 +482,17 @@
481482

482483
# try to link with official python3 documentation.
483484
# see https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html for more
484-
intersphinx_mapping = sanitize_intersphinx_mapping(
485+
intersphinx_mapping: dict[str, tuple] = sanitize_intersphinx_mapping(
485486
{
486487
"python": ("https://docs.python.org/3", (None, "python-inv.txt")),
487488
"PEP": ("https://peps.python.org", (None, "pep-inv.txt")),
488489
},
489490
)
490491

491492

492-
def linkcode_resolve(domain: Any, info: Any) -> str:
493+
def linkcode_resolve(domain: any, info: any) -> str:
493494
"""
494-
Resolves selectively linking to GitHub source-code for the multicast module.
495+
Resolves selectively linking to GitHub source-code for the project module.
495496
496497
See https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html for more details.
497498
@@ -506,7 +507,7 @@ def linkcode_resolve(domain: Any, info: Any) -> str:
506507
507508
>>> _conf.linkcode_resolve is not None
508509
True
509-
>>> test_text = "multicast.env" # this is resolved
510+
>>> test_text = "pythonrepo.env" # this is resolved
510511
>>> bad_input = False # this is invalid
511512
>>> res_text = _conf.linkcode_resolve("py", info={"module": test_text})
512513
>>> res_text is not None

pythonrepo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
os.path.dirname(__file__), "..",
3636
)
3737
if str(os.path.abspath(__parentPath)) not in sys.path: # pragma: no branch
38-
sys.path.insert(0, os.path.abspath(__parentPath))
38+
sys.path.insert(0, os.path.abspath(__parentPath)) # pragma: no cover
3939
except ImportError as err:
4040
baton = ImportError(err, str("[CWE-758] Module failed completely."))
4141
baton.module = __module__

pythonrepo/pythonrepo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def parseArgs(arguments=None) -> argparse.Namespace:
100100
return parser.parse_known_args(arguments)
101101

102102

103-
def useTool(tool, *arguments) -> Any:
103+
def useTool(tool, *arguments) -> any:
104104
"""Handler for launching the functions."""
105105
if (tool is not None) and (tool in TASK_OPTIONS):
106106
try:
@@ -128,7 +128,7 @@ def main(*argv) -> None:
128128
raise SystemExit(2) from _cause
129129
except BaseException as _panic: # nocq
130130
e = str("CRITICAL - An error occurred while handling")
131-
e += str("the cascading failure.")
131+
e += str(" the cascading failure.")
132132
print(e)
133133
raise SystemExit(3) from _panic
134134
sys.exit(0)

test-requirements.txt

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,32 @@ tox>=3.0.0
1313
setuptools>=75.0
1414
# virtualenv - MIT license
1515
virtualenv>=20.26.6
16-
# pip - MIT license
17-
pip>=24.3.1
1816
# build - MIT license
1917
build>=1.1.1, !=1.2.2.post1
20-
# python-repo - MIT
21-
#-e git+https://github.com/reactive-firewall/python-repo.git#egg=python-repo
2218
# wheel - MIT license
23-
wheel>=0.44
19+
wheel>=0.45
20+
# pip - MIT license
21+
pip>=25.1.1
2422
#
2523
# TESTING ONLY - Do NOT report issues with these optionals on python-repo
2624
#
27-
flake8>=5.0
28-
pyflakes>=2.5.0
29-
pep8>=1.0
30-
pytest>=7
31-
pytest-checkdocs>=2.4
32-
pytest-cov>=4.0.0
25+
# flake8 - MIT license
26+
flake8>=7.2.0
27+
# flake8-comprehensions - MIT License
28+
flake8-comprehensions>=3.16.0
29+
# pyflakes - MIT license
30+
# pyflakes>=3.3.2
31+
# pep8 - MIT license
32+
pep8>=1.7
33+
# pytest - MIT license
34+
pytest>=7.0, !=8.1.0
35+
# pytest-doctestplus - BSD license
36+
pytest-doctestplus>=1.4.0
37+
# pytest-cov - MIT license
38+
pytest-cov>=6.1.1
39+
# pytest-enabler - MIT license
3340
pytest-enabler>=1.0.1
34-
pytest-flake8>=1.0
35-
coverage >= 6.3
36-
pytest-cov >= 4.0.0;
37-
pytest-enabler >= 1.0.1
41+
# pytest-flake8 - BSD license - removed from tests in v2.0.9a3
42+
# pytest-flake8>=1.0.7
43+
# coverage - Apache 2.0 license
44+
coverage>=7.2

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import sys
2828
import os
2929
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), str('..'))))
30-
except (ImportError,OSError,TypeError,ValueError,AttributeError,IndexError) as ImportErr:
30+
except (ImportError, OSError, TypeError, ValueError, AttributeError, IndexError) as ImportErr:
3131
raise ImportError("[CWE-758] Test module failed completely.") from ImportErr
3232
from tests import context as context # skipcq: PYL-C0414
3333
if not hasattr(context, '__name__') or not context.__name__: # pragma: no branch

tests/check_spelling

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ umask 137
9797
# force utf-8 for spelling
9898
export LC_CTYPE="${LC_CTYPE:-en_US.UTF-8}"
9999

100-
LOCK_FILE="${TMPDIR:-/tmp}/org.pak.multicast.spell-check-shell"
100+
LOCK_FILE="${TMPDIR:-/tmp}/org.pak.pythonrepo.spell-check-shell"
101101
EXIT_CODE=1
102102

103103
# Function to check if a command exists.

0 commit comments

Comments
 (0)