pkg-about 1.2.0__zip → 1.2.5__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {pkg_about-1.2.0 → pkg_about-1.2.5}/CHANGES.rst +11 -0
  2. {pkg_about-1.2.0 → pkg_about-1.2.5}/PKG-INFO +26 -15
  3. {pkg_about-1.2.0 → pkg_about-1.2.5}/README.rst +5 -5
  4. pkg_about-1.2.5/pyproject.toml +279 -0
  5. pkg_about-1.2.5/setup.cfg +12 -0
  6. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about/_about.py +10 -9
  7. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/PKG-INFO +26 -15
  8. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/SOURCES.txt +1 -0
  9. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/requires.txt +5 -5
  10. {pkg_about-1.2.0 → pkg_about-1.2.5}/tests/test_main.py +37 -3
  11. pkg_about-1.2.0/pyproject.toml +0 -267
  12. pkg_about-1.2.0/setup.cfg +0 -4
  13. {pkg_about-1.2.0 → pkg_about-1.2.5}/.readthedocs.yml +0 -0
  14. {pkg_about-1.2.0 → pkg_about-1.2.5}/LICENSE +0 -0
  15. {pkg_about-1.2.0 → pkg_about-1.2.5}/MANIFEST.in +0 -0
  16. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/CHANGES.rst +0 -0
  17. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/README.rst +0 -0
  18. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/_static/.keep +0 -0
  19. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/_templates/.keep +0 -0
  20. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/conf.py +0 -0
  21. {pkg_about-1.2.0 → pkg_about-1.2.5}/docs/index.rst +0 -0
  22. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about/__about__.py +0 -0
  23. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about/__init__.py +0 -0
  24. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/dependency_links.txt +0 -0
  25. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/top_level.txt +0 -0
  26. {pkg_about-1.2.0 → pkg_about-1.2.5}/src/pkg_about.egg-info/zip-safe +0 -0
  27. {pkg_about-1.2.0 → pkg_about-1.2.5}/tests/__init__.py +0 -0
  28. {pkg_about-1.2.0 → pkg_about-1.2.5}/tests/__main__.py +0 -0
  29. {pkg_about-1.2.0 → pkg_about-1.2.5}/tests/data/.keep +0 -0
@@ -1,6 +1,17 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.2.5 (2024-11-13)
5
+ ------------------
6
+ - More unittests.
7
+ - 100% code coverage.
8
+ - Tox configuration is now in native (toml) format.
9
+ - Setup (dependencies) update.
10
+
11
+ 1.2.2 (2024-10-30)
12
+ ------------------
13
+ - Setup (dependencies) update.
14
+
4
15
  1.2.0 (2024-09-30)
5
16
  ------------------
6
17
  - Drop support for Python 3.8
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: pkg-about
3
- Version: 1.2.0
2
+ Name: pkg_about
3
+ Version: 1.2.5
4
4
  Summary: Shares Python package metadata at runtime.
5
5
  Author: Adam Karpierz
6
6
  Author-email: adam@karpierz.net
@@ -10,9 +10,9 @@ License: zlib/libpng License ; https://opensource.org/license/zlib
10
10
  Project-URL: Homepage, https://pypi.org/project/pkg-about/
11
11
  Project-URL: Documentation, https://pkg-about.readthedocs.io/
12
12
  Project-URL: Download, https://pypi.org/project/pkg-about/
13
- Project-URL: Source, https://github.com/karpierz/pkg-about
14
- Project-URL: Issues, https://github.com/karpierz/pkg-about/issues
15
- Keywords: pkg-about,pkg_about,__about__,packaging
13
+ Project-URL: Source, https://github.com/karpierz/pkg_about
14
+ Project-URL: Issues, https://github.com/karpierz/pkg_about/issues
15
+ Keywords: pkg_about,__about__,packaging
16
16
  Platform: any
17
17
  Classifier: Development Status :: 5 - Production/Stable
18
18
  Classifier: Intended Audience :: Developers
@@ -33,14 +33,14 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
33
  Requires-Python: <4.0.0,>=3.9.0
34
34
  Description-Content-Type: text/x-rst; charset=UTF-8
35
35
  License-File: LICENSE
36
- Requires-Dist: setuptools>=75.1.0
37
- Requires-Dist: packaging>=24.1.0
36
+ Requires-Dist: setuptools>=75.5.0
37
+ Requires-Dist: packaging>=24.2.0
38
38
  Requires-Dist: importlib-metadata>=8.5.0
39
- Requires-Dist: tomli>=2.0.1; python_version < "3.11"
39
+ Requires-Dist: tomli>=2.1.0; python_version < "3.11"
40
40
  Requires-Dist: docutils>=0.21.2
41
41
  Provides-Extra: doc
42
42
  Requires-Dist: Sphinx>=7.4.7; extra == "doc"
43
- Requires-Dist: sphinx-toolbox>=3.8.0; extra == "doc"
43
+ Requires-Dist: sphinx-toolbox>=3.8.1; extra == "doc"
44
44
  Requires-Dist: sphinx-tabs>=3.4.5; extra == "doc"
45
45
  Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
46
46
  Requires-Dist: sphinxcontrib-spelling>=8.0.0; extra == "doc"
@@ -49,9 +49,9 @@ Requires-Dist: restructuredtext-lint>=1.4.0; extra == "doc"
49
49
  Requires-Dist: nbsphinx>=0.9.5; extra == "doc"
50
50
  Provides-Extra: test
51
51
  Requires-Dist: deepdiff>=8.0.1; extra == "test"
