updateCitation 0.2.1__tar.gz → 0.2.2__tar.gz

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 (34) hide show
  1. updatecitation-0.2.2/MANIFEST.in +3 -0
  2. {updatecitation-0.2.1 → updatecitation-0.2.2}/PKG-INFO +15 -10
  3. {updatecitation-0.2.1 → updatecitation-0.2.2}/README.md +14 -5
  4. updatecitation-0.2.2/pyproject.toml +293 -0
  5. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/conftest.py +7 -0
  6. updatecitation-0.2.2/tests/dataSamples/citationAlpha.cff +38 -0
  7. {updatecitation-0.2.1 → updatecitation-0.2.2/tests/dataSamples}/pyproject.toml +10 -8
  8. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_flowControl.py +34 -0
  9. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/pypa.py +1 -0
  10. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/variables.py +26 -9
  11. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation.egg-info/PKG-INFO +15 -10
  12. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation.egg-info/SOURCES.txt +3 -0
  13. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation.egg-info/requires.txt +0 -5
  14. updatecitation-0.2.2/updateCitation.egg-info/top_level.txt +1 -0
  15. updatecitation-0.2.1/updateCitation.egg-info/top_level.txt +0 -4
  16. {updatecitation-0.2.1 → updatecitation-0.2.2}/LICENSE +0 -0
  17. {updatecitation-0.2.1 → updatecitation-0.2.2}/setup.cfg +0 -0
  18. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/__init__.py +0 -0
  19. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_citationFileFormat.py +0 -0
  20. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_github.py +0 -0
  21. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_pypa.py +0 -0
  22. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_pypi.py +0 -0
  23. {updatecitation-0.2.1 → updatecitation-0.2.2}/tests/test_variables.py +0 -0
  24. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/__init__.py +0 -0
  25. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/_semiotics.py +0 -0
  26. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/_theTypes.py +0 -0
  27. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/citationFileFormat.py +0 -0
  28. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/flowControl.py +0 -0
  29. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/github.py +0 -0
  30. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/py.typed +0 -0
  31. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/pypi.py +0 -0
  32. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation/pyprojectDOTtoml.py +0 -0
  33. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation.egg-info/dependency_links.txt +0 -0
  34. {updatecitation-0.2.1 → updatecitation-0.2.2}/updateCitation.egg-info/entry_points.txt +0 -0
@@ -0,0 +1,3 @@
1
+ graft tests
2
+ prune tests/coverage
3
+ global-exclude __pycache__ *.py[cod]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: updateCitation
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Automatically update citation files (CITATION.cff) in a GitHub repository from `pyproject.toml`, GitHub releases, and PyPI releases.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License-Expression: CC-BY-NC-4.0
@@ -36,12 +36,9 @@ Requires-Dist: pygithub
36
36
  Requires-Dist: ruamel.yaml
37
37
  Requires-Dist: tomli
38
38
  Requires-Dist: typing_extensions>=4.0.0
39
- Provides-Extra: testing
40
- Requires-Dist: pytest; extra == "testing"
41
- Requires-Dist: pytest-cov; extra == "testing"
42
- Requires-Dist: pytest-xdist; extra == "testing"
43
39
  Dynamic: license-file
44
40
 
41
+ <!-- path-sync copy -n hunterhogan -->
45
42
  # updateCitation
46
43
 
47
44
  Automatically update `CITATION.cff` from your Python project's `pyproject.toml`, GitHub release data when enabled, and PyPI release data when enabled.
@@ -303,6 +300,13 @@ addPyPIrelease = false
303
300
 
304
301
  Contributions are welcome. Please feel free to submit pull requests.
305
302
 
