citesync 0.4.0__tar.gz → 0.6.0__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 (36) hide show
  1. {citesync-0.4.0 → citesync-0.6.0}/PKG-INFO +39 -24
  2. citesync-0.6.0/README.md +113 -0
  3. {citesync-0.4.0 → citesync-0.6.0}/pyproject.toml +53 -12
  4. {citesync-0.4.0 → citesync-0.6.0}/pyproject.toml.orig +70 -30
  5. citesync-0.6.0/src/citesync/MAPPING_SOURCE +7 -0
  6. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/__main__.py +2 -4
  7. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/check.py +153 -16
  8. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/cli.py +93 -42
  9. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/codecs.py +24 -4
  10. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/config.py +119 -18
  11. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/core_metadata.py +60 -39
  12. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/errors.py +11 -1
  13. citesync-0.6.0/src/citesync/export.py +539 -0
  14. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/formats.py +285 -40
  15. citesync-0.6.0/src/citesync/mapping-4.0.json +5363 -0
  16. citesync-0.6.0/src/citesync/mapping-local.json +5085 -0
  17. citesync-0.6.0/src/citesync/mapping-vectors.json +1358 -0
  18. citesync-0.6.0/src/citesync/mapping.py +202 -0
  19. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/mapping.schema.json +10 -4
  20. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/playground.py +4 -4
  21. citesync-0.6.0/src/citesync/playground_exports.py +258 -0
  22. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/positions.py +12 -3
  23. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/research_metadata.py +51 -61
  24. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/rules.py +53 -8
  25. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/write.py +85 -36
  26. citesync-0.4.0/README.md +0 -98
  27. citesync-0.4.0/src/citesync/MAPPING_SOURCE +0 -5
  28. citesync-0.4.0/src/citesync/export.py +0 -272
  29. citesync-0.4.0/src/citesync/mapping-local.json +0 -1219
  30. citesync-0.4.0/src/citesync/mapping.py +0 -142
  31. citesync-0.4.0/src/citesync/playground_exports.py +0 -89
  32. {citesync-0.4.0 → citesync-0.6.0}/LICENSE +0 -0
  33. {citesync-0.4.0 → citesync-0.6.0}/NOTICE +0 -0
  34. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/__init__.py +0 -0
  35. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/jsonsplice.py +0 -0
  36. {citesync-0.4.0 → citesync-0.6.0}/src/citesync/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: citesync
3
- Version: 0.4.0
3
+ Version: 0.6.0
4
4
  Summary: Generate and synchronize software citation files from package metadata. CLI, pre-commit hook and browser playground.
5
5
  Keywords: citation,CITATION.cff,codemeta,zenodo,software-metadata,pre-commit
6
6
  Author: Simon van Lierde
@@ -13,7 +13,6 @@ Classifier: Environment :: Console
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Intended Audience :: Science/Research
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
19
18
  Classifier: Topic :: Software Development :: Quality Assurance
@@ -21,11 +20,12 @@ Classifier: Typing :: Typed
21
20
  Requires-Dist: packaging>=26.3
22
21
  Requires-Dist: ruamel-yaml>=0.19
23
22
  Requires-Dist: tomlkit>=0.15.2
24
- Requires-Python: >=3.12
23
+ Requires-Python: >=3.13
25
24
  Project-URL: Homepage, https://simonvanlierde.com/citesync/
25
+ Project-URL: Documentation, https://simonvanlierde.com/citesync/docs/
26
26
  Project-URL: Source, https://github.com/simonvanlierde/citesync
27
27
  Project-URL: Issues, https://github.com/simonvanlierde/citesync/issues
