From f7269ed7eaae69d7d49b8e1c5e99ab054e09e699 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:23:55 -0400 Subject: [PATCH 01/22] Switch from rst to md --- CHANGELOG.md | 56 ++++++++++++++++ CHANGELOG.rst | 68 ------------------- README.md | 136 ++++++++++++++++++++++++++++++++++++++ README.rst | 136 -------------------------------------- docs/.buildinfo | 4 +- pyproject.toml | 6 +- sphinx-docs/changelog.md | 2 + sphinx-docs/changelog.rst | 1 - sphinx-docs/codedocs.md | 26 ++++++++ sphinx-docs/codedocs.rst | 24 ------- sphinx-docs/conf.py | 6 +- sphinx-docs/index.md | 25 +++++++ sphinx-docs/index.rst | 26 -------- uv.lock | 103 ++++++++++++++++++++++++++++- 14 files changed, 357 insertions(+), 262 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 CHANGELOG.rst create mode 100644 README.md delete mode 100644 README.rst create mode 100644 sphinx-docs/changelog.md delete mode 100644 sphinx-docs/changelog.rst create mode 100644 sphinx-docs/codedocs.md delete mode 100644 sphinx-docs/codedocs.rst create mode 100644 sphinx-docs/index.md delete mode 100644 sphinx-docs/index.rst diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a905450 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,56 @@ +(changelog)= + +# CHANGELOG + +## 0.5 + +- Now supports Python 3.10 through 3.14; drops support for Python 3.9 +- Adopt a new set of ruff linter rules +- Add GitHub Action for ruff lint and format checks +- Add GitHub Action to check for changelog updates +- Add pre-commit hooks for development +- Switch to using uv for package development +- Switch project organization to src layout +- Switch from os.path to pathlib +- Switch from rst to md for documentation format + +## 0.4 + +- Updates for new VIAF /search API endpoint response +- bugfix: VIAF entity request needs Accept header + +## 0.3 + +- Handle negative years when parsing birth and death dates +- Now tested on python 3.9 through 3.12 +- Now tested against Django 3.2 through 5.0 +- Migrate continuous integration to GitHub Actions + +## 0.2 + +- Now supports Django versions 1.11 through 3.0. + +## 0.1.4 + +- Fix Travis-CI build for building with and without Django. + +## 0.1.3 + +- Fix GitHub repository name in sphinx documentation config file. + +## 0.1.2 + +- Update sphinx configuration to support building documentation on readthedocs.org + +## 0.1.1 + +- Document permissions. + +## 0.1 + +Initial release. + +- Basic support for VIAP API use: autocomplete, SRU search, information + about a single VIAF entity. +- Basic Django integration (optional); django-autocomplete-light lookup + view and a VIAF url widget. diff --git a/CHANGELOG.rst b/CHANGELOG.rst deleted file mode 100644 index cc57fa2..0000000 --- a/CHANGELOG.rst +++ /dev/null @@ -1,68 +0,0 @@ -.. _CHANGELOG: - -CHANGELOG -========= - -0.5 ---- - -* Now supports Python 3.10 through 3.14; drops support for Python 3.9 -* Adopt a new set of ruff linter rules -* Add GitHub Action for ruff lint and format checks -* Add GitHub Action to check for changelog updates -* Add pre-commit hooks for development -* Switch to using uv for package development -* Switch project organization to src layout -* Switch from os.path to pathlib - -0.4 ---- - -* Updates for new VIAF /search API endpoint response -* bugfix: VIAF entity request needs Accept header - -0.3 ---- - -* Handle negative years when parsing birth and death dates -* Now tested on python 3.9 through 3.12 -* Now tested against Django 3.2 through 5.0 -* Migrate continuous integration to GitHub Actions - -0.2 ---- - -* Now supports Django versions 1.11 through 3.0. - -0.1.4 ------ - -* Fix Travis-CI build for building with and without Django. - -0.1.3 ------ - -* Fix GitHub repository name in sphinx documentation config file. - -0.1.2 ------ - -* Update sphinx configuration to support building documentation on readthedocs.org - - -0.1.1 ------ - -* Document permissions. - -0.1 ---- - -Initial release. - -* Basic support for VIAP API use: autocomplete, SRU search, information - about a single VIAF entity. -* Basic Django integration (optional); django-autocomplete-light lookup - view and a VIAF url widget. - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..434e69a --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# viapy + +% sphinx-start-marker-do-not-remove + +*VIAF via Python* + +Python module for interacting with [VIAF](https://viaf.org) (the Virtual International +Authority File) data and APIs. + +**viapy** provides optional Django integration; this currently includes a +django-autocomplete-light lookup view and a VIAF url widget. + +```{image} https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml/badge.svg +:alt: Build status +:target: https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml +``` + +```{image} https://codecov.io/gh/Princeton-CDH/viapy/branch/master/graph/badge.svg +:alt: Code coverage +:target: https://codecov.io/gh/Princeton-CDH/viapy/branch/master +``` + +```{image} https://www.codefactor.io/repository/github/princeton-cdh/viapy/badge +:alt: CodeFactor +:target: https://www.codefactor.io/repository/github/princeton-cdh/viapy +``` + +```{image} https://img.shields.io/pypi/pyversions/viapy +:alt: PyPI - Python Version +``` + +```{image} https://img.shields.io/pypi/djversions/viapy +:alt: PyPI - Django Version +``` + +## Installation + +Use pip to install from GitHub. Use a branch or tag name, e.g. +`@develop` or `@1.0` if you want to install a specific tagged release or branch: + +``` +pip install git+https://github.com/Princeton-CDH/viapy.git@develop#egg=viapy +``` + +## Configuration for use with Django + +Using `viapy` with Django requires additional configuration. Add `viapy` to +installed applications along with the needed django-autocomplete-light +modules: + +``` +INSTALLED_APPS = ( + ... + 'dal', + 'dal_select2', + 'viapy', + ... +) +``` + +Include the viapy urls at the desired base url with the namespace: + +``` +urlpatterns = [ + ... + path(r'viaf/', include('viapy.urls', namespace='viaf')), + ... +] +``` + +## Development instructions + +This git repository uses [git flow](https://github.com/nvie/gitflow) branching conventions. + +For development, we assume the usage of [uv](https://docs.astral.sh/uv/). +`uv` is compatible with the use of `pip` for python package management +and a tool of your choice for creating python virtual environments +(e.g., `mamba`, `venv`). + +Initial setup and installation: + +- Install `uv` if it's not installed. + It can be installed via PyPi, Homebrew, or a standalone installer. + See uv's [installation documentation](https://docs.astral.sh/uv/getting-started/installation) + for more details. + +- To explicitly sync the project's dependencies, including optional dependencies + for development and testing, to your local environment run: + + ``` + uv sync + ``` + +- Note that `uv` performs syncing and locking automatically (e.g., any time + `uv run` is invoked). By default, syncing will remove any packages not + specifically specified in the `pyproject.toml`. + +### Unit Testing + +Unit tests are set up to be run with [pytest](https://docs.pytest.org/) + +- Copy sample test settings and add a **SECRET_KEY**: + + ``` + cp ci/testsettings.py testsettings.py + ``` + +- To run the tests, run: + + ``` + uv run pytest + ``` + +### Documentation + +Documentation is generated using [sphinx](https://www.sphinx-doc.org/). + +Then build the documentation using the customized make file in the `docs` +directory: + +``` +cd sphinx-docs +uv run make html +``` + +When building documentation for a production release, use `make docs` to +update the published documentation on GitHub Pages. + +## License + +**viapy** is distributed under the Apache 2.0 License. + +©2024 Trustees of Princeton University. Permission granted via +Princeton Docket #18-3449-1 for distribution online under a standard Open Source +license. Ownership rights transferred to Rebecca Koeser provided software +is distributed online via open source. diff --git a/README.rst b/README.rst deleted file mode 100644 index 5bac395..0000000 --- a/README.rst +++ /dev/null @@ -1,136 +0,0 @@ -viapy -===== - -.. sphinx-start-marker-do-not-remove - -*VIAF via Python* - -Python module for interacting with `VIAF`_ (the Virtual International -Authority File) data and APIs. - -.. _VIAF: http://viaf.org - -**viapy** provides optional Django integration; this currently includes a -django-autocomplete-light lookup view and a VIAF url widget. - -.. image:: https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml/badge.svg - :target: https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml - :alt: Build status - -.. image:: https://codecov.io/gh/Princeton-CDH/viapy/branch/master/graph/badge.svg - :target: https://codecov.io/gh/Princeton-CDH/viapy/branch/master - :alt: Code coverage - -.. image:: https://www.codefactor.io/repository/github/princeton-cdh/viapy/badge - :target: https://www.codefactor.io/repository/github/princeton-cdh/viapy - :alt: CodeFactor - -.. image:: https://img.shields.io/pypi/pyversions/viapy - :alt: PyPI - Python Version - -.. image:: https://img.shields.io/pypi/djversions/viapy - :alt: PyPI - Django Version - - -Installation ------------- - -Use pip to install from GitHub. Use a branch or tag name, e.g. -``@develop`` or ``@1.0`` if you want to install a specific tagged release or branch:: - - pip install git+https://github.com/Princeton-CDH/viapy.git@develop#egg=viapy - - -Configuration for use with Django ---------------------------------- - -Using `viapy` with Django requires additional configuration. Add `viapy` to -installed applications along with the needed django-autocomplete-light -modules:: - - INSTALLED_APPS = ( - ... - 'dal', - 'dal_select2', - 'viapy', - ... - ) - - -Include the viapy urls at the desired base url with the namespace:: - - urlpatterns = [ - ... - path(r'viaf/', include('viapy.urls', namespace='viaf')), - ... - ] - - -Development instructions ------------------------- - -This git repository uses `git flow`_ branching conventions. - -.. _git flow: https://github.com/nvie/gitflow - -For development, we assume the usage of `uv `_. -``uv`` is compatible with the use of ``pip`` for python package management -and a tool of your choice for creating python virtual environments -(e.g., ``mamba``, ``venv``). - -Initial setup and installation: - -* Install ``uv`` if it's not installed. - It can be installed via PyPi, Homebrew, or a standalone installer. - See uv's `installation documentation `_ - for more details. - -* To explicitly sync the project's dependencies, including optional dependencies - for development and testing, to your local environment run:: - - uv sync - -* Note that ``uv`` performs syncing and locking automatically (e.g., any time - ``uv run`` is invoked). By default, syncing will remove any packages not - specifically specified in the ``pyproject.toml``. - - -Unit Testing -^^^^^^^^^^^^ - -Unit tests are set up to be run with `pytest `_ - -- Copy sample test settings and add a **SECRET_KEY**:: - - cp ci/testsettings.py testsettings.py - -- To run the tests, run:: - - uv run pytest - - -Documentation -^^^^^^^^^^^^^ - -Documentation is generated using `sphinx `_. - -Then build the documentation using the customized make file in the `docs` -directory:: - - cd sphinx-docs - uv run make html - -When building documentation for a production release, use `make docs` to -update the published documentation on GitHub Pages. - - - -License -------- - -**viapy** is distributed under the Apache 2.0 License. - -©2024 Trustees of Princeton University. Permission granted via -Princeton Docket #18-3449-1 for distribution online under a standard Open Source -license. Ownership rights transferred to Rebecca Koeser provided software -is distributed online via open source. diff --git a/docs/.buildinfo b/docs/.buildinfo index 66e520b..81955d2 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 07f0115a76cb96c834e58102ea0921e2 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 181df615bfd61a7adfc243159f09711c tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/pyproject.toml b/pyproject.toml index 628bad4..0c949ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ {name = "Center for Digital Humanities at Princeton", email = "cdh@princeton.edu"}, ] requires-python = ">=3.10" -readme = "README.rst" +readme = "README.md" license = {text = "Apache-2"} classifiers = [ "Environment :: Web Environment", @@ -43,7 +43,7 @@ dependencies = [ [project.urls] #Documentation = "https://readthedocs.org" Repository = "https://github.com/Princeton-CDH/viapy" -Changelog = "https://github.com/Princeton-CDH/viapy/blob/main/CHANGELOG.rst" +Changelog = "https://github.com/Princeton-CDH/viapy/blob/main/CHANGELOG.md" [tool.hatch.version] path = "src/viapy/__init__.py" @@ -56,7 +56,7 @@ test = [ ] django = ["django>=3.2", "django-autocomplete-light"] django_test = ["pytest-django", "viapy[django]"] -docs = ["sphinx"] +docs = ["sphinx", "myst-parser"] test_all = ["viapy[test]", "viapy[django_test]"] dev = [ "ruff", diff --git a/sphinx-docs/changelog.md b/sphinx-docs/changelog.md new file mode 100644 index 0000000..66efc0f --- /dev/null +++ b/sphinx-docs/changelog.md @@ -0,0 +1,2 @@ +```{include} ../CHANGELOG.md +``` diff --git a/sphinx-docs/changelog.rst b/sphinx-docs/changelog.rst deleted file mode 100644 index 4d7817a..0000000 --- a/sphinx-docs/changelog.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../CHANGELOG.rst \ No newline at end of file diff --git a/sphinx-docs/codedocs.md b/sphinx-docs/codedocs.md new file mode 100644 index 0000000..d74b7dc --- /dev/null +++ b/sphinx-docs/codedocs.md @@ -0,0 +1,26 @@ +# viapy Code Documentation + +```{toctree} +:maxdepth: 2 +``` + +## API + +```{eval-rst} +.. automodule:: viapy.api + :members: +``` + +## Views + +```{eval-rst} +.. automodule:: viapy.views + :members: +``` + +## Widgets + +```{eval-rst} +.. automodule:: viapy.widgets + :members: +``` diff --git a/sphinx-docs/codedocs.rst b/sphinx-docs/codedocs.rst deleted file mode 100644 index 8e24b1c..0000000 --- a/sphinx-docs/codedocs.rst +++ /dev/null @@ -1,24 +0,0 @@ -viapy Code Documentation -======================== - -.. toctree:: - :maxdepth: 2 - -API ---- - -.. automodule:: viapy.api - :members: - -Views ------ - -.. automodule:: viapy.views - :members: - -Widgets -------- - -.. automodule:: viapy.widgets - :members: - diff --git a/sphinx-docs/conf.py b/sphinx-docs/conf.py index 1565c4e..3201cf1 100644 --- a/sphinx-docs/conf.py +++ b/sphinx-docs/conf.py @@ -49,6 +49,7 @@ "sphinx.ext.coverage", "sphinx.ext.viewcode", "sphinx.ext.githubpages", + "myst_parser", ] # Add any paths that contain templates here, relative to this directory. @@ -58,7 +59,10 @@ # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = ".rst" +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} # The master toctree document. master_doc = "index" diff --git a/sphinx-docs/index.md b/sphinx-docs/index.md new file mode 100644 index 0000000..ea3b60a --- /dev/null +++ b/sphinx-docs/index.md @@ -0,0 +1,25 @@ +% viapy documentation master file, created by +% sphinx-quickstart on Thu Oct 12 17:06:23 2017. +% You can adapt this file completely to your liking, but it should at least +% contain the root `toctree` directive. + +# viapy documentation + +```{toctree} +:caption: 'Contents:' +:maxdepth: 2 + +codedocs +Change Log +``` + + +```{include} ../README.md +:start-after: sphinx-start-marker-do-not-remove +``` + +# Indices and tables + +- {ref}`genindex` +- {ref}`modindex` +- {ref}`search` diff --git a/sphinx-docs/index.rst b/sphinx-docs/index.rst deleted file mode 100644 index 8e2b62b..0000000 --- a/sphinx-docs/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. viapy documentation master file, created by - sphinx-quickstart on Thu Oct 12 17:06:23 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -viapy documentation -=================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - codedocs - Change Log - - -.. include:: ../README.rst - :start-after: sphinx-start-marker-do-not-remove - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/uv.lock b/uv.lock index cc64b59..ac3e4fc 100644 --- a/uv.lock +++ b/uv.lock @@ -376,7 +376,7 @@ name = "exceptiongroup" version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.12'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -449,6 +449,37 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] +[[package]] +name = "markdown-it-py" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +dependencies = [ + { name = "mdurl", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", +] +dependencies = [ + { name = "mdurl", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, +] + [[package]] name = "markupsafe" version = "3.0.3" @@ -534,6 +565,70 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, ] +[[package]] +name = "mdit-py-plugins" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/fd/a756d36c0bfba5f6e39a1cdbdbfdd448dc02692467d83816dff4592a1ebc/mdit_py_plugins-0.5.0.tar.gz", hash = "sha256:f4918cb50119f50446560513a8e311d574ff6aaed72606ddae6d35716fe809c6", size = 44655, upload-time = "2025-08-11T07:25:49.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/86/dd6e5db36df29e76c7a7699123569a4a18c1623ce68d826ed96c62643cae/mdit_py_plugins-0.5.0-py3-none-any.whl", hash = "sha256:07a08422fc1936a5d26d146759e9155ea466e842f5ab2f7d2266dd084c8dab1f", size = 57205, upload-time = "2025-08-11T07:25:47.597Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "myst-parser" +version = "4.0.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +dependencies = [ + { name = "docutils", version = "0.21.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "jinja2", marker = "python_full_version < '3.11'" }, + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "mdit-py-plugins", marker = "python_full_version < '3.11'" }, + { name = "pyyaml", marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/a5/9626ba4f73555b3735ad86247a8077d4603aa8628537687c839ab08bfe44/myst_parser-4.0.1.tar.gz", hash = "sha256:5cfea715e4f3574138aecbf7d54132296bfd72bb614d31168f48c477a830a7c4", size = 93985, upload-time = "2025-02-12T10:53:03.833Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5f/df/76d0321c3797b54b60fef9ec3bd6f4cfd124b9e422182156a1dd418722cf/myst_parser-4.0.1-py3-none-any.whl", hash = "sha256:9134e88959ec3b5780aedf8a99680ea242869d012e8821db3126d427edc9c95d", size = 84579, upload-time = "2025-02-12T10:53:02.078Z" }, +] + +[[package]] +name = "myst-parser" +version = "5.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", +] +dependencies = [ + { name = "docutils", version = "0.22.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "jinja2", marker = "python_full_version >= '3.11'" }, + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mdit-py-plugins", marker = "python_full_version >= '3.11'" }, + { name = "pyyaml", marker = "python_full_version >= '3.11'" }, + { name = "sphinx", version = "9.0.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" }, + { name = "sphinx", version = "9.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/fa/7b45eef11b7971f0beb29d27b7bfe0d747d063aa29e170d9edd004733c8a/myst_parser-5.0.0.tar.gz", hash = "sha256:f6f231452c56e8baa662cc352c548158f6a16fcbd6e3800fc594978002b94f3a", size = 98535, upload-time = "2026-01-15T09:08:18.036Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d3/ac/686789b9145413f1a61878c407210e41bfdb097976864e0913078b24098c/myst_parser-5.0.0-py3-none-any.whl", hash = "sha256:ab31e516024918296e169139072b81592336f2fef55b8986aa31c9f04b5f7211", size = 84533, upload-time = "2026-01-15T09:08:16.788Z" }, +] + [[package]] name = "nodeenv" version = "1.10.0" @@ -1058,6 +1153,8 @@ dev = [ { name = "django", version = "5.2.12", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" }, { name = "django", version = "6.0.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, { name = "django-autocomplete-light" }, + { name = "myst-parser", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "myst-parser", version = "5.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-cov" }, @@ -1079,6 +1176,8 @@ django-test = [ { name = "pytest-django" }, ] docs = [ + { name = "myst-parser", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "myst-parser", version = "5.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "sphinx", version = "9.0.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" }, { name = "sphinx", version = "9.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, @@ -1118,6 +1217,8 @@ requires-dist = [ { name = "django-autocomplete-light", marker = "extra == 'django'" }, { name = "django-autocomplete-light", marker = "extra == 'django-test'" }, { name = "django-autocomplete-light", marker = "extra == 'test-all'" }, + { name = "myst-parser", marker = "extra == 'dev'" }, + { name = "myst-parser", marker = "extra == 'docs'" }, { name = "pre-commit", marker = "extra == 'dev'" }, { name = "pytest", marker = "extra == 'dev'" }, { name = "pytest", marker = "extra == 'test'" }, From 8dde403ea08dd54b7c46fbd9dcee650ec970b693 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:32:45 -0400 Subject: [PATCH 02/22] Fix README buttons --- README.md | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 434e69a..3ab618e 100644 --- a/README.md +++ b/README.md @@ -10,28 +10,11 @@ Authority File) data and APIs. **viapy** provides optional Django integration; this currently includes a django-autocomplete-light lookup view and a VIAF url widget. -```{image} https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml/badge.svg -:alt: Build status -:target: https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml -``` - -```{image} https://codecov.io/gh/Princeton-CDH/viapy/branch/master/graph/badge.svg -:alt: Code coverage -:target: https://codecov.io/gh/Princeton-CDH/viapy/branch/master -``` - -```{image} https://www.codefactor.io/repository/github/princeton-cdh/viapy/badge -:alt: CodeFactor -:target: https://www.codefactor.io/repository/github/princeton-cdh/viapy -``` - -```{image} https://img.shields.io/pypi/pyversions/viapy -:alt: PyPI - Python Version -``` - -```{image} https://img.shields.io/pypi/djversions/viapy -:alt: PyPI - Django Version -``` +[![unit tests](https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/Princeton-CDH/viapy/actions/workflows/unit_tests.yml) +[![codecov](https://codecov.io/gh/Princeton-CDH/viapy/branch/master/graph/badge.svg)](https://codecov.io/gh/Princeton-CDH/viapy/branch/master) +[![CodeFactor](https://www.codefactor.io/repository/github/princeton-cdh/viapy/badge)](https://www.codefactor.io/repository/github/princeton-cdh/viapy) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/viapy)](https://pypi.org/project/viapy/) +[![PyPI - Django Version](https://img.shields.io/pypi/djversions/viapy)](https://pypi.org/project/viapy/) ## Installation From 557553c598e5ac8bb2adf5d85044cbdf74541f6c Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:43:36 -0400 Subject: [PATCH 03/22] Hide sphinx marker in README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ab618e..5b2ce3b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # viapy -% sphinx-start-marker-do-not-remove + *VIAF via Python* From 86600a4715e436bc8108d21b9efe9cad13cc33ca Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:46:19 -0400 Subject: [PATCH 04/22] Remove residual sphinx-docs line in changelog --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a905450..0e0cdad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,3 @@ -(changelog)= - # CHANGELOG ## 0.5 From e14ffeeff9a3b85d87d2817e1d7b56de08ddf49b Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:51:19 -0400 Subject: [PATCH 05/22] Add mdformat pre-commit hook Also update yamlfmt config options --- .pre-commit-config.yaml | 10 +++++++++- pyproject.toml | 5 +++++ yamlfmt.yml | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf48d01..c8e98c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,17 @@ repos: hooks: # Run the linter - id: ruff-check - args: [--fix, --show-fixes] # enable lint fixes + args: [--fix, --show-fixes] # enable lint fixes # Run the formatter - id: ruff-format + # mdformat for formatting Markdown files + - repo: https://github.com/hukkin/mdformat + rev: 1.0.0 + hooks: + - id: mdformat + # Optionally add plugins + additional_dependencies: + - mdformat-pyproject # support configuration in pyproject.toml # yamlfmt for formatting YAML files - repo: https://github.com/google/yamlfmt rev: v0.17.2 diff --git a/pyproject.toml b/pyproject.toml index 0c949ec..872a3ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,3 +103,8 @@ extend-select = [ ] # Can use to ignore specific rules within above selection ignore = [] + +[tool.mdformat] +number = true +wrap = "keep" +end_of_line = "lf" diff --git a/yamlfmt.yml b/yamlfmt.yml index 39901e6..01e3817 100644 --- a/yamlfmt.yml +++ b/yamlfmt.yml @@ -3,4 +3,5 @@ # https://github.com/google/yamlfmt/blob/main/docs/config-file.md formatter: retain_line_breaks_single: true + pad_line_comments: 2 scan_folded_as_literal: true From 2d53df92843da9d5ceb7df5e40d2a5066813cec9 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:38:56 -0400 Subject: [PATCH 06/22] Add sphinx docs GitHub Action --- .github/workflows/sphinx_docs.yml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/sphinx_docs.yml diff --git a/.github/workflows/sphinx_docs.yml b/.github/workflows/sphinx_docs.yml new file mode 100644 index 0000000..b9698b1 --- /dev/null +++ b/.github/workflows/sphinx_docs.yml @@ -0,0 +1,49 @@ +name: sphinx docs + +on: + push: # run on push to main and PR + branches: + - main + pull_request: + +env: + # Python version used to build sphinx docs + DOCS_PYTHON_VERSION: "3.12" + +jobs: + docs: + name: Sphinx documentation + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install uv and Python version + uses: astral-sh/setup-uv@v7 + with: + python-version: ${{ env.DOCS_PYTHON_VERSION }} + + - name: Install package dependencies + run: uv sync --extra doc + + - name: Build Sphinx docs + run: cd docs && make -b coverage html + + # For pull requests, exit with error if documentation coverage is incomplete + - name: Report on documentation coverage + if: github.event_name == 'pull_request' + run: >- + cd docs/build/coverage + if [[ $((`grep corppa python.txt | grep -v 100 | wc -l`)) -eq 0 ]]; then + echo "Documentation coverage complete"; + else + cat python.txt; + fi + + # When building on push to main, publish the built docs + - name: Deploy built docs to github pages + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build/html From ff1bf510ed9cddc1df9f125edeee1eea307b9365 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:46:37 -0400 Subject: [PATCH 07/22] Remove versions of Django past end-of-life --- .github/workflows/unit_tests.yml | 6 +++--- pyproject.toml | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e0fb9a2..8a254e8 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,10 +1,10 @@ name: unit tests on: - push: # run on all branches + push: # run on all branches pull_request: branches: [develop, main] - schedule: # run automatically on main branch each Tuesday at 11am + schedule: # run automatically on main branch each Tuesday at 11am - cron: "0 16 * * 2" jobs: @@ -14,7 +14,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13", "3.14"] - django: [0, "3.2", "4.0", "4.1", "4.2", "5.0"] + django: [0, "5.2", "6.0"] steps: - name: Checkout repository uses: actions/checkout@v6 diff --git a/pyproject.toml b/pyproject.toml index 872a3ef..55a22a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,11 +14,8 @@ license = {text = "Apache-2"} classifiers = [ "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", - "Framework :: Django :: 4.1", - "Framework :: Django :: 4.2", - "Framework :: Django :: 5.0", + "Framework :: Django :: 5.2", + "Framework :: Django :: 6.0", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", From 18908c8b30703bc8ea14cacc65af52fc165a9f56 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:55:17 -0400 Subject: [PATCH 08/22] Update README --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5b2ce3b..9376efa 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ django-autocomplete-light lookup view and a VIAF url widget. Use pip to install from GitHub. Use a branch or tag name, e.g. `@develop` or `@1.0` if you want to install a specific tagged release or branch: -``` +```sh pip install git+https://github.com/Princeton-CDH/viapy.git@develop#egg=viapy ``` @@ -32,7 +32,7 @@ Using `viapy` with Django requires additional configuration. Add `viapy` to installed applications along with the needed django-autocomplete-light modules: -``` +```python INSTALLED_APPS = ( ... 'dal', @@ -44,7 +44,7 @@ INSTALLED_APPS = ( Include the viapy urls at the desired base url with the namespace: -``` +```python urlpatterns = [ ... path(r'viaf/', include('viapy.urls', namespace='viaf')), @@ -71,7 +71,7 @@ Initial setup and installation: - To explicitly sync the project's dependencies, including optional dependencies for development and testing, to your local environment run: - ``` + ```sh uv sync ``` @@ -81,17 +81,17 @@ Initial setup and installation: ### Unit Testing -Unit tests are set up to be run with [pytest](https://docs.pytest.org/) +Unit tests are set up to be run with [pytest](https://docs.pytest.org/). - Copy sample test settings and add a **SECRET_KEY**: - ``` + ```sh cp ci/testsettings.py testsettings.py ``` - To run the tests, run: - ``` + ```sh uv run pytest ``` @@ -102,7 +102,7 @@ Documentation is generated using [sphinx](https://www.sphinx-doc.org/). Then build the documentation using the customized make file in the `docs` directory: -``` +```sh cd sphinx-docs uv run make html ``` @@ -110,6 +110,17 @@ uv run make html When building documentation for a production release, use `make docs` to update the published documentation on GitHub Pages. +To check documentation coverage, run: + +```sh +uv make html -b coverage +``` + +This will create a file under `_build/coverage/python.txt` listing any Python classes or methods +that are not documented. Note that sphinx can only report on code coverage for files that are +included in the documentation. If a new Python file is created but not included in the sphinx +documentation, it will be omitted. + ## License **viapy** is distributed under the Apache 2.0 License. From 2e83f99a30a237fb8ae310bd9750e15dd6c67544 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:00:21 -0400 Subject: [PATCH 09/22] Restore docs/.buildinfo --- docs/.buildinfo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.buildinfo b/docs/.buildinfo index 81955d2..66e520b 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 -# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 181df615bfd61a7adfc243159f09711c +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 07f0115a76cb96c834e58102ea0921e2 tags: 645f666f9bcd5a90fca523b33c5a78b7 From de992f5fa4db0276d5c051e50967ea82da6acf04 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:10:23 -0400 Subject: [PATCH 10/22] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0cdad..b3a1edd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ ## 0.5 - Now supports Python 3.10 through 3.14; drops support for Python 3.9 +- Now supports Django 5.2 and 6.0; drops support for Django 3.2 through 5.0 - Adopt a new set of ruff linter rules - Add GitHub Action for ruff lint and format checks - Add GitHub Action to check for changelog updates +- Add GitHub Action for publishing documentation to GitHub Pages - Add pre-commit hooks for development - Switch to using uv for package development - Switch project organization to src layout From 36f8eaf674b51a6bb57978690bcd8b43983ad06c Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:12:40 -0400 Subject: [PATCH 11/22] Fix sphinx-docs github action --- .github/workflows/sphinx_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sphinx_docs.yml b/.github/workflows/sphinx_docs.yml index b9698b1..ba7714a 100644 --- a/.github/workflows/sphinx_docs.yml +++ b/.github/workflows/sphinx_docs.yml @@ -24,7 +24,7 @@ jobs: python-version: ${{ env.DOCS_PYTHON_VERSION }} - name: Install package dependencies - run: uv sync --extra doc + run: uv sync --extra docs - name: Build Sphinx docs run: cd docs && make -b coverage html From 6e2dca3f93d1eaf26ea0eb44553827adfca06892 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:44:08 -0400 Subject: [PATCH 12/22] Refine sphinx-docs GitHub Action to coverage check --- ...sphinx_docs.yml => sphinx-docs-coverage.yml} | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) rename .github/workflows/{sphinx_docs.yml => sphinx-docs-coverage.yml} (66%) diff --git a/.github/workflows/sphinx_docs.yml b/.github/workflows/sphinx-docs-coverage.yml similarity index 66% rename from .github/workflows/sphinx_docs.yml rename to .github/workflows/sphinx-docs-coverage.yml index ba7714a..f2e5e4a 100644 --- a/.github/workflows/sphinx_docs.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -1,9 +1,6 @@ -name: sphinx docs +name: sphinx docs coverage on: - push: # run on push to main and PR - branches: - - main pull_request: env: @@ -27,23 +24,15 @@ jobs: run: uv sync --extra docs - name: Build Sphinx docs - run: cd docs && make -b coverage html + run: cd sphinx-docs && uv make -b coverage html # For pull requests, exit with error if documentation coverage is incomplete - name: Report on documentation coverage if: github.event_name == 'pull_request' run: >- - cd docs/build/coverage + cd sphinx-docs/_build/coverage if [[ $((`grep corppa python.txt | grep -v 100 | wc -l`)) -eq 0 ]]; then echo "Documentation coverage complete"; else cat python.txt; fi - - # When building on push to main, publish the built docs - - name: Deploy built docs to github pages - if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build/html From 7c605d573025c33b52cf66049d55005e3be932c5 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:46:12 -0400 Subject: [PATCH 13/22] Update sphinx-docs-coverage GitHub Action config --- .github/workflows/sphinx-docs-coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sphinx-docs-coverage.yml b/.github/workflows/sphinx-docs-coverage.yml index f2e5e4a..05ed793 100644 --- a/.github/workflows/sphinx-docs-coverage.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -1,7 +1,9 @@ name: sphinx docs coverage on: + push: # run on all branches pull_request: + branches: [develop, main] env: # Python version used to build sphinx docs From 4133f544a576261f05f7aaf656fcbfc1389bfda3 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:47:20 -0400 Subject: [PATCH 14/22] Fix error in GitHub Action --- .github/workflows/sphinx-docs-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sphinx-docs-coverage.yml b/.github/workflows/sphinx-docs-coverage.yml index 05ed793..c46b8c7 100644 --- a/.github/workflows/sphinx-docs-coverage.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -26,7 +26,7 @@ jobs: run: uv sync --extra docs - name: Build Sphinx docs - run: cd sphinx-docs && uv make -b coverage html + run: cd sphinx-docs && uv run make -b coverage html # For pull requests, exit with error if documentation coverage is incomplete - name: Report on documentation coverage From d8365ad7844f6b6890e561a79d4b788e178e9846 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:49:18 -0400 Subject: [PATCH 15/22] Corrected changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a1edd..fc6ebc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Adopt a new set of ruff linter rules - Add GitHub Action for ruff lint and format checks - Add GitHub Action to check for changelog updates -- Add GitHub Action for publishing documentation to GitHub Pages +- Add GitHub Action for checking documentation coverage - Add pre-commit hooks for development - Switch to using uv for package development - Switch project organization to src layout From 96df7263fe9396db3b68ddec628746c1bac0ea7d Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:52:13 -0400 Subject: [PATCH 16/22] Fix typos --- .github/workflows/sphinx-docs-coverage.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sphinx-docs-coverage.yml b/.github/workflows/sphinx-docs-coverage.yml index c46b8c7..0b9fb31 100644 --- a/.github/workflows/sphinx-docs-coverage.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -31,10 +31,10 @@ jobs: # For pull requests, exit with error if documentation coverage is incomplete - name: Report on documentation coverage if: github.event_name == 'pull_request' - run: >- - cd sphinx-docs/_build/coverage + run: | + cd sphinx-docs/_build/coverage && if [[ $((`grep corppa python.txt | grep -v 100 | wc -l`)) -eq 0 ]]; then - echo "Documentation coverage complete"; + echo "Documentation coverage complete" else - cat python.txt; + cat python.txt fi From b40dab13fd3140b4b3da894d5910fc0bea658112 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 16:33:57 -0400 Subject: [PATCH 17/22] Update codeql github actions --- .github/workflows/codeql-analysis.yml | 88 +++++++++++++++++++-------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a6efcc2..4d747bb 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,48 +9,88 @@ on: schedule: - cron: '34 21 * * 1' +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: analyze: - name: Analyze - runs-on: ubuntu-latest + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read strategy: fail-fast: false matrix: - language: ['python'] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - + include: + - language: actions + build-mode: none + - language: python + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" From c14ee7dc9da1a03b7c322e40cd306c65dafeea04 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 16:36:07 -0400 Subject: [PATCH 18/22] Add concurrency logic to GitHub Actions --- .github/workflows/changelog.yml | 7 +++++++ .github/workflows/python-publish.yml | 7 ++++++- .github/workflows/ruff-checks.yml | 7 +++++++ .github/workflows/sphinx-docs-coverage.yml | 5 +++++ .github/workflows/unit_tests.yml | 5 +++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 0993778..6432584 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,10 +1,17 @@ name: Check Changelog + on: pull_request: # opened/synchronize/reopened: Check changelog when PR is created or updated # labeled/unlabeled: Re-run check when "no changelog" label is added/removed types: [opened, synchronize, reopened, labeled, unlabeled] branches: [develop, main] + +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-changelog: name: Verify Changelog Updated diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cb585ea..fefd12f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,6 +18,11 @@ on: permissions: contents: read +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: pypi-publish: name: Upload release to PyPI @@ -26,7 +31,7 @@ jobs: name: pypi url: https://pypi.org/project/viapy/ permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'main') steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ruff-checks.yml b/.github/workflows/ruff-checks.yml index 1cf3dd5..da4d516 100644 --- a/.github/workflows/ruff-checks.yml +++ b/.github/workflows/ruff-checks.yml @@ -1,10 +1,17 @@ name: Check Ruff linter + formatter + on: # Run on pull requests to develop or main pull_request: branches: [develop, main] # Allow running manually workflow_dispatch: + +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: ruff: runs-on: ubuntu-latest diff --git a/.github/workflows/sphinx-docs-coverage.yml b/.github/workflows/sphinx-docs-coverage.yml index 0b9fb31..c1d37ab 100644 --- a/.github/workflows/sphinx-docs-coverage.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -5,6 +5,11 @@ on: pull_request: branches: [develop, main] +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: # Python version used to build sphinx docs DOCS_PYTHON_VERSION: "3.12" diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8a254e8..b321224 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -7,6 +7,11 @@ on: schedule: # run automatically on main branch each Tuesday at 11am - cron: "0 16 * * 2" +concurrency: + # Cancel existing job(s) for workflow when a new one is queued + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: python-unit: name: Python unit tests From a0993cb72f189bb5a91f516eb6be451922dbc002 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 16:41:31 -0400 Subject: [PATCH 19/22] Rename codeql github action --- .github/workflows/{codeql-analysis.yml => codeql.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{codeql-analysis.yml => codeql.yml} (100%) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql.yml similarity index 100% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql.yml From 944b20745380efb3bf9defec067716fbd9bea965 Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Wed, 29 Apr 2026 16:43:21 -0400 Subject: [PATCH 20/22] Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/sphinx-docs-coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sphinx-docs-coverage.yml b/.github/workflows/sphinx-docs-coverage.yml index c1d37ab..f155b44 100644 --- a/.github/workflows/sphinx-docs-coverage.yml +++ b/.github/workflows/sphinx-docs-coverage.yml @@ -5,6 +5,9 @@ on: pull_request: branches: [develop, main] +permissions: + contents: read + concurrency: # Cancel existing job(s) for workflow when a new one is queued group: ${{ github.workflow }}-${{ github.ref }} From e972d8d00ea0536f4579206b58ca0e4620ccee6e Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Fri, 1 May 2026 11:29:57 -0400 Subject: [PATCH 21/22] Update README.md Co-authored-by: Rebecca Sutton Koeser --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9376efa..80008a0 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ documentation, it will be omitted. **viapy** is distributed under the Apache 2.0 License. -©2024 Trustees of Princeton University. Permission granted via +©2024-2026 Trustees of Princeton University. Permission granted via Princeton Docket #18-3449-1 for distribution online under a standard Open Source license. Ownership rights transferred to Rebecca Koeser provided software is distributed online via open source. From b400757a34d56004e7907bc2080357afbb6bf15d Mon Sep 17 00:00:00 2001 From: Laure Thompson <602628+laurejt@users.noreply.github.com> Date: Fri, 1 May 2026 14:59:52 -0400 Subject: [PATCH 22/22] Remove auto-generated comments --- sphinx-docs/conf.py | 20 -------------------- sphinx-docs/index.md | 6 ------ 2 files changed, 26 deletions(-) diff --git a/sphinx-docs/conf.py b/sphinx-docs/conf.py index 3201cf1..9fccd75 100644 --- a/sphinx-docs/conf.py +++ b/sphinx-docs/conf.py @@ -1,24 +1,4 @@ #!/usr/bin/env python3 -# -# viapy documentation build configuration file, created by -# sphinx-quickstart on Thu Oct 12 17:06:23 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use pathlib.Path.resolve to make it absolute, like shown here. -# -# import pathlib -# import sys -# sys.path.insert(0, pathlib.Path().resolve()) import os import pathlib diff --git a/sphinx-docs/index.md b/sphinx-docs/index.md index ea3b60a..6b62a86 100644 --- a/sphinx-docs/index.md +++ b/sphinx-docs/index.md @@ -1,8 +1,3 @@ -% viapy documentation master file, created by -% sphinx-quickstart on Thu Oct 12 17:06:23 2017. -% You can adapt this file completely to your liking, but it should at least -% contain the root `toctree` directive. - # viapy documentation ```{toctree} @@ -13,7 +8,6 @@ codedocs Change Log ``` - ```{include} ../README.md :start-after: sphinx-start-marker-do-not-remove ```