52
- Requires-Dist: rich>=13.8.1; extra == "test"
52
+ Requires-Dist: rich>=13.9.4; extra == "test"
53
53
 
54
- pkg-about
54
+ pkg_about
55
55
  =========
56
56
 
57
57
  Shares Python package metadata at runtime.
@@ -134,17 +134,28 @@ Authors
134
134
 
135
135
  * Adam Karpierz <adam@karpierz.net>
136
136
 
137
- .. |package| replace:: pkg-about
138
- .. |package_bold| replace:: **pkg-about**
137
+ .. |package| replace:: pkg_about
138
+ .. |package_bold| replace:: **pkg_about**
139
139
  .. |copyright| replace:: Copyright (c) 2020-2024 Adam Karpierz
140
- .. |respository| replace:: https://github.com/karpierz/pkg-about.git
141
- .. _Development page: https://github.com/karpierz/pkg-about
140
+ .. |respository| replace:: https://github.com/karpierz/pkg_about.git
141
+ .. _Development page: https://github.com/karpierz/pkg_about
142
142
  .. _PyPI record: https://pypi.org/project/pkg-about/
143
143
  .. _Documentation: https://pkg-about.readthedocs.io/
144
144
 
145
145
  Changelog
146
146
  =========
147
147
 
148
+ 1.2.5 (2024-11-13)
149
+ ------------------
150
+ - More unittests.
151
+ - 100% code coverage.
152
+ - Tox configuration is now in native (toml) format.
153
+ - Setup (dependencies) update.
154
+
155
+ 1.2.2 (2024-10-30)
156
+ ------------------
157
+ - Setup (dependencies) update.
158
+
148
159
  1.2.0 (2024-09-30)
149
160
  ------------------
150
161
  - Drop support for Python 3.8
@@ -1,4 +1,4 @@
1
- pkg-about
1
+ pkg_about
2
2
  =========
3
3
 
4
4
  Shares Python package metadata at runtime.
@@ -81,10 +81,10 @@ Authors
81
81
 
82
82
  * Adam Karpierz <adam@karpierz.net>
83
83
 
84
- .. |package| replace:: pkg-about
85
- .. |package_bold| replace:: **pkg-about**
84
+ .. |package| replace:: pkg_about
85
+ .. |package_bold| replace:: **pkg_about**
86
86
  .. |copyright| replace:: Copyright (c) 2020-2024 Adam Karpierz
87
- .. |respository| replace:: https://github.com/karpierz/pkg-about.git
88
- .. _Development page: https://github.com/karpierz/pkg-about
87
+ .. |respository| replace:: https://github.com/karpierz/pkg_about.git
88
+ .. _Development page: https://github.com/karpierz/pkg_about
89
89
  .. _PyPI record: https://pypi.org/project/pkg-about/
90
90
  .. _Documentation: https://pkg-about.readthedocs.io/
