From b00e2660dea92e987e9de540f6ecdf5d762580a1 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:20:47 -0400 Subject: [PATCH 1/3] Fix some formatting issues --- .github/pull_request_template.md | 2 +- .github/workflows/pre-commit-ci.yml | 2 +- .github/workflows/smoke-test.yml | 2 +- .github/workflows/testing-and-coverage.yml | 2 +- .setup_dev.sh | 2 +- CITATION.bib | 1 - copier.yml | 2 +- docs/Makefile | 3 +-- docs/index.rst | 1 - docs/practices/ci_testing.rst | 2 +- docs/practices/conda.rst | 2 +- docs/practices/overview.rst | 2 +- docs/practices/pipx.rst | 2 +- docs/practices/pypi.rst | 2 +- docs/practices/pytest_timing.rst | 2 +- docs/practices/unit_testing.rst | 2 +- docs/requirements.txt | 2 +- docs/source/citation.rst | 2 +- docs/source/configuration_checklist.rst | 2 +- docs/source/contributing.rst | 2 +- docs/source/existing_project.rst | 2 +- docs/source/overview.rst | 2 +- pyproject.toml | 2 +- .../.github/ISSUE_TEMPLATE/README.md | 2 +- .../.github/pull_request_template.md | 2 +- ...ins_code %}smoke-test.yml{% endif %}.jinja | 4 ++-- .../.initialize_new_project.sh | 2 +- .../README.md | 2 +- .../asv.conf.json.jinja | 2 +- .../Makefile.jinja | 1 - .../notebooks/README.md | 2 +- .../requirements.txt.jinja | 2 +- python-versions.jinja | 20 +++++++++---------- tox.ini | 1 - 34 files changed, 40 insertions(+), 45 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a3e0ee08..14898c41 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,4 +6,4 @@ - [ ] This PR is meant for the `lincc-frameworks/python-project-template` repo and not a downstream one instead. - [ ] This change is linked to an open issue -- [ ] This change includes integration testing, or is small enough to be covered by existing tests \ No newline at end of file +- [ ] This change includes integration testing, or is small enough to be covered by existing tests diff --git a/.github/workflows/pre-commit-ci.yml b/.github/workflows/pre-commit-ci.yml index cbffedab..db2ed2b6 100644 --- a/.github/workflows/pre-commit-ci.yml +++ b/.github/workflows/pre-commit-ci.yml @@ -39,4 +39,4 @@ jobs: env: SKIP: "check-lincc-frameworks-template-version,no-commit-to-branch,check-added-large-files,validate-pyproject,sphinx-build,pytest-check" - uses: pre-commit-ci/lite-action@062bca0919bc9d6e66755cc05074b70c77e111fc # v1.2.0 - if: failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false \ No newline at end of file + if: failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 9eaf488e..946b205a 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -82,4 +82,4 @@ jobs: } } ] - } \ No newline at end of file + } diff --git a/.github/workflows/testing-and-coverage.yml b/.github/workflows/testing-and-coverage.yml index fb100154..ace61834 100644 --- a/.github/workflows/testing-and-coverage.yml +++ b/.github/workflows/testing-and-coverage.yml @@ -40,4 +40,4 @@ jobs: - name: Run unit tests with pytest / pytest-copie run: | git config --global init.defaultBranch main - python -m pytest tests -o log_cli=true -vv --python_version ${{ matrix.python-version }} \ No newline at end of file + python -m pytest tests -o log_cli=true -vv --python_version ${{ matrix.python-version }} diff --git a/.setup_dev.sh b/.setup_dev.sh index 5286e41e..c09be488 100755 --- a/.setup_dev.sh +++ b/.setup_dev.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Bash Unofficial strict mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/) +# Bash Unofficial strict mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/) # and (https://disconnected.systems/blog/another-bash-strict-mode/) set -o nounset # Any uninitialized variable is an error set -o errexit # Exit the script on the failure of any command to execute without error diff --git a/CITATION.bib b/CITATION.bib index af209d7e..387d4750 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -13,4 +13,3 @@ @ARTICLE{2024RNAAS...8..141O adsurl = {https://ui.adsabs.harvard.edu/abs/2024RNAAS...8..141O}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} } - diff --git a/copier.yml b/copier.yml index f5215be8..4b054df7 100644 --- a/copier.yml +++ b/copier.yml @@ -49,7 +49,7 @@ package_name: project_organization: type: str - help: What github organization will your project live under? + help: What github organization will your project live under? default: my-organization validator: >- {% if not (project_organization | regex_search('^[a-zA-Z0-9][a-zA-Z0-9-]*$')) %} diff --git a/docs/Makefile b/docs/Makefile index aa8ae081..20fa136b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,7 +8,7 @@ SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = ../_readthedocs/ -.PHONY: help clean Makefile +.PHONY: help clean Makefile # Put it first so that "make" without argument is like "make help". help: @@ -23,4 +23,3 @@ clean: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - diff --git a/docs/index.rst b/docs/index.rst index 233c8674..6cc8acda 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,4 +54,3 @@ please :doc:`/source/contact` practices/publishing_package practices/customizing_project practices/development_guide - diff --git a/docs/practices/ci_testing.rst b/docs/practices/ci_testing.rst index 37b0a974..4cd19224 100644 --- a/docs/practices/ci_testing.rst +++ b/docs/practices/ci_testing.rst @@ -144,4 +144,4 @@ In your project repo create a new repo secret: There is a stage in the end of the ``smoke_test.yml`` file that will send failure alerts to the slack channel. -An example can be found in the `rail project `_ \ No newline at end of file +An example can be found in the `rail project `_ diff --git a/docs/practices/conda.rst b/docs/practices/conda.rst index 3cfed8ea..e9176ced 100644 --- a/docs/practices/conda.rst +++ b/docs/practices/conda.rst @@ -40,4 +40,4 @@ from your repository as normal. conda-forge periodically looks at your source repo for any new releases/tags, tries to build a new release, and pre-generates the PR (against your "feedstock" -repo created above) to publish the new version of the package. \ No newline at end of file +repo created above) to publish the new version of the package. diff --git a/docs/practices/overview.rst b/docs/practices/overview.rst index 8d15ada2..6741577e 100644 --- a/docs/practices/overview.rst +++ b/docs/practices/overview.rst @@ -24,4 +24,4 @@ Practices Still have questions? -------------------------------- -:doc:`/source/contact` \ No newline at end of file +:doc:`/source/contact` diff --git a/docs/practices/pipx.rst b/docs/practices/pipx.rst index 2627b7a6..8f506ff0 100644 --- a/docs/practices/pipx.rst +++ b/docs/practices/pipx.rst @@ -47,4 +47,4 @@ An example installation of ``pipx`` might look like this. >> pipx ensurepath .. important:: - Don't forget to run ``pipx ensurepath`` to finalize the installation. \ No newline at end of file + Don't forget to run ``pipx ensurepath`` to finalize the installation. diff --git a/docs/practices/pypi.rst b/docs/practices/pypi.rst index 5c2dcedc..a1484fe4 100644 --- a/docs/practices/pypi.rst +++ b/docs/practices/pypi.rst @@ -38,4 +38,4 @@ Releasing new versions Now, when you `create a new release `_ -from your repository, a workflow will run that will package and deploy the code to PyPI. \ No newline at end of file +from your repository, a workflow will run that will package and deploy the code to PyPI. diff --git a/docs/practices/pytest_timing.rst b/docs/practices/pytest_timing.rst index 981b5561..38bf9fc8 100644 --- a/docs/practices/pytest_timing.rst +++ b/docs/practices/pytest_timing.rst @@ -131,4 +131,4 @@ Profiling the same target as above, using ``py-spy`` might look like: You will get a profiling flame chart saved to ``profile.svg``. These are not as easy to read as some other flame charts, but they're better than sifting through the -raw results! \ No newline at end of file +raw results! diff --git a/docs/practices/unit_testing.rst b/docs/practices/unit_testing.rst index be134965..d0e5cdca 100644 --- a/docs/practices/unit_testing.rst +++ b/docs/practices/unit_testing.rst @@ -43,4 +43,4 @@ supports tests embedded in documentation using pytest's `doctest `_ component. Documentation comments in all source files, as well as ``.rst`` files in the ``./docs`` directory can contain doctests in the format outlined -`here `_. \ No newline at end of file +`here `_. diff --git a/docs/requirements.txt b/docs/requirements.txt index 4ac568c8..bea0e1e4 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,4 +2,4 @@ sphinx sphinx-autoapi sphinx-copybutton -sphinx-rtd-theme>=3.1.0 \ No newline at end of file +sphinx-rtd-theme>=3.1.0 diff --git a/docs/source/citation.rst b/docs/source/citation.rst index 1ee3f86a..0b1a040e 100644 --- a/docs/source/citation.rst +++ b/docs/source/citation.rst @@ -19,4 +19,4 @@ If you use Python Project Template in your work, we ask the you cite the `"A Pyt doi = {10.3847/2515-5172/ad4da1}, adsurl = {https://ui.adsabs.harvard.edu/abs/2024RNAAS...8..141O}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} - } \ No newline at end of file + } diff --git a/docs/source/configuration_checklist.rst b/docs/source/configuration_checklist.rst index 6e0845cf..ba89ab2d 100644 --- a/docs/source/configuration_checklist.rst +++ b/docs/source/configuration_checklist.rst @@ -64,4 +64,4 @@ Get the most out of this template Still have questions? ------------------------------------------------------------------------------- -:doc:`/source/contact` \ No newline at end of file +:doc:`/source/contact` diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index f6e616f7..13e71acc 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -59,4 +59,4 @@ for doing so are here. Use your best judgement when incrementing the version. i.e. is this a major, minor, or patch fix. -Do you want to help out, but you're not sure how? :doc:`/source/contact` \ No newline at end of file +Do you want to help out, but you're not sure how? :doc:`/source/contact` diff --git a/docs/source/existing_project.rst b/docs/source/existing_project.rst index b7c8cf39..7799c8a5 100644 --- a/docs/source/existing_project.rst +++ b/docs/source/existing_project.rst @@ -237,4 +237,4 @@ to conclude the setup. Still have questions? ---------------------------------------- -:doc:`/source/contact` \ No newline at end of file +:doc:`/source/contact` diff --git a/docs/source/overview.rst b/docs/source/overview.rst index bafa1a7b..c9b0709d 100644 --- a/docs/source/overview.rst +++ b/docs/source/overview.rst @@ -74,4 +74,4 @@ Now choose your next adventure... ------------------------------------- * :doc:`Start a new project` * :doc:`Configure a new project` -* :doc:`Upgrade an existing project` \ No newline at end of file +* :doc:`Upgrade an existing project` diff --git a/pyproject.toml b/pyproject.toml index cdca29a0..e6a61696 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,4 +69,4 @@ profile = "black" line_length = 110 [tool.pytest.ini_options] -log_cli_level = "INFO" \ No newline at end of file +log_cli_level = "INFO" diff --git a/python-project-template/.github/ISSUE_TEMPLATE/README.md b/python-project-template/.github/ISSUE_TEMPLATE/README.md index 46dc08e3..af7f0c81 100644 --- a/python-project-template/.github/ISSUE_TEMPLATE/README.md +++ b/python-project-template/.github/ISSUE_TEMPLATE/README.md @@ -6,4 +6,4 @@ removing, and modifying these templates to suit the needs of your project is enc For more information about these templates, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/issue_pr_templating.html -Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html \ No newline at end of file +Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html diff --git a/python-project-template/.github/pull_request_template.md b/python-project-template/.github/pull_request_template.md index 5f341fd2..a8b83bd9 100644 --- a/python-project-template/.github/pull_request_template.md +++ b/python-project-template/.github/pull_request_template.md @@ -1,5 +1,5 @@ ## Change Description - diff --git a/python-project-template/.github/workflows/{% if contains_code %}smoke-test.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if contains_code %}smoke-test.yml{% endif %}.jinja index 5784d9a3..cc822700 100644 --- a/python-project-template/.github/workflows/{% if contains_code %}smoke-test.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if contains_code %}smoke-test.yml{% endif %}.jinja @@ -46,9 +46,9 @@ jobs: pip list - name: Run unit tests with pytest run: | - python -m pytest -o log_cli=true -vv + python -m pytest -o log_cli=true -vv {%- if 'email' in failure_notification %} - - name: Send status to author's email + - name: Send status to author's email if: {% raw %}${{ failure() }} && github.event_name != 'workflow_dispatch' }}{% endraw %} # Only email if the workflow failed and was not manually started. Customize this as necessary. uses: dawidd6/action-send-mail@67ce3558d613188179559c61d3565140cf389968 # v22 with: diff --git a/python-project-template/.initialize_new_project.sh b/python-project-template/.initialize_new_project.sh index 26932609..9f556321 100644 --- a/python-project-template/.initialize_new_project.sh +++ b/python-project-template/.initialize_new_project.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Bash Unofficial strict mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/) +# Bash Unofficial strict mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/) # and (https://disconnected.systems/blog/another-bash-strict-mode/) set -o nounset # Any uninitialized variable is an error set -o errexit # Exit the script on the failure of any command to execute without error diff --git a/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/README.md b/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/README.md index 5259778b..cc65fa7a 100644 --- a/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/README.md +++ b/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/README.md @@ -9,4 +9,4 @@ tracked and reported to give you a sense of the overall performance of your code You are encouraged to add, update, or remove benchmark functions to suit the needs of your project. -For more information, see the documentation here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci_benchmarking.html \ No newline at end of file +For more information, see the documentation here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci_benchmarking.html diff --git a/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/asv.conf.json.jinja b/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/asv.conf.json.jinja index 590c0768..28302366 100644 --- a/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/asv.conf.json.jinja +++ b/python-project-template/{% if include_benchmarks %}benchmarks{% endif %}/asv.conf.json.jinja @@ -78,4 +78,4 @@ // "some_benchmark": "352cdf", // Consider regressions only after this commit // "another_benchmark": null, // Skip regression detection altogether // } -} \ No newline at end of file +} diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/Makefile.jinja b/python-project-template/{% if include_docs %}docs{% endif %}/Makefile.jinja index e32f1af4..075e18c1 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/Makefile.jinja +++ b/python-project-template/{% if include_docs %}docs{% endif %}/Makefile.jinja @@ -33,4 +33,3 @@ clean: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/notebooks/README.md b/python-project-template/{% if include_docs %}docs{% endif %}/notebooks/README.md index 2b4fb45c..3049d4aa 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/notebooks/README.md +++ b/python-project-template/{% if include_docs %}docs{% endif %}/notebooks/README.md @@ -22,4 +22,4 @@ For notebooks that require large datasets, access to third party APIs, large CPU For more information look here: https://lincc-ppt.readthedocs.io/en/latest/practices/sphinx.html#python-notebooks -Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html \ No newline at end of file +Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja b/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja index e96005e6..2d23c8cf 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja +++ b/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja @@ -8,4 +8,4 @@ nbsphinx sphinx sphinx-autoapi sphinx-copybutton -sphinx-rtd-theme>=3.0 \ No newline at end of file +sphinx-rtd-theme>=3.0 diff --git a/python-versions.jinja b/python-versions.jinja index 0845287f..28d7745b 100644 --- a/python-versions.jinja +++ b/python-versions.jinja @@ -1,22 +1,22 @@ {# You use this file by including it via jinja like: - {%- import 'python-versions.jinja' as py -%} + {%- import 'python-versions.jinja' as py -%} -Then pass the python_versions list into the various macros like so: +Then pass the python_versions list into the various macros like so: - {{ py.min(python_versions) }} + {{ py.min(python_versions) }} -This template creates no output, but does allow you to transform python_versions answer into a -number of helpful values for when you need a single python version. +This template creates no output, but does allow you to transform python_versions answer into a +number of helpful values for when you need a single python version. Note that the import syntax and access MUST BE in the form above. Copier has problems processing import lines that are any more complex when they occur in files who's paths are also jinja templated. #} -{# This gives a middle python version from a potentially long list of versions -For even-length lists we prefer the older of the two middle values. - ["3.9","3.10","3.11","3.12"] -> "3.10" -For odd-length lists we prefer the middle value +{# This gives a middle python version from a potentially long list of versions +For even-length lists we prefer the older of the two middle values. + ["3.9","3.10","3.11","3.12"] -> "3.10" +For odd-length lists we prefer the middle value ["3.9","3.10","3.11"] -> "3.10" #} {% macro pref(python_versions) -%} {%- set n = python_versions | length -%} @@ -32,4 +32,4 @@ For odd-length lists we prefer the middle value {% macro max(python_versions) -%} {%- set n = python_versions | length -%} {{ python_versions[n-1] }} -{%- endmacro -%} \ No newline at end of file +{%- endmacro -%} diff --git a/tox.ini b/tox.ini index 3db556ff..31a7f706 100644 --- a/tox.ini +++ b/tox.ini @@ -9,4 +9,3 @@ deps = pylint commands = pytest tests - From 13a8a50613a62bb300436a044d66a8e9474e0098 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:24:27 -0400 Subject: [PATCH 2/3] Fixes --- .git_archival.txt | 2 +- .gitattributes | 2 +- python-project-template/.pre-commit-config.yaml.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index b1a286bb..8fb235d7 100644 --- a/.git_archival.txt +++ b/.git_archival.txt @@ -1,4 +1,4 @@ node: $Format:%H$ node-date: $Format:%cI$ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ -ref-names: $Format:%D$ \ No newline at end of file +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index 343a7554..f0e3f776 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,4 +21,4 @@ # png image files # *.png filter=lfs diff=lfs merge=lfs -text -.git_archival.txt export-subst \ No newline at end of file +.git_archival.txt export-subst diff --git a/python-project-template/.pre-commit-config.yaml.jinja b/python-project-template/.pre-commit-config.yaml.jinja index 86041e36..c0401e0f 100644 --- a/python-project-template/.pre-commit-config.yaml.jinja +++ b/python-project-template/.pre-commit-config.yaml.jinja @@ -109,7 +109,7 @@ repos: rev: 44b5042edab9382aba712eed4f9c7bab7a3d6a3e # v0.17.0 hooks: - id: ruff - name: Lint code using ruff; sort and organize imports + name: Lint code using ruff; sort and organize imports types_or: [ python, pyi ] args: ["--fix"] {%- endif %} From 87c21d6a7b2ca764aad8acf747e2f3981f13ef0f Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:29:20 -0400 Subject: [PATCH 3/3] revert --- .git_archival.txt | 2 +- .gitattributes | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index 8fb235d7..b1a286bb 100644 --- a/.git_archival.txt +++ b/.git_archival.txt @@ -1,4 +1,4 @@ node: $Format:%H$ node-date: $Format:%cI$ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ -ref-names: $Format:%D$ +ref-names: $Format:%D$ \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index f0e3f776..343a7554 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,4 +21,4 @@ # png image files # *.png filter=lfs diff=lfs merge=lfs -text -.git_archival.txt export-subst +.git_archival.txt export-subst \ No newline at end of file