bibaudit 0.1.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.
- bibaudit-0.1.0/.claude/settings.json +30 -0
- bibaudit-0.1.0/.claude/skills/registry-fixtures/SKILL.md +31 -0
- bibaudit-0.1.0/.github/dependabot.yml +33 -0
- bibaudit-0.1.0/.github/workflows/ci.yml +51 -0
- bibaudit-0.1.0/.github/workflows/docs.yml +56 -0
- bibaudit-0.1.0/.github/workflows/release.yml +69 -0
- bibaudit-0.1.0/.gitignore +33 -0
- bibaudit-0.1.0/.python-version +1 -0
- bibaudit-0.1.0/CHANGELOG.md +878 -0
- bibaudit-0.1.0/CLAUDE.md +238 -0
- bibaudit-0.1.0/LICENSE +21 -0
- bibaudit-0.1.0/PKG-INFO +456 -0
- bibaudit-0.1.0/README.md +423 -0
- bibaudit-0.1.0/SECURITY.md +47 -0
- bibaudit-0.1.0/docs/ci.md +201 -0
- bibaudit-0.1.0/docs/cli.md +241 -0
- bibaudit-0.1.0/docs/colophon.md +100 -0
- bibaudit-0.1.0/docs/index.md +176 -0
- bibaudit-0.1.0/docs/inputs.md +398 -0
- bibaudit-0.1.0/docs/limits.md +268 -0
- bibaudit-0.1.0/docs/registry-artifacts.md +1833 -0
- bibaudit-0.1.0/docs/retraction.md +515 -0
- bibaudit-0.1.0/docs/suggest.md +163 -0
- bibaudit-0.1.0/docs/suppressions.md +179 -0
- bibaudit-0.1.0/docs/verdicts.md +258 -0
- bibaudit-0.1.0/docs/why.md +183 -0
- bibaudit-0.1.0/mkdocs.yml +69 -0
- bibaudit-0.1.0/pyproject.toml +136 -0
- bibaudit-0.1.0/src/bibaudit/__init__.py +54 -0
- bibaudit-0.1.0/src/bibaudit/adapters/__init__.py +9 -0
- bibaudit-0.1.0/src/bibaudit/adapters/bibtex.py +426 -0
- bibaudit-0.1.0/src/bibaudit/adapters/markdown.py +1073 -0
- bibaudit-0.1.0/src/bibaudit/adapters/zotero.py +903 -0
- bibaudit-0.1.0/src/bibaudit/audit.py +907 -0
- bibaudit-0.1.0/src/bibaudit/benign.py +996 -0
- bibaudit-0.1.0/src/bibaudit/cli.py +559 -0
- bibaudit-0.1.0/src/bibaudit/compare.py +1838 -0
- bibaudit-0.1.0/src/bibaudit/model.py +353 -0
- bibaudit-0.1.0/src/bibaudit/names.py +1671 -0
- bibaudit-0.1.0/src/bibaudit/normalize.py +732 -0
- bibaudit-0.1.0/src/bibaudit/py.typed +0 -0
- bibaudit-0.1.0/src/bibaudit/registries/__init__.py +12 -0
- bibaudit-0.1.0/src/bibaudit/registries/crossref.py +501 -0
- bibaudit-0.1.0/src/bibaudit/registries/datacite.py +246 -0
- bibaudit-0.1.0/src/bibaudit/registries/http.py +630 -0
- bibaudit-0.1.0/src/bibaudit/registries/openlibrary.py +449 -0
- bibaudit-0.1.0/src/bibaudit/registries/pubmed.py +1118 -0
- bibaudit-0.1.0/src/bibaudit/registries/retractions.py +958 -0
- bibaudit-0.1.0/src/bibaudit/registries/search.py +383 -0
- bibaudit-0.1.0/src/bibaudit/report.py +509 -0
- bibaudit-0.1.0/src/bibaudit/suggest.py +371 -0
- bibaudit-0.1.0/src/bibaudit/suppress.py +215 -0
- bibaudit-0.1.0/tests/data/PROVENANCE.toml +499 -0
- bibaudit-0.1.0/tests/data/audit_crossref_interleaved_collective.json +1243 -0
- bibaudit-0.1.0/tests/data/audit_crossref_series_and_book_container.json +249 -0
- bibaudit-0.1.0/tests/data/compare_crossref_expression_of_concern.json +1 -0
- bibaudit-0.1.0/tests/data/compare_crossref_partial_retraction.json +1 -0
- bibaudit-0.1.0/tests/data/compare_crossref_wakefield_notice.json +1 -0
- bibaudit-0.1.0/tests/data/compare_crossref_wakefield_retracted.json +1 -0
- bibaudit-0.1.0/tests/data/compare_pubmed_wakefield_notice.txt +33 -0
- bibaudit-0.1.0/tests/data/compare_pubmed_wakefield_retracted.txt +163 -0
- bibaudit-0.1.0/tests/data/crossref_reciprocal_retracted_paper.json +717 -0
- bibaudit-0.1.0/tests/data/crossref_reciprocal_retraction_notice.json +364 -0
- bibaudit-0.1.0/tests/data/datacite_alternative_title_first.json +1 -0
- bibaudit-0.1.0/tests/data/datacite_arxiv_preprint.json +1 -0
- bibaudit-0.1.0/tests/data/datacite_creator_given_name_only.json +1 -0
- bibaudit-0.1.0/tests/data/datacite_creator_name_only.json +1 -0
- bibaudit-0.1.0/tests/data/datacite_journal_article.json +1 -0
- bibaudit-0.1.0/tests/data/datacite_organizational_creator.json +1 -0
- bibaudit-0.1.0/tests/data/markdown_epic_read_delim.qmd +39 -0
- bibaudit-0.1.0/tests/data/markdown_mws_read_delim.qmd +29 -0
- bibaudit-0.1.0/tests/data/markdown_obsidian_note.md +42 -0
- bibaudit-0.1.0/tests/data/markdown_pangeneu_data_frame.qmd +35 -0
- bibaudit-0.1.0/tests/data/names_crossref_first_author_omitted.json +1 -0
- bibaudit-0.1.0/tests/data/names_crossref_mojibake_author_list.json +1 -0
- bibaudit-0.1.0/tests/data/names_crossref_mojibake_cp1252.json +1 -0
- bibaudit-0.1.0/tests/data/names_crossref_mojibake_latin_extended_a.json +1 -0
- bibaudit-0.1.0/tests/data/pubmed_abbreviated_title.txt +35 -0
- bibaudit-0.1.0/tests/data/pubmed_acronym_prefix.txt +135 -0
- bibaudit-0.1.0/tests/data/pubmed_acronym_prefix_subtitle.txt +132 -0
- bibaudit-0.1.0/tests/data/pubmed_book.txt +51 -0
- bibaudit-0.1.0/tests/data/pubmed_book_chapter.txt +96 -0
- bibaudit-0.1.0/tests/data/pubmed_collective_creator.txt +225 -0
- bibaudit-0.1.0/tests/data/pubmed_collective_fau_without_comma.txt +118 -0
- bibaudit-0.1.0/tests/data/pubmed_concern_only.txt +90 -0
- bibaudit-0.1.0/tests/data/pubmed_corporate_author.txt +102 -0
- bibaudit-0.1.0/tests/data/pubmed_data_descriptor.txt +91 -0
- bibaudit-0.1.0/tests/data/pubmed_eci_concern.txt +86 -0
- bibaudit-0.1.0/tests/data/pubmed_eci_concern_notice.txt +41 -0
- bibaudit-0.1.0/tests/data/pubmed_epub_ahead_of_issue.txt +225 -0
- bibaudit-0.1.0/tests/data/pubmed_fau_whole_name.txt +138 -0
- bibaudit-0.1.0/tests/data/pubmed_fau_without_comma.txt +114 -0
- bibaudit-0.1.0/tests/data/pubmed_parallel_title.txt +113 -0
- bibaudit-0.1.0/tests/data/pubmed_parallel_title_article.txt +71 -0
- bibaudit-0.1.0/tests/data/pubmed_qualifier_inner_colon.txt +75 -0
- bibaudit-0.1.0/tests/data/pubmed_qualifier_leading_article.txt +63 -0
- bibaudit-0.1.0/tests/data/pubmed_qualifier_year.txt +96 -0
- bibaudit-0.1.0/tests/data/pubmed_retracted.txt +163 -0
- bibaudit-0.1.0/tests/data/pubmed_retracted_erratum.txt +80 -0
- bibaudit-0.1.0/tests/data/pubmed_retraction_notice.txt +33 -0
- bibaudit-0.1.0/tests/data/pubmed_society_expansion.txt +134 -0
- bibaudit-0.1.0/tests/data/pubmed_spelled_out_character.txt +71 -0
- bibaudit-0.1.0/tests/data/pubmed_title_holding_the_placeholder_words.txt +64 -0
- bibaudit-0.1.0/tests/data/pubmed_title_unavailable.txt +73 -0
- bibaudit-0.1.0/tests/data/pubmed_translated_title.txt +47 -0
- bibaudit-0.1.0/tests/data/pubmed_wrapped_creator.txt +40 -0
- bibaudit-0.1.0/tests/data/pubmed_wrapped_title.txt +173 -0
- bibaudit-0.1.0/tests/data/retraction_watch_sample.csv +20 -0
- bibaudit-0.1.0/tests/data/sample.bib +77 -0
- bibaudit-0.1.0/tests/data/zotero_csl_export.json +50 -0
- bibaudit-0.1.0/tests/data/zotero_native_items.json +86 -0
- bibaudit-0.1.0/tests/test_audit.py +2613 -0
- bibaudit-0.1.0/tests/test_audit_corpus.py +792 -0
- bibaudit-0.1.0/tests/test_benign.py +2187 -0
- bibaudit-0.1.0/tests/test_bibtex.py +272 -0
- bibaudit-0.1.0/tests/test_cli.py +1215 -0
- bibaudit-0.1.0/tests/test_compare.py +3309 -0
- bibaudit-0.1.0/tests/test_crossref.py +563 -0
- bibaudit-0.1.0/tests/test_datacite.py +743 -0
- bibaudit-0.1.0/tests/test_fixture_provenance.py +962 -0
- bibaudit-0.1.0/tests/test_http.py +1785 -0
- bibaudit-0.1.0/tests/test_markdown.py +1419 -0
- bibaudit-0.1.0/tests/test_names.py +2016 -0
- bibaudit-0.1.0/tests/test_normalize.py +722 -0
- bibaudit-0.1.0/tests/test_openlibrary.py +512 -0
- bibaudit-0.1.0/tests/test_pubmed.py +1920 -0
- bibaudit-0.1.0/tests/test_report.py +1149 -0
- bibaudit-0.1.0/tests/test_retractions.py +1477 -0
- bibaudit-0.1.0/tests/test_search.py +471 -0
- bibaudit-0.1.0/tests/test_suggest.py +358 -0
- bibaudit-0.1.0/tests/test_suppress.py +559 -0
- bibaudit-0.1.0/tests/test_zotero.py +2144 -0
- bibaudit-0.1.0/uv.lock +1066 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(uv run:*)",
|
|
5
|
+
"Bash(uv sync:*)",
|
|
6
|
+
"Bash(uv tool:*)",
|
|
7
|
+
"Bash(uvx:*)",
|
|
8
|
+
"Bash(python3 -m pytest:*)",
|
|
9
|
+
"Bash(git status:*)",
|
|
10
|
+
"Bash(git diff:*)",
|
|
11
|
+
"Bash(git log:*)",
|
|
12
|
+
"Bash(git show:*)",
|
|
13
|
+
"Bash(git branch:*)",
|
|
14
|
+
"Bash(git archive:*)",
|
|
15
|
+
"Bash(grep:*)",
|
|
16
|
+
"Bash(rg:*)",
|
|
17
|
+
"Bash(find:*)",
|
|
18
|
+
"Bash(ls:*)",
|
|
19
|
+
"Bash(cat:*)",
|
|
20
|
+
"Bash(head:*)",
|
|
21
|
+
"Bash(tail:*)",
|
|
22
|
+
"Bash(wc:*)",
|
|
23
|
+
"Bash(sed -n:*)"
|
|
24
|
+
],
|
|
25
|
+
"deny": [
|
|
26
|
+
"Read(./.env)",
|
|
27
|
+
"Read(./.env.*)"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: registry-fixtures
|
|
3
|
+
description: How to add, describe and verify a file in tests/data/ — the PROVENANCE.toml entry each one owes, what `pytest -m network` establishes that the offline suite cannot, and the fields the networked comparison ignores. Load when adding a fixture, re-fetching a drifted one, or widening the ignored-field list.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fixtures in tests/data/
|
|
7
|
+
|
|
8
|
+
## Adding a fixture
|
|
9
|
+
|
|
10
|
+
The fixtures in `tests/data/` are real registry responses, including the defective ones. Do not "clean them up" — the mojibake and the doubled MathML are the point.
|
|
11
|
+
|
|
12
|
+
1. **Fetch the whole response and commit it unedited.** Not the fields your test reads — all of them. A value dropped quietly and a value invented look the same from outside, which is why there is no way to declare a fixture partial.
|
|
13
|
+
2. **Add a `[[fixture]]` entry to `tests/data/PROVENANCE.toml`** naming the file, the registry, the identifier you requested it under, that request's URL, and the date. The header of that file defines every field. A fixture with no entry fails the build, so this is not a step you can forget; an entry naming a URL no client in `src/bibaudit/registries/` would issue fails too.
|
|
14
|
+
3. **Run `uv run pytest -m network`.** This is the step that verifies anything.
|
|
15
|
+
|
|
16
|
+
An entry is a claim by whoever wrote it. The offline suite establishes only that the claim hangs together — that the file really is a MEDLINE citation, that the PMID in it is the PMID you wrote down — and a citation invented around a live PMID satisfies every bit of that. `pytest -m network` re-fetches each URL and compares the answer with the bytes on disk, and nothing else in this repository can tell a recorded response from a written one. It is deselected by default so the ordinary suite stays offline, which means a fixture nobody has re-fetched is a fixture nobody has verified.
|
|
17
|
+
|
|
18
|
+
## What the networked comparison ignores
|
|
19
|
+
|
|
20
|
+
MEDLINE and the Retraction Watch rows are compared with nothing ignored. Two registries stamp their own record-keeping into the payload, and comparing on those would redden the check every week over values no deposit carries, until nobody ran it:
|
|
21
|
+
|
|
22
|
+
- **Crossref** — `indexed` and `deposited`, the index and last-deposit timestamps; `is-referenced-by-count`, a citation counter; and `link`, whose URL follows the publisher's hosting rather than the deposit.
|
|
23
|
+
- **DataCite** — `updated`, and the aggregates `viewCount`, `downloadCount`, `citationCount`, `citationsOverTime`, `referenceCount`, `partCount`, `partOfCount`, `versionCount` and `versionOfCount`. One level over, under `data.relationships`, the same goes for `citations`, the list of citing records that `citationCount` counts — ignoring the count and comparing the list leaves the check red for the identical reason. Every other relationship is compared.
|
|
24
|
+
|
|
25
|
+
Everything else is compared, and a difference means the record was revised — re-fetch, read the diff, commit it — or the file was never that record. Widening this list hides a fabricated value, so it grows only for a field that is demonstrably the registry's own bookkeeping, and each addition is named here: `tests/test_fixture_provenance.py` fails the build for one that is not.
|
|
26
|
+
|
|
27
|
+
## If a fixture is not a registry response
|
|
28
|
+
|
|
29
|
+
A bibliography the tool *reads* — a `.bib`, a Quarto page, a Zotero export — still needs an entry, with `source = "none"` and a `note` saying what it is. Nothing re-fetches those, and nothing checks the identifiers inside them: their DOIs are the thing under audit and some are wrong deliberately. The note is the only account such a file will ever have.
|
|
30
|
+
|
|
31
|
+
Which is why one thing is demanded of the prose, and only for a file that parses as a JSON list of objects: the note must name every `id` or `key` in it. A note nothing reads is a note nothing corrects.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
# Actions drift silently: a workflow keeps running on a pinned major until the
|
|
5
|
+
# runner deprecates its Node runtime, and the first sign is a warning nobody
|
|
6
|
+
# reads on a green run.
|
|
7
|
+
- package-ecosystem: github-actions
|
|
8
|
+
directory: /
|
|
9
|
+
schedule:
|
|
10
|
+
interval: monthly
|
|
11
|
+
commit-message:
|
|
12
|
+
prefix: ""
|
|
13
|
+
groups:
|
|
14
|
+
actions:
|
|
15
|
+
patterns: ["*"]
|
|
16
|
+
|
|
17
|
+
# Two runtime dependencies and a small dev set, so a monthly batch is enough
|
|
18
|
+
# noise. No `versioning-strategy`: the bounds in pyproject.toml — the `<3` cap
|
|
19
|
+
# on bibtexparser among them — are authored deliberately, and a proposal that
|
|
20
|
+
# moves one is a decision for the reviewer of the pull request, not something
|
|
21
|
+
# to encode here.
|
|
22
|
+
- package-ecosystem: uv
|
|
23
|
+
directory: /
|
|
24
|
+
schedule:
|
|
25
|
+
interval: monthly
|
|
26
|
+
commit-message:
|
|
27
|
+
prefix: ""
|
|
28
|
+
groups:
|
|
29
|
+
# One group for everything: `dependency-type: development` does not match
|
|
30
|
+
# here, because Dependabot's uv parser leaves entries from
|
|
31
|
+
# `[project.optional-dependencies]` untyped.
|
|
32
|
+
dependencies:
|
|
33
|
+
patterns: ["*"]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
# The default GITHUB_TOKEN scope is a repository-wide web setting that can be
|
|
9
|
+
# widened without touching this file. Stating it here means the permissions a
|
|
10
|
+
# run holds are reviewable in the same diff that grants them.
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
- uses: astral-sh/setup-uv@v9.0.0
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
# Pinned so every job installs the same uv a laptop runs, rather
|
|
27
|
+
# than whatever is newest that morning. It does not avoid the
|
|
28
|
+
# version-manifest fetch setup-uv makes on every job regardless, and
|
|
29
|
+
# that fetch has a short timeout that has aborted a job.
|
|
30
|
+
version: "0.11.7"
|
|
31
|
+
# `.python-version` pins 3.11, so without this every job in the
|
|
32
|
+
# matrix resolves the same interpreter and the job names lie. This
|
|
33
|
+
# input sets UV_PYTHON, which takes precedence over that file.
|
|
34
|
+
python-version: ${{ matrix.python-version }}
|
|
35
|
+
- name: Install
|
|
36
|
+
# --locked fails the step when uv.lock has drifted from pyproject.toml
|
|
37
|
+
# rather than silently re-resolving, so the lockfile is enforced rather
|
|
38
|
+
# than merely committed.
|
|
39
|
+
run: uv sync --all-extras --locked
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: uv run ruff check .
|
|
42
|
+
- name: Type check
|
|
43
|
+
run: uv run mypy
|
|
44
|
+
# Deliberately excludes the network-marked tests: CI must prove the logic,
|
|
45
|
+
# not the availability of Crossref.
|
|
46
|
+
#
|
|
47
|
+
# `--cov` carries no argument: a package name here reaches coverage as
|
|
48
|
+
# `source=`, which overrides `[tool.coverage.run]` in pyproject.toml. Left
|
|
49
|
+
# bare, what is measured is decided in the file that looks like it decides.
|
|
50
|
+
- name: Test
|
|
51
|
+
run: uv run pytest --cov --cov-report=term-missing
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
# So a documentation change can be reviewed before it is published.
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
# One Pages deployment at a time. Two pushes to main in quick succession
|
|
13
|
+
# otherwise race at the deployment API and the second run fails outright
|
|
14
|
+
# ("Deployment request failed ... due to in progress deployment"), turning a
|
|
15
|
+
# green docs change red for a reason that has nothing to do with the docs.
|
|
16
|
+
# Not cancel-in-progress: a half-deployed site is worse than a queued one.
|
|
17
|
+
concurrency:
|
|
18
|
+
group: pages
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
- uses: astral-sh/setup-uv@v9.0.0
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
# Pinned so every job installs the same uv a laptop runs, rather
|
|
30
|
+
# than whatever is newest that morning. It does not avoid the
|
|
31
|
+
# version-manifest fetch setup-uv makes on every job regardless, and
|
|
32
|
+
# that fetch has a short timeout that has aborted a job.
|
|
33
|
+
version: "0.11.7"
|
|
34
|
+
# --strict fails the build on a broken internal link, so a page that
|
|
35
|
+
# points at a file somebody renamed is caught here rather than by a
|
|
36
|
+
# reader hitting a 404.
|
|
37
|
+
- name: Build
|
|
38
|
+
run: uv run --group docs mkdocs build --strict
|
|
39
|
+
- uses: actions/upload-pages-artifact@v5
|
|
40
|
+
if: github.ref == 'refs/heads/main'
|
|
41
|
+
with:
|
|
42
|
+
path: site
|
|
43
|
+
|
|
44
|
+
deploy:
|
|
45
|
+
if: github.ref == 'refs/heads/main'
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
permissions:
|
|
49
|
+
pages: write
|
|
50
|
+
id-token: write
|
|
51
|
+
environment:
|
|
52
|
+
name: github-pages
|
|
53
|
+
url: ${{ steps.deploy.outputs.page_url }}
|
|
54
|
+
steps:
|
|
55
|
+
- id: deploy
|
|
56
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishing is deliberately manual: pushing a `v*` tag is the only thing that
|
|
4
|
+
# triggers it, so nothing reaches PyPI as a side effect of a merge.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
|
+
- uses: astral-sh/setup-uv@v9.0.0
|
|
18
|
+
with:
|
|
19
|
+
enable-cache: true
|
|
20
|
+
# Pinned so every job installs the same uv a laptop runs, rather
|
|
21
|
+
# than whatever is newest that morning. It does not avoid the
|
|
22
|
+
# version-manifest fetch setup-uv makes on every job regardless, and
|
|
23
|
+
# that fetch has a short timeout that has aborted a job.
|
|
24
|
+
version: "0.11.7"
|
|
25
|
+
# The tag is the claim; this checks the package agrees with it before
|
|
26
|
+
# anything is uploaded, because a version cannot be re-uploaded to PyPI.
|
|
27
|
+
- name: Check the tag matches the packaged version
|
|
28
|
+
run: |
|
|
29
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
30
|
+
packaged="$(uv run --no-project python -c \
|
|
31
|
+
'import tomllib,pathlib;print(tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"])')"
|
|
32
|
+
if [ "$tag" != "$packaged" ]; then
|
|
33
|
+
echo "tag $GITHUB_REF_NAME does not match pyproject version $packaged" >&2
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
- name: Test
|
|
37
|
+
run: |
|
|
38
|
+
uv sync --all-extras --locked
|
|
39
|
+
uv run ruff check .
|
|
40
|
+
uv run mypy
|
|
41
|
+
uv run pytest
|
|
42
|
+
- name: Build
|
|
43
|
+
run: uv build --out-dir dist
|
|
44
|
+
- uses: actions/upload-artifact@v7
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist
|
|
48
|
+
|
|
49
|
+
publish:
|
|
50
|
+
needs: build
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
# Trusted Publishing: PyPI verifies this workflow's OIDC identity, so there
|
|
53
|
+
# is no API token to store, rotate or leak. It has to be configured once on
|
|
54
|
+
# PyPI for the project before the first release will go through.
|
|
55
|
+
environment:
|
|
56
|
+
name: pypi
|
|
57
|
+
url: https://pypi.org/p/bibaudit
|
|
58
|
+
permissions:
|
|
59
|
+
id-token: write
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/download-artifact@v8
|
|
62
|
+
with:
|
|
63
|
+
name: dist
|
|
64
|
+
path: dist
|
|
65
|
+
# A commit, because this is the step that holds `id-token: write`: the code
|
|
66
|
+
# that runs here has to be the code that was reviewed, whatever a tag or a
|
|
67
|
+
# branch points at by the time a release is cut. Dependabot updates a SHA
|
|
68
|
+
# pin and its comment together; it cannot update a branch reference at all.
|
|
69
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
# mkdocs' output directory: `mkdocs build` and `mkdocs serve` write it into the
|
|
8
|
+
# repo root, and the docs workflow uploads it from a throwaway checkout.
|
|
9
|
+
site/
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
|
|
13
|
+
# Tooling
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.coverage
|
|
18
|
+
htmlcov/
|
|
19
|
+
|
|
20
|
+
# bibaudit's own registry cache, if a run is pointed at the repo
|
|
21
|
+
.bibaudit-cache/
|
|
22
|
+
|
|
23
|
+
# bibaudit's own output, if a run is pointed at the repo. --suggest writes
|
|
24
|
+
# beside the bibliography it read, so a run inside a checkout leaves these here.
|
|
25
|
+
*.suggested.bib
|
|
26
|
+
*.suggested.diff
|
|
27
|
+
|
|
28
|
+
# Development scratch: the multi-agent workflow scripts used to build this.
|
|
29
|
+
# They carry absolute paths to private corpora and are not part of the package.
|
|
30
|
+
.claude/workflows/
|
|
31
|
+
|
|
32
|
+
# OS
|
|
33
|
+
.DS_Store
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|