@@ -0,0 +1,279 @@
1
+ # Copyright (c) 2020 Adam Karpierz
2
+ # SPDX-License-Identifier: Zlib
3
+
4
+ [build-system]
5
+ build-backend = 'setuptools.build_meta'
6
+ requires = ['setuptools>=75.5.0', 'packaging>=24.2.0', 'tox>=4.23.2']
7
+
8
+ [project]
9
+ name = 'pkg_about'
10
+ version = '1.2.5'
11
+ description = 'Shares Python package metadata at runtime.'
12
+ urls.Homepage = 'https://pypi.org/project/pkg-about/'
13
+ urls.Documentation = 'https://pkg-about.readthedocs.io/'
14
+ urls.Download = 'https://pypi.org/project/pkg-about/'
15
+ urls.Source = 'https://github.com/karpierz/pkg_about'
16
+ urls.Issues = 'https://github.com/karpierz/pkg_about/issues'
17
+ license = { text = 'zlib/libpng License ; https://opensource.org/license/zlib' }
18
+ authors = [
19
+ { name = 'Adam Karpierz' },
20
+ { email = 'adam@karpierz.net' },
21
+ ]
22
+ maintainers = [
23
+ { name = 'Adam Karpierz' },
24
+ { email = 'adam@karpierz.net' },
25
+ ]
26
+ keywords = ['pkg_about', '__about__', 'packaging']
27
+ classifiers = [
28
+ 'Development Status :: 5 - Production/Stable',
29
+ 'Intended Audience :: Developers',
30
+ 'License :: OSI Approved :: zlib/libpng License',
31
+ 'Operating System :: OS Independent',
32
+ 'Natural Language :: Polish',
33
+ 'Programming Language :: Python',
34
+ 'Programming Language :: Python :: 3',
35
+ 'Programming Language :: Python :: 3.9',
36
+ 'Programming Language :: Python :: 3.10',
37
+ 'Programming Language :: Python :: 3.11',
38
+ 'Programming Language :: Python :: 3.12',
39
+ 'Programming Language :: Python :: 3.13',
40
+ 'Programming Language :: Python :: 3 :: Only',
41
+ 'Programming Language :: Python :: Implementation :: CPython',
42
+ 'Programming Language :: Python :: Implementation :: PyPy',
43
+ 'Topic :: Software Development :: Libraries :: Python Modules',
44
+ ]
45
+ requires-python = '>=3.9.0,<4.0.0'
46
+ dependencies = [
47
+ # mandatory
48
+ 'setuptools>=75.5.0',
49
+ 'packaging>=24.2.0',
50
+ 'importlib-metadata>=8.5.0',
51
+ 'tomli>=2.1.0 ; python_version < "3.11"',
52
+ 'docutils>=0.21.2',
53
+ # others
54
+ ]
55
+ dynamic = ['readme']
56
+ optional-dependencies.'doc' = [
57
+ 'Sphinx>=7.4.7',
58
+ 'sphinx-toolbox>=3.8.1',
59
+ 'sphinx-tabs>=3.4.5', # don't touch! sphinx-toolbox requires <3.4.7
60
+ 'sphinx-copybutton>=0.5.2',
61
+ 'sphinxcontrib-spelling>=8.0.0',
62
+ 'sphinx-lint>=1.0.0',
63
+ 'restructuredtext-lint>=1.4.0',
64
+ 'nbsphinx>=0.9.5',
65
+ ]
66
+ optional-dependencies.'test' = [
67
+ 'deepdiff>=8.0.1',
68
+ 'rich>=13.9.4',
69
+ ]
70
+
71
+ [project.scripts]
72
+ #'pkg_about' = 'pkg_about.__main__:main'
73
+
74
+ [project.gui-scripts]
75
+ #'pkg_about-gui' = 'pkg_about:main_gui'
76
+
77
+ #[project.entry-points.'pkg_about.magical']
78
+ #epoint = 'pkg_about:main_epoint'
79
+
80
+ [tool.setuptools.dynamic]
81
+ readme = { file = ['README.rst', 'CHANGES.rst'], content-type = 'text/x-rst; charset=UTF-8' }
82
+
83
+ [tool.setuptools]
84
+ license-files = ['LICENSE']
85
+ include-package-data = true
86
+ platforms = ['any']
87
+ zip-safe = true
88
+
89
+ [tool.setuptools.packages.find]
90
+ namespaces = false
91
+ where = ['src']
92
+
93
+ [tool.setuptools.package-dir]
94
+ '' = 'src'
95
+ #'pkg_about.tests' = 'tests'
96
+
97
+ [tool.setuptools.package-data]
98
+ pkg_about = [
99
+ ]
100
+
101
+ [tool.setuptools.exclude-package-data]
102
+ '*' = ['*.c','*.h','*.cpp','*.hpp','*.cxx','*.hxx','*.pyx','*.pxd']
103
+ pkg_about = [
104
+ ]
105
+
106
+ [tool.coverage]
107
+ # run
108
+ run.source = [
109
+ 'pkg_about',
110
+ 'tests',
111
+ ]
112
+ run.omit = [
113
+ ]
114
+ run.branch = true
115
+ run.data_file = '.tox/coverage/.coverage'
116
+ run.plugins = ['covdefaults']
117
+ # report
118
+ report.exclude_lines = [
119
+ # Regexes
120
+ # Have to re-enable the standard pragma
121
+ '^\s*if\s+self\.debug\s*:',
122
+ '^\s*if\s+__debug__\s*:',
123
+ '^\s*if\s+(0|False)\s*:',
124
+ '''if\s+__name__.*\s*==\s*['"]__main__['"]\s*:''',
125
+ '^\s*@unittest\.skip\(',
126
+ '^\s*@unittest\.skipIf\(sys\.platform\.startswith\("win"\)',
127
+ ]
128
+ report.omit = [
129
+ 'tests/run.py',
130
+ ]
131
+ report.skip_covered = false
132
+ # html report
133
+ html.directory = '.tox/coverage/.coverage.html'
134
+
135
+ [tool.flake8]
136
+ filename = ['*.py','*.pyx']
137
+ #include = ['tests']
138
+ #exclude = ['.tox','*.egg','.git','__pycache__','build','_build','docs/_build','dist']
139
+ max-line-length = 99
140
+ ignore = ['E126','E203','E221','E251','E302','E701','E702','E731',
141
+ 'E122','E127','E128','E222','E272','E241','E266','E226','E704',
142
+ 'D100','D101','D102','D103','D104','D400','D401','D202',
143
+ 'N806','N802','N803','N801',
144
+ 'I100','W503']
145
+ # (e.g. 'E4','W') default: 'E121','E123','126','226','E24','704'
146
+ #select =
147
+ #select = ['E','W','F','N','I']
148
+ output-file = '.tox/lint/flake8out.txt'
149
+ count = true
150
+ #show-pep8,
151
+ #show-source
152
+ #verbose
153
+ #quiet
154
+
155
+ #
156
+ # Configuration(s) for tox
157
+ #
158
+
159
+ [tool.tox] # pkg_about
160
+ env_list = [{replace='ref',of=['tool','tox','labels','py'],extend=true}, 'coverage', 'lint', 'docs']
161
+ min_version = '4.23.2'
162
+ skip_missing_interpreters = true
163
+ requires = [
164
+ {replace='ref',of=['tool','tox','_','base','deps'],extend=true},
165
+ 'virtualenv>=20.27.1',
166
+ 'tox-tags>=0.2.0',
167
+ ]
168
+ [tool.tox.labels]
169
+ py = ['py39','py310','py311','py312','py313', 'pypy39','pypy310']
170
+ prepare = ['prepare']
171
+ coverage = ['coverage']
172
+ lint = ['lint']
173
+ docs = ['docs']
174
+ build = [{replace='ref',of=['tool','tox','labels','py'],extend=true}, 'docs', 'build']
175
+ deploy = [{replace='ref',of=['tool','tox','labels','build'],extend=true}, 'publish']
176
+
177
+ [tool.tox._.base]
178
+ base_python = ['python3.12']
179
+ deps = [
180
+ 'pip>=24.3.1',
181
+ 'setuptools>=75.5.0',
182
+ ]
183
+ package_subdir = 'pkg_about'
184
+
185
+ [tool.tox.env_run_base]
186
+ set_env.PYTHONDONTWRITEBYTECODE = '1'
187
+ commands = [
188
+ ['{env_python}','--version'],
189
+ ['{env_python}','-m','tests',{replace='posargs',extend=true}],
190
+ ]
191
+ extras = ['test']
192
+ deps = [
193
+ {replace='ref',of=['tool','tox','_','base','deps'],extend=true},
194
+ ]
195
+
196
+ [tool.tox.env.'prepare']
197
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
198
+ skip_install = true
199
+ allowlist_externals = [
200
+ 'cmd',
201
+ '.build',
202
+ ]
203
+ commands = [
204
+ ['cmd','/C','if','exist','.build.cmd','.build.cmd'],
205
+ ]
206
+ extras = []
207
+ deps = []
208
+
209
+ [tool.tox.env.'coverage']
210
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
211
+ commands = [
212
+ ['{env_python}','-m','coverage','erase'],
213
+ ['-','{env_python}','-m','coverage','run','-m','tests',{replace="posargs",extend=true}],
214
+ ['-','{env_python}','-m','coverage','html'],
215
+ ['{env_python}','-m','coverage','report'],
216
+ ]
217
+ deps = [
218
+ {replace='ref',of=['tool','tox','env_run_base','deps'],extend=true},
219
+ 'coverage>=7.6.4',
220
+ 'covdefaults>=2.3.0',
221
+ 'diff-cover>=9.2.0',
222
+ ]
223
+
224
+ [tool.tox.env.'docs']
225
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
226
+ commands = [
227
+ ['{env_python}','-m','sphinxlint','--ignore','.tox','--ignore','build','--ignore','dist'],
228
+ #['{env_python}','-m','sphinx.apidoc','-f','{envsitepackagesdir}/{[tool.tox._.base]package_subdir}'],
229
+ ['{env_python}','-m','sphinx.cmd.build','-W','-a','-b','html','-E','./docs','./build/docs/html'],
230
+ ['{env_python}','-m','sphinx.cmd.build','-W','-a','-b','linkcheck','./docs','./build/docs/html'],
231
+ ['{env_python}','-m','sphinx.cmd.build','-W','-a','-b','doctest', './docs','./build/docs/html'],
232
+ ]
233
+ extras = ['doc']
234
+ deps = [
235
+ {replace='ref',of=['tool','tox','_','base','deps'],extend=true},
236
+ ]
237
+
238
+ [tool.tox.env.'build']
239
+ depends = [{replace='ref',of=['tool','tox','labels','py'],extend=true}, 'docs']
240
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
241
+ commands = [
242
+ ['{env_python}','-W','ignore','-c','from setuptools import setup ; setup()','--quiet','sdist','--formats=zip'],
243
+ ['{env_python}','-W','ignore','-c','from setuptools import setup ; setup()','--quiet','bdist_wheel'],
244
+ # check out for PyPi
245
+ ['{env_python}','-m','twine','check','dist/*'],
246
+ ]
247
+ deps = [
248
+ {replace='ref',of=['tool','tox','env_run_base','deps'],extend=true},
249
+ 'twine>=5.1.1',
250
+ ]
251
+
252
+ [tool.tox.env.'publish']
253
+ depends = ['build']
254
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
255
+ skip_install = true
256
+ commands = [
257
+ # publish on PyPi
258
+ ['{env_python}','-m','twine','upload','dist/*'],
259
+ ]
260
+ extras = []
261
+ deps = [
262
+ 'twine>=5.1.1',
263
+ ]
264
+
265
+ [tool.tox.env.'lint']
266
+ base_python = {replace='ref',of=['tool','tox','_','base','base_python']}
267
+ commands = [
268
+ ['{env_python}','-m','flake8','{envsitepackagesdir}/{[tool.tox._.base]package_subdir}/'],
269
+ ]
270
+ extras = []
271
+ deps = [
272
+ {replace='ref',of=['tool','tox','env_run_base','deps'],extend=true},
273
+ 'flake8>=7.1.1',
274
+ 'flake8-pyproject>=1.2.3',
275
+ 'flake8-docstrings>=1.7.0',
276
+ 'pep8-naming>=0.14.1',
277
+ 'flake8-builtins>=2.5.0',
278
+ 'flake8-deprecated>=2.2.1',
279
+ ]
@@ -0,0 +1,12 @@
1
+ [metadata]
2
+ name = pkg_about
3
+ description = Intentionally temporary/random. Will/should be covered from pyproject.toml.
4
+ author = John Smith
5
+ author_email = smith@domain.invalid
6
+ maintainer = John Smith
7
+ maintainer_email = smith@domain.invalid
8
+
9
+ [egg_info]
10
+ tag_build =
11
+ tag_date = 0
12
+
@@ -75,10 +75,10 @@ def about_from_setup(package_path=None):
75
75
  setup_cfg_path = package_path/"setup.cfg"