303
+ To run the tests, install `updateCitation` in editable mode with the `testing` [dependency group](https://packaging.python.org/en/latest/specifications/dependency-groups/) (this needs `pip` 25.1 or newer), then run `pytest` from the repository root:
304
+
305
+ ```bash
306
+ pip install -e . --group testing
307
+ pytest
308
+ ```
309
+
306
310
  ## Design Goals
307
311
 
308
312
  1. 100% Python.
@@ -311,14 +315,15 @@ Contributions are welcome. Please feel free to submit pull requests.
311
315
  4. All settings for external services, such as GitHub and PyPI, use the configuration from those services instead of creating new configuration for `updateCitation`.
312
316
  5. Highly extensible for current and future services.
313
317
 
314
- ## My Recovery
315
-
316
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
318
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
319
+ ## My recovery
317
320
 
318
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/updateCitation/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
321
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
322
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
319
323
 
320
- By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/updateCitation#License-1-ov-file) outlines how you may use this work.
324
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
321
325
 
322
326
  The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
323
327
 
324
328
  To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
329
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -1,3 +1,4 @@
1
+ <!-- path-sync copy -n hunterhogan -->
1
2
  # updateCitation
2
3
 
3
4
  Automatically update `CITATION.cff` from your Python project's `pyproject.toml`, GitHub release data when enabled, and PyPI release data when enabled.
@@ -259,6 +260,13 @@ addPyPIrelease = false
259
260
 
260
261
  Contributions are welcome. Please feel free to submit pull requests.
261
262
 
263
+ To run the tests, install `updateCitation` in editable mode with the `testing` [dependency group](https://packaging.python.org/en/latest/specifications/dependency-groups/) (this needs `pip` 25.1 or newer), then run `pytest` from the repository root:
264
+
265
+ ```bash
266
+ pip install -e . --group testing
267
+ pytest
268
+ ```
269
+
262
270
  ## Design Goals
263
271
 
264
272
  1. 100% Python.
@@ -267,14 +275,15 @@ Contributions are welcome. Please feel free to submit pull requests.
267
275
  4. All settings for external services, such as GitHub and PyPI, use the configuration from those services instead of creating new configuration for `updateCitation`.
268
276
  5. Highly extensible for current and future services.
269
277
 
270
- ## My Recovery
271
-
272
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
278
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
279
+ ## My recovery
273
280
 
274
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/updateCitation/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
281
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
282
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
275
283
 
276
- By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/updateCitation#License-1-ov-file) outlines how you may use this work.
284
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
277
285
 
278
286
  The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
279
287
 
280
288
  To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
289
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -0,0 +1,293 @@
1
+ # path-sync copy -n hunterhogan
2
+ [project]
3
+ name = "updateCitation"
4
+ version = "0.2.2"
5
+ description = "Automatically update citation files (CITATION.cff) in a GitHub repository from `pyproject.toml`, GitHub releases, and PyPI releases."
6
+ readme = { file = "README.md", content-type = "text/markdown" }
7
+ requires-python = ">=3.10"
8
+ license = "CC-BY-NC-4.0"
9
+ authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
10
+ keywords = [
11
+ "academic-software",
12
+ "automation",
13
+ "cff",
14
+ "citation",
15
+ "citation-files",
16
+ "doi",
17
+ "github",
18
+ "metadata",
19
+ "publishing",
20
+ "references",
21
+ "research-software",
22
+ "scholarly-communication",
23
+ "software-citation",
24
+ "zenodo",
25
+ ]
26
+ classifiers = [
27
+ "Development Status :: 3 - Alpha",
28
+ "Environment :: Console",
29
+ "Framework :: Pytest",
30
+ "Intended Audience :: Developers",
31
+ "Intended Audience :: Information Technology",
32
+ "Intended Audience :: Science/Research",
33
+ "Natural Language :: English",
34
+ "Operating System :: OS Independent",
35
+ "Programming Language :: Python",
36
+ "Programming Language :: Python :: 3",
37
+ "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.15",
39
+ "Topic :: Scientific/Engineering",
40
+ "Topic :: Software Development :: Documentation",
41
+ "Topic :: Software Development :: Libraries :: Python Modules",
42
+ "Topic :: Text Processing :: Markup",
43
+ "Topic :: Utilities",
44
+ "Typing :: Typed",
45
+ ]
46
+ urls = { Donate = "https://www.patreon.com/integrated", Homepage = "https://github.com/hunterhogan/updateCitation", Repository = "https://github.com/hunterhogan/updateCitation.git" }
47
+ scripts = { updateCitation = "updateCitation.flowControl:here" }
48
+ dependencies = [
49
+ "attrs",
50
+ "cffconvert",
51
+ "packaging",
52
+ "pygithub",
53
+ "ruamel.yaml",
54
+ "tomli",
55
+ "typing_extensions>= 4.0.0",
56
+ ]
57
+
58
+ [dependency-groups]
59
+ testing = [
60
+ "pytest>=9.0",
61
+ "pytest-cov",
62
+ "pytest-xdist",
63
+ ]
64
+
65
+ [build-system]
66
+ requires = ["setuptools>=77.0.0"]
67
+ build-backend = "setuptools.build_meta"
68
+
69
+ [tool.coverage]
70
+ report = { exclude_lines = [
71
+ "if TYPE_CHECKING:",
72
+ "if __name__ == \"__main__\":",
73
+ ], ignore_errors = false }
74
+ run = { branch = true, concurrency = [
75
+ "multiprocessing",
76
+ ], data_file = "tests/coverage/.coverage", omit = [
77
+ "tests/*",
78
+ ], parallel = true, source = [
79
+ ".",
80
+ ] }
81
+ xml = { output = "tests/coverage/coverage.xml" }
82
+
83
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
84
+ [tool.isort]
85
+ add_imports = ["from __future__ import annotations"]
86
+ combine_as_imports = true
87
+ extend_skip_glob = ["*.ipynb", "*.pyi"]
88
+ filter_files = true
89
+ force_alphabetical_sort_within_sections = true
90
+ from_first = true
91
+ honor_noqa = true
92
+ indent = "\t"
93
+ line_length = 140
94
+ lines_after_imports = 1
95
+ lines_between_types = 0
96
+ multi_line_output = 4
97
+ no_sections = true
98
+ overwrite_in_place = true
99
+ use_parentheses = true
100
+ # === OK_EDIT: path-sync hunterhogan ===
101
+
102
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
103
+ [tool.pyrefly]
104
+ preset = "strict"
105
+ enabled-ignores = ["pyrefly"]
106
+ infer-with-first-use = false
107
+ project-excludes = ["typings", "typings/**/*", "**/node_modules", "**/__pycache__", "**/.*", ".v*"]
108
+ site-packages-path = ["./typings"]
109
+ # === OK_EDIT: path-sync hunterhogan ===
110
+
111
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
112
+ [tool.pyrefly.errors]
113
+ bad-return = "warn"
114
+ invalid-type-var = "warn"
115
+ invalid-yield = "warn"
116
+ protected-access = "warn"
117
+ redundant-condition = "warn"
118
+ # === OK_EDIT: path-sync hunterhogan ===
119
+
120
+ [tool.pytest]
121
+ addopts = ["--color=auto", "-n 4"]
122
+ log_auto_indent = "On"
123
+ testpaths = ["tests"]
124
+
125
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
126
+ [tool.ruff]
127
+ line-length = 140
128
+ # === OK_EDIT: path-sync hunterhogan ===
129
+
130
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
131
+ [tool.ruff.lint]
132
+ allowed-confusables = ["–", "’", "′", "×", "−", "∖", "∗", "∣", "∨", "∪", "∼", "⊗", "ℂ", "ℋ", "ℒ", "ℓ", "ℕ", "ℙ", "ℚ", "ℝ", "ℤ", "ℰ", "ℱ", "𝒪", "𝒮", "𝔼", "𝕀", "𝟙", "α", "Β", "γ", "ι", "Κ", "ν", "ο", "ρ", "σ"]
133
+ future-annotations = true
134
+ ignore = [
135
+ # ====== Linters ===========
136
+ "FIX", # flake8-fixme
137
+ "I", # isort
138
+ "N", # pep8-naming
139
+ "TD", # flake8-todos
140
+ # ====== complexity ========
141
+ "dict-index-missing-items",
142
+ "explicit-f-string-type-conversion",
143
+ "non-pep695-type-alias",
144
+ "redundant-numeric-union",
145
+ "static-join-to-f-string",
146
+ "unnecessary-literal-dict",
147
+ "useless-import-alias",
148
+ # ====== correctness =======
149
+ "unused-variable",
150
+ # ====== formatting ========
151
+ "bad-quotes-inline-string",
152
+ "blank-lines-after-function-or-class",
153
+ "blank-lines-top-level",
154
+ "docstring-tab-indentation",
155
+ "incorrect-blank-line-after-class",
156
+ "line-too-long",
157
+ "missing-newline-at-end-of-file",
158
+ "missing-trailing-comma",
159
+ "no-space-after-block-comment",
160
+ "tab-indentation",
161
+ "too-many-blank-lines",
162
+ # ====== pedantic ==========
163
+ "any-type",
164
+ "blanket-noqa",
165
+ "docstring-in-stub",
166
+ "docstring-missing-exception",
167
+ "docstring-missing-returns",
168
+ "docstring-missing-yields",
169
+ "if-else-block-instead-of-if-exp",
170
+ "incorrect-section-order",
171
+ "magic-value-comparison",
172
+ "missing-copyright-notice",
173
+ "missing-trailing-period",
174
+ "non-ascii-import-name",
175
+ "non-ascii-name",
176
+ "non-imperative-mood",
177
+ "redefined-loop-name",
178
+ "superfluous-else-continue",
179
+ "superfluous-else-return",
180
+ "too-many-arguments",
181
+ "too-many-branches",
182
+ "too-many-locals",
183
+ "too-many-nested-blocks",
184
+ "too-many-positional-arguments",
185
+ "too-many-public-methods",
186
+ "too-many-statements",
187
+ "typed-argument-default-in-stub",
188
+ "yoda-conditions",
189
+ # ====== restriction =======
190
+ "complex-structure",
191
+ # ====== security ==========
192
+ "subprocess-without-shell-equals-true",
193
+ "suspicious-pickle-import",
194
+ # ====== style =============
195
+ "snake-case-type-alias",
196
+ "type-name-incorrect-variance",
197
+ # ====== suspicious ========
198
+ "self-or-cls-assignment",
199
+ "subclass-builtin",
200
+ "unused-import",
201
+ "useless-else-on-loop",
202
+ ]
203
+ preview = true
204
+ select = ["ALL"]
205
+ extend-select = ["missing-terminal-punctuation", "undocumented-param", "undocumented-public-init"]
206
+ task-tags = ["DEVELOPMENT", "FailEarly", "NOTE", "SEMIOTICS", "TODO"]
207
+ # === OK_EDIT: path-sync hunterhogan ===
208
+
209
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
210
+ [tool.ruff.lint.flake8-comprehensions]
211
+ allow-dict-calls-with-keyword-arguments = true
212
+ # === OK_EDIT: path-sync hunterhogan ===
213
+
214
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
215
+ [tool.ruff.lint.flake8-import-conventions]
216
+ banned-aliases = { altair = ["alt"], datetime = ["dt"], holoviews = ["hv"], matplotlib = ["mpl"], "matplotlib.pyplot" = ["plt"], networkx = ["nx"], numpy = ["np"], "numpy.typing" = ["npt"], optype = ["op"], pandas = ["pd"], panel = ["pn"], "plotly.express" = ["px"], polars = ["pl"], pyarrow = ["pa"], regex = ["re"], seaborn = ["sns"], tensorflow = ["tf"], tkinter = ["tk"], "xml.etree.ElementTree" = ["ET"] }
217
+ # === OK_EDIT: path-sync hunterhogan ===
218
+
219
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
220
+ [tool.ruff.lint.flake8-import-conventions.aliases]
221
+ "accelerate.utils.dataclasses" = "accelerate_dataclasses"
222
+ "fs.path" = "fs_path"
223
+ "gmpy2.bit_test" = "isBit1吗"
224
+ "gmpy2.is_even" = "isEven吗"
225
+ "gmpy2.is_odd" = "isOdd吗"
226
+ "humpy_cytoolz.assoc" = "associateKeyValue"
227
+ "humpy_cytoolz.curry" = "syntacticCurry"
228
+ "humpy_cytoolz.groupby" = "toolz_groupby"
229
+ "itertools.product" = "CartesianProduct"
230
+ "math.comb" = "nCr"
231
+ "more_itertools.all_unique" = "allUnique吗"
232
+ "regex" = "regex"
233
+ "scipy" = "scipy"
234
+ "sympy.binomial" = "sympy_binomial"
235
+ "sympy.catalan" = "sympy_catalan"
236
+ "sympy.functions.combinatorial.factorials.binomial" = "sympy_binomial"
237
+ "sympy.functions.combinatorial.numbers.catalan" = "sympy_catalan"
238
+ "sympy" = "sympy"
239
+ "torch.autograd.grad" = "torch_grad"
240
+ "torch.nn.functional" = "F"
241
+ "torch.nn.parallel.DistributedDataParallel" = "DDP"
242
+ numpy = "numpy"
243
+ pandas = "pandas"
244
+ polars = "polars"
245
+ re = "regex"
246
+ # === OK_EDIT: path-sync hunterhogan ===
247
+
248
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
249
+ [tool.ruff.lint.flake8-quotes]
250
+ inline-quotes = "single"
251
+ # === OK_EDIT: path-sync hunterhogan ===
252
+
253
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
254
+ [tool.ruff.lint.per-file-ignores]
255
+ "*test*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
256
+ # === OK_EDIT: path-sync hunterhogan ===
257
+
258
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
259
+ [tool.ruff.lint.pydocstyle]
260
+ convention = "numpy"
261
+ # === OK_EDIT: path-sync hunterhogan ===
262
+
263
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
264
+ [tool.ruff.format]
265
+ docstring-code-format = true
266
+ quote-style = "single"
267
+ indent-style = "tab"
268
+ skip-magic-trailing-comma = true
269
+ # === OK_EDIT: path-sync hunterhogan ===
270
+
271
+ [tool.setuptools]
272
+ package-data = { "*" = ["py.typed"] }
273
+ packages = { find = { include = ["updateCitation", "updateCitation.*"] } }
274
+
275
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
276
+ [tool.tombi.format.rules]
277
+ line-ending = "lf"
278
+ # === OK_EDIT: path-sync hunterhogan ===
279
+
280
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
281
+ [tool.ty.analysis]
282
+ respect-type-ignore-comments = false
283
+ # === OK_EDIT: path-sync hunterhogan ===
284
+
285
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
286
+ [tool.ty.environment]
287
+ extra-paths = ["./typings"]
288
+ python-platform = "all"
289
+ # === OK_EDIT: path-sync hunterhogan ===
290
+
291
+ [tool.updateCitation]
292
+ filenameCitationDOTcff = "CITATION.cff"
293
+ pathFilenameCitationSSOT = "citations/CITATION.cff"
@@ -46,6 +46,13 @@ def pathFilenameTmpTesting(request: pytest.FixtureRequest, tmp_path: Path) -> Pa
46
46
  pathFilenameTmp.parent.mkdir(parents=True, exist_ok=False)
47
47
  return pathFilenameTmp
48
48
 
49
+ @pytest.fixture
50
+ def pathWorkingDirectory(request: pytest.FixtureRequest, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
51
+ """Return the working directory, whose only file is a `pyproject.toml` holding `request.param`."""
52
+ (tmp_path / filename_pyprojectDOTtomlDEFAULT).write_text(request.param, encoding="utf-8")
53
+ monkeypatch.chdir(tmp_path)
54
+ return tmp_path
55
+
49
56
  @pytest.fixture
50
57
  def nexusCitationTesting(request: pytest.FixtureRequest) -> CitationNexus:
51
58
  """Return a CitationNexus object with the specified attributes.""" # noqa: DOC201
@@ -0,0 +1,38 @@
1
+ cff-version: 1.2.0
2
+ message: If you use this software, you can cite it using the metadata from this file.
3
+ abstract: Algorithm(s) for counting distinct ways to fold a map (or a strip of stamps).
4
+ This repository, mapFolding, explores the mathematical and algorithmic challenges
5
+ of efficiently modeling, simulating, and solving problems related to folding maps.
6
+ The project implements innovative computational approaches to the geometry and combinatorics
7
+ of map folding, with applications to both theoretical mathematics and real-world
8
+ challenges in optimization and design. The repository includes detailed notes on
9
+ the problem space, comprehensive documentation of the implemented algorithms, and
10
+ resources for further research and experimentation.
11
+ authors:
12
+ - given-names: Hunter
13
+ family-names: Hogan
14
+ email: HunterHogan@pm.me
15
+ date-released: '2025-02-07'
16
+ identifiers:
17
+ - type: url
18
+ value: https://github.com/hunterhogan/mapFolding/releases/tag/0.3.9
19
+ description: The URL for mapFolding 0.3.9.
20
+ keywords:
21
+ - A001415
22
+ - A001416
23
+ - A001417
24
+ - A001418
25
+ - A195646
26
+ - folding
27
+ - map folding
28
+ - OEIS
29
+ - stamp folding
30
+ license: CC-BY-NC-4.0
31
+ repository: https://github.com/hunterhogan/mapFolding.git
32
+ repository-artifact: https://pypi.org/project/mapfolding/0.3.9/
33
+ repository-code: https://github.com/hunterhogan/mapFolding/releases/tag/0.3.9
34
+ commit: 0d70eb67ffbab9563208ec06294887fb7fa6768a
35
+ title: mapFolding
36
+ type: software
37
+ url: https://github.com/hunterhogan/mapFolding
38
+ version: 0.3.9
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "updateCitation"
3
- version = "0.2.1"
3
+ version = "0.0.10"
4
4
  description = "Automatically update citation files (CITATION.cff) in a GitHub repository from `pyproject.toml`, GitHub releases, and PyPI releases."
5
5
  readme = { file = "README.md", content-type = "text/markdown" }
6
6
  requires-python = ">=3.10"
@@ -34,7 +34,9 @@ classifiers = [
34
34
  "Programming Language :: Python",
35
35
  "Programming Language :: Python :: 3",
36
36
  "Programming Language :: Python :: 3.10",
37
- "Programming Language :: Python :: 3.15",
37
+ "Programming Language :: Python :: 3.11",
38
+ "Programming Language :: Python :: 3.12",
39
+ "Programming Language :: Python :: 3.13",
38
40
  "Topic :: Scientific/Engineering",
39
41
  "Topic :: Software Development :: Documentation",
40
42
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -43,17 +45,17 @@ classifiers = [
43
45
  "Typing :: Typed",
44
46
  ]
45
47
  urls = { Donate = "https://www.patreon.com/integrated", Homepage = "https://github.com/hunterhogan/updateCitation", Repository = "https://github.com/hunterhogan/updateCitation.git" }
46
- scripts = { updateCitation = "updateCitation.flowControl:here" }
47
48
  dependencies = [
48
49
  "attrs",
49
50
  "cffconvert",
50
51
  "packaging",
51
52
  "pygithub",
52
53
  "ruamel.yaml",
53
- "tomli",
54
- "typing_extensions>= 4.0.0",
55
54
  ]
56
- optional-dependencies = { testing = [
55
+ optional-dependencies = { development = [
56
+ "mypy",
57
+ "pyupgrade",
58
+ ], testing = [
57
59
  "pytest",
58
60
  "pytest-cov",
59
61
  "pytest-xdist",
@@ -78,13 +80,13 @@ run = { branch = true, concurrency = [
78
80
  xml = { output = "tests/coverage/coverage.xml" }
79
81
 
80
82
  [tool.pytest]
81
- addopts = ["--color=auto", "-n 4"]
83
+ addopts = ["--color=auto", "-n 6"]
82
84
  log_auto_indent = "On"
83
85
  testpaths = ["tests"]
84
86
 
85
87
  [tool.setuptools]
86
88
  package-data = { "*" = ["py.typed"] }
87
- packages = { find = {} }
89
+ packages = { find = { } }
88
90
 
89
91
  [tool.updateCitation]
90
92
  filenameCitationDOTcff = "CITATION.cff"
@@ -1,3 +1,37 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+ from updateCitation import here
5
+ import pytest
6
+
7
+ if TYPE_CHECKING:
8
+ from pathlib import Path
9
+
10
+ @pytest.mark.parametrize(("pathWorkingDirectory", "expected"), [
11
+ pytest.param(
12
+ (pyprojectOffline := '[project]\nname = "packageAlpha"\nversion = "0.1.0"\nauthors = [{name = "Ada Lovelace"}]\n\n'
13
+ '[tool.updateCitation]\naddGitHubRelease = false\naddPyPIrelease = false\ngitAmendFromGitHubAction = false\n'
14
+ 'gitUserEmail = "test@example.com"\n')
15
+ , ("CITATION.cff", "pyproject.toml")
16
+ , id="settingsDefault"),
17
+ pytest.param(
18
+ pyprojectOffline + 'pathFilenameCitationSSOT = "citations/CITATION.cff"\n'
19
+ , ("CITATION.cff", "citations", "citations/CITATION.cff", "pyproject.toml")
20
+ , id="citationSSOTSubdirectory"),
21
+ pytest.param(
22
+ pyprojectOffline + 'filenameCitationDOTcff = "OTHER.cff"\n'
23
+ , ("OTHER.cff", "pyproject.toml")
24
+ , id="filenameCitationOther"),
25
+ ], indirect=["pathWorkingDirectory"])
26
+ def test_here(pathWorkingDirectory: Path, expected: tuple[str, ...]) -> None:
27
+ """Expected file state comes from the README's `[tool.updateCitation]` table.
28
+
29
+ `pathFilenameCitationSSOT` names the authoritative citation file, `filenameCitationDOTcff` names the repository-root
30
+ citation file, and `here` writes both, starting from a repository that has neither.
31
+ """
32
+ here()
33
+ assert {*pathWorkingDirectory.rglob("*")} == {*map(pathWorkingDirectory.joinpath, expected)}
34
+
1
35
  # import os
2
36
  # from updateCitation import flowControl
3
37
  # import pathlib
@@ -154,6 +154,7 @@ def getPyPAMetadata(packageData: dict[str, Any]) -> PyPAMetadata:
154
154
  metadataRaw = packaging.metadata.RawMetadata(
155
155
  keywords=packageData.get("keywords", []),
156
156
  license_expression=licenseExpression,
157
+ # TODO This looks like a hardcoded value.
157
158
  metadata_version="2.4",
158
159
  # NOTE packaging.metadata.InvalidMetadata: 'name' is a required field
159
160
  name=packaging.utils.canonicalize_name(packageData["name"], validate=True),
@@ -65,6 +65,7 @@ from __future__ import annotations
65
65
 
66
66
  from typing import Any, Literal, TypedDict
67
67
  import attrs
68
+ import operator
68
69
  import pathlib
69
70
  import warnings
70
71
 
@@ -130,19 +131,19 @@ class SettingsPackage:
130
131
  The root directory of the repository.
131
132
  filename_pyprojectDOTtoml : str = 'pyproject.toml'
132
133
  The filename of the `pyproject.toml` configuration file.
133
- pathFilenamePackageSSOT : pathlib.Path
134
+ pathFilenamePackageSSOT : pathlib.Path = Path(pathRepository, filename_pyprojectDOTtoml)
134
135
  The full path to the `pyproject.toml` file.
135
136
  filenameCitationDOTcff : str = 'CITATION.cff'
136
137
  The filename of the CITATION.cff file.
137
- pathFilenameCitationDOTcffRepository : pathlib.Path
138
+ pathFilenameCitationDOTcffRepository : pathlib.Path = Path(filenameCitationDOTcff)
138
139
  The full path to the CITATION.cff file in the repository root.
139
- pathFilenameCitationSSOT : pathlib.Path
140
+ pathFilenameCitationSSOT : pathlib.Path = pathFilenameCitationDOTcffRepository
140
141
  The full path to the authoritative CITATION.cff file.
141
142
  addGitHubRelease : bool = True
142
143
  Whether to include GitHub release metadata.
143
144
  addPyPIrelease : bool = True
144
145
  Whether to include PyPI release metadata.
145
- pathReferences : pathlib.Path
146
+ pathReferences : pathlib.Path = Path(pathRepository, 'citations')
146
147
  The directory path for reference citation file.
147
148
  projectURLTargets : set[str] = {'homepage', 'license', 'repository'}
148
149
  The set of PyPA project URL key name to extract.
@@ -173,18 +174,34 @@ class SettingsPackage:
173
174
  https://packaging.python.org/en/latest/specifications/pyproject-toml/
174
175
 
175
176
  """
176
- pathRepository: pathlib.Path = pathlib.Path.cwd()
177
+ pathRepository: pathlib.Path = attrs.field(default=pathlib.Path.cwd(), converter=pathlib.Path)
177
178
  filename_pyprojectDOTtoml: str = filename_pyprojectDOTtomlDEFAULT
178
- pathFilenamePackageSSOT: pathlib.Path = pathlib.Path(pathRepository, filename_pyprojectDOTtoml)
179
+
180
+ def _makePathFilenamePackageSSOT(self) -> pathlib.Path:
181
+ return pathlib.Path(self.pathRepository, self.filename_pyprojectDOTtoml)
182
+
183
+ pathFilenamePackageSSOT: pathlib.Path = attrs.field(
184
+ default=attrs.Factory(_makePathFilenamePackageSSOT, takes_self=True), converter=pathlib.Path)
179
185
 
180
186
  filenameCitationDOTcff: str = 'CITATION.cff'
181
- pathFilenameCitationDOTcffRepository: pathlib.Path = pathlib.Path('.', filenameCitationDOTcff)
182
- pathFilenameCitationSSOT: pathlib.Path = pathlib.Path(pathFilenameCitationDOTcffRepository)
187
+
188
+ def _makePathFilenameCitationDOTcffRepository(self) -> pathlib.Path:
189
+ return pathlib.Path(self.filenameCitationDOTcff)
190
+
191
+ pathFilenameCitationDOTcffRepository: pathlib.Path = attrs.field(
192
+ default=attrs.Factory(_makePathFilenameCitationDOTcffRepository, takes_self=True), converter=pathlib.Path)
193
+
194
+ pathFilenameCitationSSOT: pathlib.Path = attrs.field(
195
+ default=attrs.Factory(operator.attrgetter('pathFilenameCitationDOTcffRepository'), takes_self=True), converter=pathlib.Path)
183
196
 
184
197
  addGitHubRelease: bool = True
185
198
  addPyPIrelease: bool = True
186
199
 
187
- pathReferences: pathlib.Path = pathlib.Path(pathRepository, 'citations')
200
+ def _makePathReferences(self) -> pathlib.Path:
201
+ return pathlib.Path(self.pathRepository, 'citations')
202
+
203
+ pathReferences: pathlib.Path = attrs.field(default=attrs.Factory(_makePathReferences, takes_self=True), converter=pathlib.Path)
204
+
188
205
  projectURLTargets: set[str] = {"homepage", "license", "repository"}
189
206
 
190
207
  gitCommitMessage: str = "Update citations [skip ci]"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: updateCitation
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Automatically update citation files (CITATION.cff) in a GitHub repository from `pyproject.toml`, GitHub releases, and PyPI releases.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License-Expression: CC-BY-NC-4.0
@@ -36,12 +36,9 @@ Requires-Dist: pygithub
36
36
  Requires-Dist: ruamel.yaml
37
37
  Requires-Dist: tomli
38
38
  Requires-Dist: typing_extensions>=4.0.0
39
- Provides-Extra: testing
40
- Requires-Dist: pytest; extra == "testing"
41
- Requires-Dist: pytest-cov; extra == "testing"
42
- Requires-Dist: pytest-xdist; extra == "testing"
43
39
  Dynamic: license-file
44
40
 
41
+ <!-- path-sync copy -n hunterhogan -->
45
42
  # updateCitation
46
43
 
47
44
  Automatically update `CITATION.cff` from your Python project's `pyproject.toml`, GitHub release data when enabled, and PyPI release data when enabled.
@@ -303,6 +300,13 @@ addPyPIrelease = false
303
300
 
304
301
  Contributions are welcome. Please feel free to submit pull requests.
305
302
 
303
+ To run the tests, install `updateCitation` in editable mode with the `testing` [dependency group](https://packaging.python.org/en/latest/specifications/dependency-groups/) (this needs `pip` 25.1 or newer), then run `pytest` from the repository root:
304
+
305
+ ```bash
306
+ pip install -e . --group testing
307
+ pytest
308
+ ```
309
+
306
310
  ## Design Goals
307
311
 
308
312
  1. 100% Python.
@@ -311,14 +315,15 @@ Contributions are welcome. Please feel free to submit pull requests.
311
315
  4. All settings for external services, such as GitHub and PyPI, use the configuration from those services instead of creating new configuration for `updateCitation`.
312
316
  5. Highly extensible for current and future services.
313
317
 
314
- ## My Recovery
315
-
316
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
318
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
319
+ ## My recovery
317
320
 
318
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/updateCitation/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
321
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
322
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
319
323
 
320
- By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/updateCitation#License-1-ov-file) outlines how you may use this work.
324
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
321
325
 
322
326
  The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
323
327
 
324
328
  To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
329
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -1,4 +1,5 @@
1
1
  LICENSE
2
+ MANIFEST.in
2
3
  README.md
3
4
  pyproject.toml
4
5
  tests/__init__.py
@@ -9,6 +10,8 @@ tests/test_github.py
9
10
  tests/test_pypa.py
10
11
  tests/test_pypi.py
11
12
  tests/test_variables.py
13
+ tests/dataSamples/citationAlpha.cff
14
+ tests/dataSamples/pyproject.toml
12
15
  updateCitation/__init__.py
13
16
  updateCitation/_semiotics.py
14
17
  updateCitation/_theTypes.py
@@ -5,8 +5,3 @@ pygithub
5
5
  ruamel.yaml
6
6
  tomli
7
7
  typing_extensions>=4.0.0
8
-
9
- [testing]
10
- pytest
11
- pytest-cov
12
- pytest-xdist
@@ -0,0 +1 @@
1
+ updateCitation
@@ -1,4 +0,0 @@
1
- citations
2
- dist
3
- tests
4
- updateCitation
File without changes
File without changes