28
- Project-URL: Changelog, https://github.com/simonvanlierde/citesync/blob/main/CHANGELOG.md
28
+ Project-URL: Changelog, https://simonvanlierde.com/citesync/docs/changelog/
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  # citesync
@@ -34,27 +34,28 @@ Description-Content-Type: text/markdown
34
34
  [![PyPI](https://img.shields.io/pypi/v/citesync)](https://pypi.org/project/citesync/)
35
35
  [![Python versions](https://img.shields.io/pypi/pyversions/citesync)](https://pypi.org/project/citesync/)
36
36
  [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/simonvanlierde/citesync/badge)](https://scorecard.dev/viewer/?uri=github.com/simonvanlierde/citesync)
37
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/16151/badge)](https://www.bestpractices.dev/projects/16151)
37
38
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/simonvanlierde/citesync/blob/main/LICENSE)
38
39
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23779706.svg)](https://doi.org/10.5281/zenodo.23779706)
39
40
 
40
41
  Status: experimental. It may change in ways that break your code, without notice.
41
42
 
42
- Questions and bugs: see [CONTRIBUTING.md](https://github.com/simonvanlierde/citesync/blob/main/.github/CONTRIBUTING.md).
43
+ Questions and bugs: see [contributing guide](.github/CONTRIBUTING.md).
43
44
 
44
45
  Generate software citation files from package metadata, then keep them in sync across CITATION.cff, codemeta.json, .zenodo.json and package manifests, including [Typst and Quarto plugin manifests](docs/formats.md#plugin-manifests). Use the CLI, a pre-commit hook or the [browser playground](https://simonvanlierde.com/citesync/). Field mappings come from CodeMeta's crosswalks, as exported by [codemeta-drift](https://github.com/simonvanlierde/codemeta-drift).
45
46
 
46
47
  ## Usage
47
48
 
48
- citesync compares eleven fields, from title to release date, with one file: the source. The source is CITATION.cff unless you pick another with `--source`. With neither, citesync exits 2. Use citesync through its command line and the pre-commit hook. Its Python modules are internal and may change in any release.
49
+ citesync compares eleven fields, from title to release date, with one file: the source. The source is CITATION.cff unless you pick another with `--source`. With neither, citesync exits 3. Use citesync through its command line and the pre-commit hook. Its Python modules are internal and may change in any release.
49
50
 
50
51
  ```sh
51
52
  uv tool install citesync # or run it once with uvx citesync check
52
- citesync check # exit 0: no error finding; 1: an error finding; 2: citesync couldn't run
53
+ citesync check # exit 0: no error finding; 1: an error finding; 2: usage error; 3: couldn't run
53
54
  citesync check --source pyproject.toml
54
55
  citesync write --diff # print what write would change, and change nothing
55
56
  citesync write # rewrite the other files to agree with the source
56
57
  citesync init # write a CITATION.cff from codemeta.json, .zenodo.json and the manifests
57
- citesync export --format apa # print a citation: apa, bibtex, csl-json, jsonld, cff, codemeta or zenodo
58
+ citesync export --format apa # print a citation: apa, bibtex, csl-json, jsonld, datacite, ris, endnote, cff, codemeta or zenodo
58
59
  citesync explain version-mismatch # what a rule checks and how to fix it
59
60
  citesync config # the config in use, and the file it came from
60
61
  ```
@@ -68,22 +69,22 @@ codemeta.json:3:3: error[version-mismatch] version: '2.0.0', CITATION.cff has '1
68
69
 
69
70
  A config is optional. A one-line `citesync.toml` is `ignore = ["description-mismatch"]`.
70
71
 
71
- `citesync --help` lists every command and option. The reference is in `docs/`:
72
+ `citesync --help` lists every command and option. Read the [documentation](https://simonvanlierde.com/citesync/docs/):
72
73
 
73
- - [How check works](https://github.com/simonvanlierde/citesync/blob/main/docs/check.md): the fields, files, options and exit codes.
74
- - [How write works](https://github.com/simonvanlierde/citesync/blob/main/docs/write.md): what it changes and what it leaves alone.
75
- - [Supported files](https://github.com/simonvanlierde/citesync/blob/main/docs/formats.md): which files citesync reads, updates and creates, including read-only Python distribution, R and Julia metadata.
76
- - [How init works](https://github.com/simonvanlierde/citesync/blob/main/docs/init.md): where a new CITATION.cff takes each field from.
77
- - [Citation exports](https://github.com/simonvanlierde/citesync/blob/main/docs/export.md): BibTeX, CSL-JSON, APA and schema.org JSON-LD files kept in step with the source.
78
- - [Rules](https://github.com/simonvanlierde/citesync/blob/main/docs/rules.md): each rule id, what it checks and how to fix it.
79
- - [Configuration](https://github.com/simonvanlierde/citesync/blob/main/docs/config.md): where config goes, and every key.
80
- - [Use citation exports with Pandoc](https://github.com/simonvanlierde/citesync/blob/main/docs/pandoc.md): cite software from the CSL-JSON or BibTeX files `citesync export` or the playground makes.
81
- - [Output formats](https://github.com/simonvanlierde/citesync/blob/main/docs/output.md): JSON, GitHub annotations and SARIF.
82
- - [Tested on real repositories](https://github.com/simonvanlierde/citesync/blob/main/docs/tested-repositories.md): what citesync reports on five public repositories.
74
+ - [How check works](https://simonvanlierde.com/citesync/docs/check/): the fields, files, options and exit codes.
75
+ - [How write works](https://simonvanlierde.com/citesync/docs/write/): what it changes and what it leaves alone.
76
+ - [Supported files](https://simonvanlierde.com/citesync/docs/formats/): which files citesync reads, updates and creates, including read-only Python distribution, R and Julia metadata, and the RO-Crate and Croissant files sourceledger makes.
77
+ - [How init works](https://simonvanlierde.com/citesync/docs/init/): where a new CITATION.cff takes each field from.
78
+ - [Citation exports](https://simonvanlierde.com/citesync/docs/export/): BibTeX, CSL-JSON, APA, schema.org JSON-LD, DataCite XML, RIS and EndNote files kept in step with the source.
79
+ - [Rules](https://simonvanlierde.com/citesync/docs/rules/): each rule id, what it checks and how to fix it.
80
+ - [Configuration](https://simonvanlierde.com/citesync/docs/config/): where config goes, and every key.
81
+ - [Use citation exports with Pandoc](https://simonvanlierde.com/citesync/docs/pandoc/): cite software from the CSL-JSON or BibTeX files `citesync export` or the playground makes.
82
+ - [Output formats](https://simonvanlierde.com/citesync/docs/output/): JSON, GitHub annotations and SARIF.
83
+ - [Tested on real repositories](https://simonvanlierde.com/citesync/docs/tested-repositories/): what citesync reports on five public repositories.
83
84
 
84
85
  ## Browser playground
85
86
 
86
- Generate citation files from existing metadata or basic project details, without installing Python. [Open the playground](https://simonvanlierde.com/citesync/) or [run it locally](https://github.com/simonvanlierde/citesync/blob/main/playground/README.md). Files are processed in the browser; downloading the converter requires a network connection.
87
+ Generate citation files from existing metadata or basic project details, without installing Python. [Open the playground](https://simonvanlierde.com/citesync/) or [read the playground guide](playground/README.md). Files are processed in the browser; downloading the converter requires a network connection.
87
88
 
88
89
  ## Pre-commit hook
89
90
 
@@ -92,13 +93,27 @@ For [prek](https://prek.j178.dev) or [pre-commit](https://pre-commit.com), in `.
92
93
  ```yaml
93
94
  repos:
94
95
  - repo: https://github.com/simonvanlierde/citesync
95
- rev: v0.4.0
96
+ rev: v0.6.0
96
97
  hooks:
97
98
  - id: citesync
98
99
  - id: citesync-write
99
100
  ```
100
101
 
101
- The `citesync` hook runs when a commit changes a supported metadata file, a citesync config or a file with an export suffix (`.bib`, `.csl.json`, `.apa.txt`, `.jsonld`), at any depth. It checks every file, not only the staged ones, and fails the commit on an error finding. The `citesync-write` hook runs only when you ask for it: `prek run citesync-write --stage manual --all-files`.
102
+ The `citesync` hook runs when a commit changes a supported metadata file, a citesync config or a file with an export suffix (`.bib`, `.csl.json`, `.apa.txt`, `.jsonld`, `.datacite.xml`, `.ris`, `.enw`), at any depth. It checks every file, not only the staged ones, and fails the commit on an error finding (exit 1) or when citesync can't run (exit 3), such as on a bad config. The [exit codes](https://simonvanlierde.com/citesync/docs/check/#findings-and-exit-codes) are the same as on the command line. The `citesync-write` hook runs only when you ask for it: `prek run citesync-write --stage manual --all-files`. Both hooks need Python 3.13 or newer.
103
+
104
+ For a dataset file with a custom name, set `always_run: true` on each citesync hook. This checks all configured paths on every commit or manual run, even when the default filename filter would skip the changed file.
105
+
106
+ ## Social card
107
+
108
+ [`playground/og.png`](playground/og.png) is the 1200x630 card shown when the link is shared. It is rendered from
109
+ [`docs/og-card.html`](docs/og-card.html), whose example is `tests/fixtures/synthetic-agree/pyproject.toml` run through `citesync init`. Edit the HTML, then from the repo root:
110
+
111
+ ```sh
112
+ pnpm exec playwright screenshot --browser=chromium --viewport-size=1200,630 \
113
+ file://$PWD/docs/og-card.html playground/og.png
114
+ ```
115
+
116
+ `playground/build.py` copies the card into the built site and adds its hash to the image URL. The playground and every documentation page include sharing tags.
102
117
 
103
118
  ## Development
104
119
 
@@ -119,9 +134,9 @@ just fmt # apply each stack's fixes and formatting
119
134
  just hooks # the git hooks, as the checks workflow runs them
120
135
  ```
121
136
 
122
- `just mutation` mutation-tests the modules `only_mutate` lists under `[tool.mutmut]` in `pyproject.toml`. CI doesn't run it. It fails when the tests miss a change that `tests/mutation-baseline.txt` doesn't list. A change that can't alter behaviour goes in that file, with the reason. It also fails when the tests now catch a listed change, so drop that line.
137
+ `just mutation` mutation-tests the modules `only_mutate` lists under `[tool.mutmut]` in `pyproject.toml`. CI runs it weekly, on Mondays ([`mutation.yml`](.github/workflows/mutation.yml)). It fails when the tests miss a change that `tests/mutation-baseline.txt` doesn't list. A change that can't alter behaviour goes in that file, with the reason. It also fails when the tests now catch a listed change, so drop that line.
123
138
 
124
- uv locks only releases at least a week old. If `just check` fails on a newer security fix, add the package to `exclude-newer-package` under `[tool.uv]` in `pyproject.toml`, and remove it a week later ([how](https://github.com/simonvanlierde/project-templates/blob/main/docs/tooling.md#dependencies)).
139
+ uv locks only releases at least a week old. For a newer security fix, pin the source archive at an exact commit, then return to the registry version after a week ([how](https://github.com/simonvanlierde/project-templates/blob/main/docs/tooling.md#dependencies)).
125
140
 
126
141
  ## Licence
127
142
 
@@ -0,0 +1,113 @@
1
+ # citesync
2
+
3
+ [![python](https://github.com/simonvanlierde/citesync/actions/workflows/python.yml/badge.svg)](https://github.com/simonvanlierde/citesync/actions/workflows/python.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/citesync)](https://pypi.org/project/citesync/)
5
+ [![Python versions](https://img.shields.io/pypi/pyversions/citesync)](https://pypi.org/project/citesync/)
6
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/simonvanlierde/citesync/badge)](https://scorecard.dev/viewer/?uri=github.com/simonvanlierde/citesync)
7
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/16151/badge)](https://www.bestpractices.dev/projects/16151)
8
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/simonvanlierde/citesync/blob/main/LICENSE)
9
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23779706.svg)](https://doi.org/10.5281/zenodo.23779706)
10
+
11
+ Status: experimental. It may change in ways that break your code, without notice.
12
+
13
+ Questions and bugs: see [contributing guide](.github/CONTRIBUTING.md).
14
+
15
+ Generate software citation files from package metadata, then keep them in sync across CITATION.cff, codemeta.json, .zenodo.json and package manifests, including [Typst and Quarto plugin manifests](docs/formats.md#plugin-manifests). Use the CLI, a pre-commit hook or the [browser playground](https://simonvanlierde.com/citesync/). Field mappings come from CodeMeta's crosswalks, as exported by [codemeta-drift](https://github.com/simonvanlierde/codemeta-drift).
16
+
17
+ ## Usage
18
+
19
+ citesync compares eleven fields, from title to release date, with one file: the source. The source is CITATION.cff unless you pick another with `--source`. With neither, citesync exits 3. Use citesync through its command line and the pre-commit hook. Its Python modules are internal and may change in any release.
20
+
21
+ ```sh
22
+ uv tool install citesync # or run it once with uvx citesync check
23
+ citesync check # exit 0: no error finding; 1: an error finding; 2: usage error; 3: couldn't run
24
+ citesync check --source pyproject.toml
25
+ citesync write --diff # print what write would change, and change nothing
26
+ citesync write # rewrite the other files to agree with the source
27
+ citesync init # write a CITATION.cff from codemeta.json, .zenodo.json and the manifests
28
+ citesync export --format apa # print a citation: apa, bibtex, csl-json, jsonld, datacite, ris, endnote, cff, codemeta or zenodo
29
+ citesync explain version-mismatch # what a rule checks and how to fix it
30
+ citesync config # the config in use, and the file it came from
31
+ ```
32
+
33
+ ```text
34
+ codemeta.json:3:3: error[version-mismatch] version: '2.0.0', CITATION.cff has '1.0.0'
35
+ help: Make the file agree with the source, or the other way round if the source is wrong.
36
+ 1 error, 0 warnings in 3 files
37
+ 1 fixable with `citesync write`
38
+ ```
39
+
40
+ A config is optional. A one-line `citesync.toml` is `ignore = ["description-mismatch"]`.
41
+
42
+ `citesync --help` lists every command and option. Read the [documentation](https://simonvanlierde.com/citesync/docs/):
43
+
44
+ - [How check works](https://simonvanlierde.com/citesync/docs/check/): the fields, files, options and exit codes.
45
+ - [How write works](https://simonvanlierde.com/citesync/docs/write/): what it changes and what it leaves alone.
46
+ - [Supported files](https://simonvanlierde.com/citesync/docs/formats/): which files citesync reads, updates and creates, including read-only Python distribution, R and Julia metadata, and the RO-Crate and Croissant files sourceledger makes.
47
+ - [How init works](https://simonvanlierde.com/citesync/docs/init/): where a new CITATION.cff takes each field from.
48
+ - [Citation exports](https://simonvanlierde.com/citesync/docs/export/): BibTeX, CSL-JSON, APA, schema.org JSON-LD, DataCite XML, RIS and EndNote files kept in step with the source.
49
+ - [Rules](https://simonvanlierde.com/citesync/docs/rules/): each rule id, what it checks and how to fix it.
50
+ - [Configuration](https://simonvanlierde.com/citesync/docs/config/): where config goes, and every key.
51
+ - [Use citation exports with Pandoc](https://simonvanlierde.com/citesync/docs/pandoc/): cite software from the CSL-JSON or BibTeX files `citesync export` or the playground makes.
52
+ - [Output formats](https://simonvanlierde.com/citesync/docs/output/): JSON, GitHub annotations and SARIF.
53
+ - [Tested on real repositories](https://simonvanlierde.com/citesync/docs/tested-repositories/): what citesync reports on five public repositories.
54
+
55
+ ## Browser playground
56
+
57
+ Generate citation files from existing metadata or basic project details, without installing Python. [Open the playground](https://simonvanlierde.com/citesync/) or [read the playground guide](playground/README.md). Files are processed in the browser; downloading the converter requires a network connection.
58
+
59
+ ## Pre-commit hook
60
+
61
+ For [prek](https://prek.j178.dev) or [pre-commit](https://pre-commit.com), in `.pre-commit-config.yaml`:
62
+
63
+ ```yaml
64
+ repos:
65
+ - repo: https://github.com/simonvanlierde/citesync
66
+ rev: v0.6.0
67
+ hooks:
68
+ - id: citesync
69
+ - id: citesync-write
70
+ ```
71
+
72
+ The `citesync` hook runs when a commit changes a supported metadata file, a citesync config or a file with an export suffix (`.bib`, `.csl.json`, `.apa.txt`, `.jsonld`, `.datacite.xml`, `.ris`, `.enw`), at any depth. It checks every file, not only the staged ones, and fails the commit on an error finding (exit 1) or when citesync can't run (exit 3), such as on a bad config. The [exit codes](https://simonvanlierde.com/citesync/docs/check/#findings-and-exit-codes) are the same as on the command line. The `citesync-write` hook runs only when you ask for it: `prek run citesync-write --stage manual --all-files`. Both hooks need Python 3.13 or newer.
73
+
74
+ For a dataset file with a custom name, set `always_run: true` on each citesync hook. This checks all configured paths on every commit or manual run, even when the default filename filter would skip the changed file.
75
+
76
+ ## Social card
77
+
78
+ [`playground/og.png`](playground/og.png) is the 1200x630 card shown when the link is shared. It is rendered from
79
+ [`docs/og-card.html`](docs/og-card.html), whose example is `tests/fixtures/synthetic-agree/pyproject.toml` run through `citesync init`. Edit the HTML, then from the repo root:
80
+
81
+ ```sh
82
+ pnpm exec playwright screenshot --browser=chromium --viewport-size=1200,630 \
83
+ file://$PWD/docs/og-card.html playground/og.png
84
+ ```
85
+
86
+ `playground/build.py` copies the card into the built site and adds its hash to the image URL. The playground and every documentation page include sharing tags.
87
+
88
+ ## Development
89
+
90
+ You need [uv](https://docs.astral.sh/uv/), [just](https://just.systems), Node.js 26 and [pnpm](https://pnpm.io/).
91
+
92
+ ```sh
93
+ uv sync
94
+ pnpm install --frozen-lockfile
95
+ uv tool install prek # once per machine
96
+ prek install # git hooks
97
+ ```
98
+
99
+ `just` lists the tasks. They mirror what [.github/workflows/](https://github.com/simonvanlierde/citesync/tree/main/.github/workflows) runs.
100
+
101
+ ```sh
102
+ just check # lint, types and tests for every stack here
103
+ just fmt # apply each stack's fixes and formatting
104
+ just hooks # the git hooks, as the checks workflow runs them
105
+ ```
106
+
107
+ `just mutation` mutation-tests the modules `only_mutate` lists under `[tool.mutmut]` in `pyproject.toml`. CI runs it weekly, on Mondays ([`mutation.yml`](.github/workflows/mutation.yml)). It fails when the tests miss a change that `tests/mutation-baseline.txt` doesn't list. A change that can't alter behaviour goes in that file, with the reason. It also fails when the tests now catch a listed change, so drop that line.
108
+
109
+ uv locks only releases at least a week old. For a newer security fix, pin the source archive at an exact commit, then return to the registry version after a week ([how](https://github.com/simonvanlierde/project-templates/blob/main/docs/tooling.md#dependencies)).
110
+
111
+ ## Licence
112
+
113
+ See [LICENSE](https://github.com/simonvanlierde/citesync/blob/main/LICENSE).
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "citesync"
3
- version = "0.4.0"
3
+ version = "0.6.0"
4
4
  description = "Generate and synchronize software citation files from package metadata. CLI, pre-commit hook and browser playground."
5
5
  readme = "README.md"
6
- requires-python = ">=3.12"
6
+ requires-python = ">=3.13"
7
7
  license = "Apache-2.0"
8
8
  license-files = [
9
9
  "LICENSE",
@@ -23,7 +23,6 @@ classifiers = [
23
23
  "Intended Audience :: Developers",
24
24
  "Intended Audience :: Science/Research",
25
25
  "Programming Language :: Python :: 3",
26
- "Programming Language :: Python :: 3.12",
27
26
  "Programming Language :: Python :: 3.13",
28
27
  "Programming Language :: Python :: 3.14",
29
28
  "Topic :: Software Development :: Quality Assurance",
@@ -40,26 +39,29 @@ name = "Simon van Lierde"
40
39
  email = "code@duinlab.nl"
41
40
 
42
41
  [project.scripts]
43
- citesync = "citesync.cli:main"
42
+ citesync = "citesync.cli:entry"
44
43
 
45
44
  [project.urls]
46
45
  Homepage = "https://simonvanlierde.com/citesync/"
46
+ Documentation = "https://simonvanlierde.com/citesync/docs/"
47
47
  Source = "https://github.com/simonvanlierde/citesync"
48
48
  Issues = "https://github.com/simonvanlierde/citesync/issues"
49
- Changelog = "https://github.com/simonvanlierde/citesync/blob/main/CHANGELOG.md"
49
+ Changelog = "https://simonvanlierde.com/citesync/docs/changelog/"
50
50
 
51
51
  [dependency-groups]
52
52
  dev = [
53
53
  "hypothesis>=6.140",
54
54
  "jsonschema>=4.25",
55
+ "markdown-it-py>=4.2.0",
55
56
  "memray>=1.20.0 ; sys_platform != 'win32'",
56
- "mutmut==3.8.0",
57
+ "mutmut==3.8.1",
57
58
  "pybtex>=0.25",
58
59
  "pyinstrument>=5.1.3",
59
- "pytest>=9.1.1",
60
+ "pytest>=9.2.0",
60
61
  "pytest-cov>=7.1.0",
61
- "ruff>=0.17.1",
62
- "ty>=0.0.89",
62
+ "ruff>=0.17.3",
63
+ "ty>=0.0.93",
64
+ "xmlschema>=4.3.2",
63
65
  ]
64
66
 
65
67
  [build-system]
@@ -72,6 +74,22 @@ exclude-newer = "1 week"
72
74
  [tool.uv.build-backend]
73
75
  module-name = "citesync"
74
76
 
77
+ [tool.citesync.required-fields]
78
+ "CITATION.cff" = [
79
+ "name",
80
+ "version",
81
+ "author",
82
+ "license",
83
+ "identifier",
84
+ ]
85
+ "codemeta.json" = [
86
+ "name",
87
+ "version",
88
+ "author",
89
+ "license",
90
+ "identifier",
91
+ ]
92
+
75
93
  [tool.ruff]
76
94
  line-length = 120
77
95
 
@@ -113,14 +131,16 @@ max-args = 10
113
131
  [tool.ty.terminal]
114
132
  error-on-warning = false
115
133
 
116
- [tool.pytest.ini_options]
134
+ [tool.pytest]
135
+ minversion = "9.0"
117
136
  addopts = [
118
137
  "-ra",
119
- "--strict-config",
120
- "--strict-markers",
121
138
  "--import-mode=importlib",
122
139
  ]
123
140
  testpaths = ["tests"]
141
+ strict = true
142
+ filterwarnings = ["error"]
143
+ log_level = "INFO"
124
144
 
125
145
  [tool.mutmut]
126
146
  source_paths = ["src/citesync"]
@@ -133,6 +153,16 @@ only_mutate = [
133
153
  pytest_add_cli_args_test_selection = ["tests"]
134
154
  also_copy = [
135
155
  "docs",
156
+ "playground",
157
+ "README.md",
158
+ "CHANGELOG.md",
159
+ "CITATION.cff",
160
+ "codemeta.json",
161
+ ".github",
162
+ "GOVERNANCE.md",
163
+ "LICENSE",
164
+ "committed.toml",
165
+ ".pre-commit-config.yaml",
136
166
  ".pre-commit-hooks.yaml",
137
167
  ]
138
168
 
@@ -146,3 +176,14 @@ exclude_also = [
146
176
  "if TYPE_CHECKING:",
147
177
  "raise NotImplementedError",
148
178
  ]
179
+
180
+ [tool.repo-review.ignore]
181
+ PY007 = "just is the task runner: `just check` runs what CI runs"
182
+ PC110 = "ruff format runs as a local hook from the venv, the same ruff CI runs"
183
+ PC140 = "ty runs as a local hook from the venv"
184
+ PC170 = "no reStructuredText: rumdl checks the Markdown docs"
185
+ PC190 = "ruff check runs as a local hook from the venv"
186
+ PC901 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
187
+ PC902 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
188
+ PC903 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
189
+ GH200 = "Renovate updates the actions and hook revs (renovate.json5)"
@@ -1,52 +1,54 @@
1
1
  [project]
2
2
  name = "citesync"
3
- version = "0.4.0"
3
+ version = "0.6.0"
4
4
  description = "Generate and synchronize software citation files from package metadata. CLI, pre-commit hook and browser playground."
5
5
  readme = "README.md"
6
- requires-python = ">=3.12"
6
+ requires-python = ">=3.13"
7
7
  authors = [{ name = "Simon van Lierde", email = "code@duinlab.nl" }]
8
8
  license = "Apache-2.0"
9
9
  license-files = ["LICENSE", "NOTICE"]
10
10
  keywords = ["citation", "CITATION.cff", "codemeta", "zenodo", "software-metadata", "pre-commit"]
11
11
  classifiers = [
12
- "Development Status :: 3 - Alpha",
13
- "Environment :: Console",
14
- "Intended Audience :: Developers",
15
- "Intended Audience :: Science/Research",
16
- "Programming Language :: Python :: 3",
17
- "Programming Language :: Python :: 3.12",
18
- "Programming Language :: Python :: 3.13",
19
- "Programming Language :: Python :: 3.14",
20
- "Topic :: Software Development :: Quality Assurance",
21
- "Typing :: Typed",
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "Intended Audience :: Science/Research",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Python :: 3.14",
19
+ "Topic :: Software Development :: Quality Assurance",
20
+ "Typing :: Typed",
22
21
  ]
23
22
  dependencies = [
24
- "packaging>=26.3",
25
- "ruamel-yaml>=0.19",
26
- "tomlkit>=0.15.2",
23
+ "packaging>=26.3",
24
+ "ruamel-yaml>=0.19",
25
+ "tomlkit>=0.15.2",
27
26
  ]
28
27
 
29
28
  [project.scripts]
30
- citesync = "citesync.cli:main"
29
+ citesync = "citesync.cli:entry"
31
30
 
32
31
  [project.urls]
33
32
  Homepage = "https://simonvanlierde.com/citesync/"
33
+ Documentation = "https://simonvanlierde.com/citesync/docs/"
34
34
  Source = "https://github.com/simonvanlierde/citesync"
35
35
  Issues = "https://github.com/simonvanlierde/citesync/issues"
36
- Changelog = "https://github.com/simonvanlierde/citesync/blob/main/CHANGELOG.md"
36
+ Changelog = "https://simonvanlierde.com/citesync/docs/changelog/"
37
37
 
38
38
  [dependency-groups]
39
39
  dev = [
40
40
  "hypothesis>=6.140",
41
41
  "jsonschema>=4.25",
42
+ "markdown-it-py>=4.2.0",
42
43
  "memray>=1.20.0 ; sys_platform != 'win32'",
43
- "mutmut==3.8.0",
44
+ "mutmut==3.8.1",
44
45
  "pybtex>=0.25",
45
46
  "pyinstrument>=5.1.3",
46
- "pytest>=9.1.1",
47
+ "pytest>=9.2.0",
47
48
  "pytest-cov>=7.1.0",
48
- "ruff>=0.17.1",
49
- "ty>=0.0.89",
49
+ "ruff>=0.17.3",
50
+ "ty>=0.0.93",
51
+ "xmlschema>=4.3.2",
50
52
  ]
51
53
 
52
54
  [build-system]
@@ -64,6 +66,10 @@ exclude-newer = "1 week"
64
66
  [tool.uv.build-backend]
65
67
  module-name = "citesync"
66
68
 
69
+ [tool.citesync.required-fields]
70
+ "CITATION.cff" = ["name", "version", "author", "license", "identifier"]
71
+ "codemeta.json" = ["name", "version", "author", "license", "identifier"]
72
+
67
73
  # NOTE: self-contained ruff config, deliberately not extended from any shared base.
68
74
  # No target-version: ruff derives it from requires-python above.
69
75
  [tool.ruff]
@@ -75,11 +81,11 @@ docstring-code-format = true
75
81
  [tool.ruff.lint]
76
82
  select = ["ALL"]
77
83
  ignore = [
78
- "ANN204", # missing-return-type-special-method
79
- "COM812", # trailing-comma-missing: conflicts with the formatter
80
- "CPY001", # missing copyright notice
81
- "D105", # undocumented-magic-method
82
- "D107", # undocumented-public-init
84
+ "ANN204", # missing-return-type-special-method
85
+ "COM812", # trailing-comma-missing: conflicts with the formatter
86
+ "CPY001", # missing copyright notice
87
+ "D105", # undocumented-magic-method
88
+ "D107", # undocumented-public-init
83
89
  "TD002", # missing-todo-author: a plain `# TODO:` is enough
84
90
  "TD003", # missing-todo-link
85
91
  ]
@@ -103,19 +109,40 @@ max-args = 10
103
109
  [tool.ty.terminal]
104
110
  error-on-warning = false
105
111
 
106
- [tool.pytest.ini_options]
107
- addopts = ["-ra", "--strict-config", "--strict-markers", "--import-mode=importlib"]
112
+ # pytest 9's native table. strict turns unknown config keys, unknown markers and
113
+ # an xfail test that passes into errors, and filterwarnings turns warnings into
114
+ # failures, so a deprecation shows up in CI, not after the upgrade that removes it.
115
+ [tool.pytest]
116
+ minversion = "9.0"
117
+ addopts = ["-ra", "--import-mode=importlib"]
108
118
  testpaths = ["tests"]
119
+ strict = true
120
+ filterwarnings = ["error"]
121
+ log_level = "INFO"
109
122
 
110
123
  # Coverage is opt-in via `pytest --cov` (`just py-cov`), not addopts, because it
111
124
  # slows every plain test run. No fail_under until there is a suite worth setting
112
125
  # one against.
113
- # Mutation testing (`just mutation`, not in CI) covers the comparison code only.
126
+ # Mutation testing covers check, codecs, write and jsonsplice via `just mutation`
127
+ # and the weekly or manually triggered workflow.
114
128
  [tool.mutmut]
115
129
  source_paths = ["src/citesync"]
116
130
  only_mutate = ["src/citesync/check.py", "src/citesync/codecs.py", "src/citesync/write.py", "src/citesync/jsonsplice.py"]
117
131
  pytest_add_cli_args_test_selection = ["tests"]
118
- also_copy = ["docs", ".pre-commit-hooks.yaml"]
132
+ also_copy = [
133
+ "docs",
134
+ "playground",
135
+ "README.md",
136
+ "CHANGELOG.md",
137
+ "CITATION.cff",
138
+ "codemeta.json",
139
+ ".github",
140
+ "GOVERNANCE.md",
141
+ "LICENSE",
142
+ "committed.toml",
143
+ ".pre-commit-config.yaml",
144
+ ".pre-commit-hooks.yaml",
145
+ ]
119
146
 
120
147
  [tool.coverage.run]
121
148
  source = ["src"]
@@ -124,3 +151,16 @@ branch = true
124
151
  [tool.coverage.report]
125
152
  show_missing = true
126
153
  exclude_also = ["if TYPE_CHECKING:", "raise NotImplementedError"]
154
+
155
+ # Checks from Scientific Python's repo-review (the sp-repo-review git hook) that this
156
+ # project skips on purpose. `prek run sp-repo-review --all-files` runs the rest.
157
+ [tool.repo-review.ignore]
158
+ PY007 = "just is the task runner: `just check` runs what CI runs"
159
+ PC110 = "ruff format runs as a local hook from the venv, the same ruff CI runs"
160
+ PC140 = "ty runs as a local hook from the venv"
161
+ PC170 = "no reStructuredText: rumdl checks the Markdown docs"
162
+ PC190 = "ruff check runs as a local hook from the venv"
163
+ PC901 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
164
+ PC902 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
165
+ PC903 = "the hooks run in CI's checks workflow, not on pre-commit.ci"
166
+ GH200 = "Renovate updates the actions and hook revs (renovate.json5)"
@@ -0,0 +1,7 @@
1
+ # Vendored from simonvanlierde/codemeta-drift; tests/test_mapping.py checks the sha256 lines.
2
+ tag v0.8.0
3
+ commit 4b68ef7a9038992a918d806829c6dfbc45eac481
4
+ sha256 443f5c075e54416086cbb97f4680cb88900b671a435d9feb4e85d09c69c17cad mapping-local.json examples/mapping-3.1.json
5
+ sha256 99a26aa91a026cdd4fc0ac0631ec38749e6b3a96d5176bb115b2e22bb2298bc5 mapping-4.0.json examples/mapping-4.0.json
6
+ sha256 8c3dc9f4ce49e50b9fe3c6fbd4ba6082ca100439974b3f531485740218b2aa7b mapping.schema.json src/codemeta_drift/mapping.schema.json
7
+ sha256 a761fda190f4ddc4e981a30c87780a77f4f7416949da68e41cbf55350705eb1a mapping-vectors.json src/codemeta_drift/mapping-vectors.json
@@ -1,7 +1,5 @@
1
1
  """``python -m citesync``, the same as the ``citesync`` command."""
2
2
 
3
- import sys
3
+ from citesync.cli import entry
4
4
 
5
- from citesync.cli import main
6
-
7
- sys.exit(main())
5
+ entry()