76
76
  readme_path = package_path/"README.rst"
77
77
  metadata = {}
78
- if setup_cfg_path.exists():
78
+ if setup_cfg_path.exists(): # pragma: no branch
79
79
  metadata.update(read_setupcfg(setup_cfg_path,
80
80
  ignore_option_errors=True).get("metadata", {}))
81
- if pyproject_path.exists():
81
+ if pyproject_path.exists(): # pragma: no branch
82
82
  if read_pyprojecttoml:
83
83
  metadata.update(read_pyprojecttoml(pyproject_path,
84
84
  ignore_option_errors=True).get("project", {}))
@@ -134,7 +134,7 @@ def about_from_setup(package_path=None):
134
134
  (next(about_py).open("rt", encoding="utf-8")
135
135
  if about_py else ())
136
136
  if copyr_patt.split(line)[1:]), "None"))
137
- if __copyright__ is None and readme_path.exists():
137
+ if __copyright__ is None and readme_path.exists(): # pragma: no branch
138
138
  __copyright__ = get_copyright(readme_path.read_text(encoding="utf-8"))
139
139
 
140
140
  pkg_globals["about"] = about
@@ -145,9 +145,11 @@ def about_from_setup(package_path=None):
145
145
  def __get(mdata, *keys):
146
146
  for key in keys:
147
147
  if isinstance(mdata, dict):
148
- if key not in mdata: return None
148
+ if key not in mdata:
149
+ return None
149
150
  elif isinstance(mdata, (list, tuple)):
150
- if key >= len(mdata): return None
151
+ if key >= len(mdata): # pragma: no cover
152
+ return None
151
153
  else: # pragma: no cover
152
154
  return None
153
155
  mdata = mdata[key]
@@ -158,7 +160,7 @@ def __get_copyright(description):
158
160
  from docutils.core import publish_doctree
159
161
  from docutils import nodes
160
162
  copyr = None
161
- if description is not None:
163
+ if description is not None: # pragma: no branch
162
164
  document = publish_doctree(description)
163
165
  subst_name = document.substitution_names.get("copyright")
164
166
  substitution = document.substitution_defs.get(subst_name)
@@ -167,16 +169,15 @@ def __get_copyright(description):
167
169
  else:
168
170
  # Try to get from 'License' section
169
171
  section = document.ids.get(document.nameids.get("license"))
170
- if section is not None:
172
+ if section is not None: # pragma: no branch
171
173
  lblock = section.next_node(nodes.line_block)
172
- if lblock is not None:
174
+ if lblock is not None: # pragma: no branch
173
175
  copyr = next((line for _ in lblock.findall(nodes.line)
174
176
  if ((line := _.astext().lstrip()).lower()
175
177
  .startswith("copyright"))), None)
176
178
  return copyr
177
179
 
178
180
 
179
-
180
181
  __release_levels = dict(
181
182
  a = "alpha",
182
183
  b = "beta",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: pkg-about
3
- Version: 1.2.0
2
+ Name: pkg_about
3
+ Version: 1.2.5
4
4
  Summary: Shares Python package metadata at runtime.
5
5
  Author: Adam Karpierz
6
6
  Author-email: adam@karpierz.net
@@ -10,9 +10,9 @@ License: zlib/libpng License ; https://opensource.org/license/zlib
10
10
  Project-URL: Homepage, https://pypi.org/project/pkg-about/
11
11
  Project-URL: Documentation, https://pkg-about.readthedocs.io/
12
12
  Project-URL: Download, https://pypi.org/project/pkg-about/
13
- Project-URL: Source, https://github.com/karpierz/pkg-about
14
- Project-URL: Issues, https://github.com/karpierz/pkg-about/issues
15
- Keywords: pkg-about,pkg_about,__about__,packaging
13
+ Project-URL: Source, https://github.com/karpierz/pkg_about
14
+ Project-URL: Issues, https://github.com/karpierz/pkg_about/issues
15
+ Keywords: pkg_about,__about__,packaging
16
16
  Platform: any
17
17
  Classifier: Development Status :: 5 - Production/Stable
18
18
  Classifier: Intended Audience :: Developers
@@ -33,14 +33,14 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
33
  Requires-Python: <4.0.0,>=3.9.0
34
34
  Description-Content-Type: text/x-rst; charset=UTF-8
35
35
  License-File: LICENSE
36
- Requires-Dist: setuptools>=75.1.0
37
- Requires-Dist: packaging>=24.1.0
36
+ Requires-Dist: setuptools>=75.5.0
37
+ Requires-Dist: packaging>=24.2.0
38
38
  Requires-Dist: importlib-metadata>=8.5.0
39
- Requires-Dist: tomli>=2.0.1; python_version < "3.11"
39
+ Requires-Dist: tomli>=2.1.0; python_version < "3.11"
40
40
  Requires-Dist: docutils>=0.21.2
41
41
  Provides-Extra: doc
42
42
  Requires-Dist: Sphinx>=7.4.7; extra == "doc"
43
- Requires-Dist: sphinx-toolbox>=3.8.0; extra == "doc"
43
+ Requires-Dist: sphinx-toolbox>=3.8.1; extra == "doc"
44
44
  Requires-Dist: sphinx-tabs>=3.4.5; extra == "doc"
45
45
  Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
46
46
  Requires-Dist: sphinxcontrib-spelling>=8.0.0; extra == "doc"
@@ -49,9 +49,9 @@ Requires-Dist: restructuredtext-lint>=1.4.0; extra == "doc"
49
49
  Requires-Dist: nbsphinx>=0.9.5; extra == "doc"
50
50
  Provides-Extra: test
51
51
  Requires-Dist: deepdiff>=8.0.1; extra == "test"
52
- Requires-Dist: rich>=13.8.1; extra == "test"
52
+ Requires-Dist: rich>=13.9.4; extra == "test"
53
53
 
54
- pkg-about
54
+ pkg_about
55
55
  =========
56
56
 
57
57
  Shares Python package metadata at runtime.
@@ -134,17 +134,28 @@ Authors
134
134
 
135
135
  * Adam Karpierz <adam@karpierz.net>
136
136
 
137
- .. |package| replace:: pkg-about
138
- .. |package_bold| replace:: **pkg-about**
137
+ .. |package| replace:: pkg_about
138
+ .. |package_bold| replace:: **pkg_about**
139
139
  .. |copyright| replace:: Copyright (c) 2020-2024 Adam Karpierz
140
- .. |respository| replace:: https://github.com/karpierz/pkg-about.git
141
- .. _Development page: https://github.com/karpierz/pkg-about
140
+ .. |respository| replace:: https://github.com/karpierz/pkg_about.git
141
+ .. _Development page: https://github.com/karpierz/pkg_about
142
142
  .. _PyPI record: https://pypi.org/project/pkg-about/
143
143
  .. _Documentation: https://pkg-about.readthedocs.io/
144
144
 
145
145
  Changelog
146
146
  =========
147
147
 
148
+ 1.2.5 (2024-11-13)
149
+ ------------------
150
+ - More unittests.
151
+ - 100% code coverage.
152
+ - Tox configuration is now in native (toml) format.
153
+ - Setup (dependencies) update.
154
+
155
+ 1.2.2 (2024-10-30)
156
+ ------------------
157
+ - Setup (dependencies) update.
158
+
148
159
  1.2.0 (2024-09-30)
149
160
  ------------------
150
161
  - Drop support for Python 3.8
@@ -4,6 +4,7 @@ LICENSE
4
4
  MANIFEST.in
5
5
  README.rst
6
6
  pyproject.toml
7
+ setup.cfg
7
8
  docs/CHANGES.rst
8
9
  docs/README.rst
9
10
  docs/conf.py
@@ -1,14 +1,14 @@
1
- setuptools>=75.1.0
2
- packaging>=24.1.0
1
+ setuptools>=75.5.0
2
+ packaging>=24.2.0
3
3
  importlib-metadata>=8.5.0
4
4
  docutils>=0.21.2
5
5
 
6
6
  [:python_version < "3.11"]
7
- tomli>=2.0.1
7
+ tomli>=2.1.0
8
8
 
9
9
  [doc]
10
10
  Sphinx>=7.4.7
11
- sphinx-toolbox>=3.8.0
11
+ sphinx-toolbox>=3.8.1
12
12
  sphinx-tabs>=3.4.5
13
13
  sphinx-copybutton>=0.5.2
14
14
  sphinxcontrib-spelling>=8.0.0
@@ -18,4 +18,4 @@ nbsphinx>=0.9.5
18
18
 
19
19
  [test]
20
20
  deepdiff>=8.0.1
21
- rich>=13.8.1
21
+ rich>=13.9.4
@@ -2,16 +2,26 @@
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
4
  import unittest
5
+ import sys
5
6
  from pathlib import Path
7
+ import textwrap
6
8
 
7
9
  import pkg_about
10
+ from pkg_about._about import __get_copyright as get_copyright
8
11
 
9
12
 
10
13
  class MainTestCase(unittest.TestCase):
11
14
 
12
15
  @classmethod
13
16
  def setUpClass(cls):
14
- cls.version_expected = "1.2.0"
17
+ pyproject_path = Path(__file__).resolve().parent.parent/"pyproject.toml"
18
+ if sys.version_info >= (3, 11):
19
+ import tomllib
20
+ else: # pragma: no cover
21
+ import tomli as tomllib
22
+ with pyproject_path.open("rb") as file:
23
+ metadata = tomllib.load(file).get("project", {})
24
+ cls.version_expected = metadata["version"]
15
25
  version_parts = cls.version_expected.split(".")
16
26
  cls.version_major_expected = int(version_parts[0])
17
27
  cls.version_minor_expected = int(version_parts[1])
@@ -19,7 +29,7 @@ class MainTestCase(unittest.TestCase):
19
29
 
20
30
  def test_about(self):
21
31
  pkg_about.about("pkg_about")
22
- self.assertEqual(__title__, "pkg-about")
32
+ self.assertEqual(__title__, "pkg_about")
23
33
  self.assertEqual(__version__, self.version_expected)
24
34
  self.assertEqual(__version_info__.major, self.version_major_expected)
25
35
  self.assertEqual(__version_info__.minor, self.version_minor_expected)
@@ -39,7 +49,7 @@ class MainTestCase(unittest.TestCase):
39
49
 
40
50
  def test_about_from_setup(self):
41
51
  pkg_about.about_from_setup(Path(__file__).resolve().parent.parent)
42
- self.assertEqual(about.__title__, "pkg-about")
52
+ self.assertEqual(about.__title__, "pkg_about")
43
53
  self.assertEqual(about.__version__, self.version_expected)
44
54
  self.assertEqual(about.__version_info__.major, self.version_major_expected)
45
55
  self.assertEqual(about.__version_info__.minor, self.version_minor_expected)
@@ -56,3 +66,27 @@ class MainTestCase(unittest.TestCase):
56
66
  self.assertEqual(about.__license__,
57
67
  "zlib/libpng License ; https://opensource.org/license/zlib")
58
68
  self.assertEqual(about.__copyright__, "Copyright (c) 2020-2024 Adam Karpierz")
69
+
70
+ def test_get_copyright(self):
71
+ self.assertEqual(get_copyright(textwrap.dedent(
72
+ """
73
+ License
74
+ =======
75
+
76
+ | |copyright|
77
+ | Licensed under the zlib/libpng License
78
+ | https://opensource.org/license/zlib
79
+ | Please refer to the accompanying LICENSE file.
80
+
81
+ .. |copyright| replace:: Copyright (c) 2020-2024 Adam Karpierz
82
+ """)), "Copyright (c) 2020-2024 Adam Karpierz")
83
+ self.assertEqual(get_copyright(textwrap.dedent(
84
+ """
85
+ License
86
+ =======
87
+
88
+ | Copyright (c) 2020-2024 Adam Karpierz
89
+ | Licensed under the zlib/libpng License
90
+ | https://opensource.org/license/zlib
91
+ | Please refer to the accompanying LICENSE file.
92
+ """)), "Copyright (c) 2020-2024 Adam Karpierz")
@@ -1,267 +0,0 @@
1
- # Copyright (c) 2020 Adam Karpierz
2
- # SPDX-License-Identifier: Zlib
3
-
4
- [build-system]
5
- build-backend = 'setuptools.build_meta'
6
- requires = ['setuptools>=75.1.0', 'wheel>=0.44.0', 'packaging>=24.1.0', 'tox>=4.20.0']
7
-
8
- [project]
9
- name = 'pkg-about'
10
- version = '1.2.0'
11
- description = 'Shares Python package metadata at runtime.'
12
- urls.Homepage = 'https://pypi.org/project/pkg-about/'
13
- urls.Documentation = 'https://pkg-about.readthedocs.io/'
14
- urls.Download = 'https://pypi.org/project/pkg-about/'
15
- urls.Source = 'https://github.com/karpierz/pkg-about'
16
- urls.Issues = 'https://github.com/karpierz/pkg-about/issues'
17
- license = { text = 'zlib/libpng License ; https://opensource.org/license/zlib' }
18
- authors = [
19
- { name = 'Adam Karpierz' },
20
- { email = 'adam@karpierz.net' },
21
- ]
22
- maintainers = [
23
- { name = 'Adam Karpierz' },
24
- { email = 'adam@karpierz.net' },
25
- ]
26
- keywords = ['pkg-about', 'pkg_about', '__about__', 'packaging']
27
- classifiers = [
28
- 'Development Status :: 5 - Production/Stable',
29
- 'Intended Audience :: Developers',
30
- 'License :: OSI Approved :: zlib/libpng License',
31
- 'Operating System :: OS Independent',
32
- 'Natural Language :: Polish',
33
- 'Programming Language :: Python',
34
- 'Programming Language :: Python :: 3',
35
- 'Programming Language :: Python :: 3.9',
36
- 'Programming Language :: Python :: 3.10',
37
- 'Programming Language :: Python :: 3.11',
38
- 'Programming Language :: Python :: 3.12',
39
- 'Programming Language :: Python :: 3.13',
40
- 'Programming Language :: Python :: 3 :: Only',
41
- 'Programming Language :: Python :: Implementation :: CPython',
42
- 'Programming Language :: Python :: Implementation :: PyPy',
43
- 'Topic :: Software Development :: Libraries :: Python Modules',
44
- ]
45
- requires-python = '>=3.9.0,<4.0.0'
46
- dependencies = [
47
- # mandatory
48
- 'setuptools>=75.1.0',
49
- 'packaging>=24.1.0',
50
- 'importlib-metadata>=8.5.0',
51
- 'tomli>=2.0.1 ; python_version < "3.11"',
52
- 'docutils>=0.21.2',
53
- # others
54
- ]
55
- dynamic = ['readme']
56
- [project.optional-dependencies]
57
- doc = [
58
- 'Sphinx>=7.4.7',
59
- 'sphinx-toolbox>=3.8.0',
60
- 'sphinx-tabs>=3.4.5',
61
- 'sphinx-copybutton>=0.5.2',
62
- 'sphinxcontrib-spelling>=8.0.0',
63
- 'sphinx-lint>=1.0.0',
64
- 'restructuredtext-lint>=1.4.0',
65
- 'nbsphinx>=0.9.5',
66
- ]
67
- test = [
68
- 'deepdiff>=8.0.1',
69
- 'rich>=13.8.1',
70
- ]
71
-
72
- [project.scripts]
73
- #'pkg_about' = 'pkg_about.__main__:main'
74
-
75
- [project.gui-scripts]
76
- #'pkg_about-gui' = 'pkg_about:main_gui'
77
-
78
- #[project.entry-points.'pkg_about.magical']
79
- #epoint = 'pkg_about:main_epoint'
80
-
81
- [tool.setuptools.dynamic]
82
- readme = { file = ['README.rst', 'CHANGES.rst'], content-type = 'text/x-rst; charset=UTF-8' }
83
-
84
- [tool.setuptools]
85
- license-files = ['LICENSE']
86
- include-package-data = true
87
- platforms = ['any']
88
- zip-safe = true
89
-
90
- [tool.setuptools.packages.find]
91
- namespaces = false
92
- where = ['src']
93
-
94
- [tool.setuptools.package-dir]
95
- '' = 'src'
96
- #'pkg_about.tests' = 'tests'
97
-
98
- [tool.setuptools.package-data]
99
- pkg_about = [
100
- ]
101
-
102
- [tool.setuptools.exclude-package-data]
103
- '*' = ['*.c','*.h','*.cpp','*.hpp','*.cxx','*.hxx','*.pyx','*.pxd']
104
- pkg_about = [
105
- ]
106
-
107
- [tool.coverage.run]
108
- source = [
109
- 'pkg_about',
110
- 'tests',
111
- ]
112
- omit = [
113
- ]
114
- data_file = '.tox/coverage/.coverage'
115
- plugins = ['covdefaults']
116
-
117
- [tool.coverage.report]
118
- exclude_lines = [
119
- # Regexes
120
- # Have to re-enable the standard pragma
121
- '^\s*if\s+self\.debug\s*:',
122
- '^\s*if\s+__debug__\s*:',
123
- '^\s*if\s+(0|False)\s*:',
124
- '''if\s+__name__.*\s*==\s*['"]__main__['"]\s*:''',
125
- '^\s*@unittest\.skip\(',
126
- '^\s*@unittest\.skipIf\(sys\.platform\.startswith\("win"\)',
127
- ]
128
- omit = [
129
- 'tests/run.py',
130
- ]
131
- skip_covered = false
132
-
133
- [tool.coverage.html]
134
- directory = '.tox/coverage/.coverage.html'
135
-
136
- [tool.flake8]
137
- filename = ['*.py','*.pyx']
138
- #include = ['tests']
139
- #exclude = ['.tox','*.egg','.git','__pycache__','build','_build','docs/_build','dist']
140
- max-line-length = 99
141
- ignore = ['E126','E203','E221','E251','E302','E701','E702','E731',
142
- 'E122','E127','E128','E222','E272','E241','E266','E226','E704',
143
- 'D100','D101','D102','D103','D104','D400','D401','D202',
144
- 'N806','N802','N803','N801',
145
- 'I100','W503']
146
- # (e.g. 'E4','W') default: 'E121','E123','126','226','E24','704'
147
- #select =
148
- #select = ['E','W','F','N','I']
149
- output-file = '.tox/lint/flake8out.txt'
150
- count = true
151
- #show-pep8,
152
- #show-source
153
- #verbose
154
- #quiet
155
-
156
- #
157
- # Configuration(s) for tox
158
- #
159
-
160
- [tool.tox]
161
- legacy_tox_ini = """
162
- [tox]
163
- envlist = py{39,310,311,312,313}, pypy{39,310}, docs
164
- labels =
165
- py = py{39,310,311,312,313}, pypy{39,310}
166
- prepare = prepare
167
- coverage = coverage
168
- lint = lint
169
- docs = docs
170
- build = py{39,310,311,312,313}, pypy{39,310}, docs, build
171
- deploy = py{39,310,311,312,313}, pypy{39,310}, docs, build, publish
172
- minversion = 4.20.0
173
- skip_missing_interpreters = true
174
- requires =
175
- {[base]deps}
176
- virtualenv>=20.26.6
177
- tox-tags>=0.2.0
178
-
179
- [base]
180
- basepython = python3.12
181
- deps =
182
- pip>=24.2.0
183
- setuptools>=75.1.0
184
- wheel>=0.44.0
185
- packagesubdir = pkg_about
186
-
187
- [testenv]
188
- passenv = WINDIR
189
- setenv =
190
- PYTHONDONTWRITEBYTECODE = 1
191
- commands =
192
- {envpython} --version
193
- {envpython} -m tests {posargs}
194
- extras = test
195
- deps =
196
- {[base]deps}
197
-
198
- [testenv:prepare]
199
- basepython = {[base]basepython}
200
- skip_install = true
201
- allowlist_externals =
202
- cmd
203
- .build
204
- commands =
205
- cmd /C if exist .build.cmd .build.cmd
206
-
207
- [testenv:coverage]
208
- basepython = {[base]basepython}
209
- commands =
210
- {envpython} -m coverage erase
211
- -{envpython} -m coverage run -m tests {posargs}
212
- {envpython} -m coverage report
213
- {envpython} -m coverage html
214
- deps =
215
- {[testenv]deps}
216
- coverage>=7.6.1
217
- covdefaults>=2.3.0
218
- diff-cover>=9.2.0
219
-
220
- [testenv:docs]
221
- basepython = {[base]basepython}
222
- commands =
223
- {envpython} -m sphinxlint --ignore .tox --ignore build --ignore dist
224
- #{envpython} -m sphinx.apidoc -f {envsitepackagesdir}/{[base]packagesubdir}
225
- {envpython} -m sphinx.cmd.build -W -a -b html -E ./docs ./build/docs/html
226
- {envpython} -m sphinx.cmd.build -W -a -b linkcheck ./docs ./build/docs/html
227
- {envpython} -m sphinx.cmd.build -W -a -b doctest ./docs ./build/docs/html
228
- extras = doc
229
- deps =
230
-
231
- [testenv:build]
232
- depends = py{39,310,311,312,313}, pypy{39,310}, docs
233
- basepython = {[base]basepython}
234
- commands =
235
- {envpython} -W ignore -c "from setuptools import setup ; setup()" --quiet sdist --formats=zip
236
- {envpython} -W ignore -c "from setuptools import setup ; setup()" --quiet bdist_wheel
237
- # check out for PyPi
238
- {envpython} -m twine check dist/*
239
- deps =
240
- {[testenv]deps}
241
- twine>=5.1.1
242
-
243
- [testenv:publish]
244
- depends = build
245
- basepython = {[base]basepython}
246
- skip_install = true
247
- commands =
248
- # publish on PyPi
249
- {envpython} -m twine upload dist/*
250
- extras =
251
- deps =
252
- twine>=5.1.1
253
-
254
- [testenv:lint]
255
- basepython = {[base]basepython}
256
- commands =
257
- {envpython} -m flake8 {envsitepackagesdir}/{[base]packagesubdir}/
258
- extras =
259
- deps =
260
- {[testenv]deps}
261
- flake8>=7.1.1
262
- flake8-pyproject>=1.2.3
263
- flake8-docstrings>=1.7.0
264
- pep8-naming>=0.14.1
265
- flake8-builtins>=2.5.0
266
- flake8-deprecated>=2.2.1
267
- """
pkg_about-1.2.0/setup.cfg DELETED
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes