From 615f376261ef46d1bf7a0f67c8f4419cd47cd641 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 12:30:58 -0400 Subject: [PATCH 1/5] Close Issue 574 --- .pre-commit-config.yaml | 21 +++++++++++++++++-- .../.github/pull_request_template.md | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac6fbbb..c87d06e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,9 +21,14 @@ repos: stages: [pre-commit] language: system entry: jupyter nbconvert --clear-output - # Prevents committing directly branches named 'main' and 'master'. + # Run a series of standard precommit checks, including: + # - no commits to branches named 'main' and 'master'. + # - No large files (>= 500kb) + # - All YAML and TOML files are valid. + # - No whitespace at the end of lines and a single newline at end of file. + # - No outstanding merge conflict markers in the codebase. - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0 hooks: - id: no-commit-to-branch name: Prevent main branch commits @@ -32,6 +37,18 @@ repos: name: Check for large files description: Prevent the user from committing very large files. args: ['--maxkb=500'] + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] # Keep markdown line breaks + name: Fix trailing whitespace + - id: end-of-file-fixer + name: Files end with a newline + - id: check-toml + name: Validate TOML files + - id: check-yaml + args: [--allow-multiple-documents] # Allow multiple document format + name: Validate YAML files + - id: check-merge-conflict + name: Check for merge conflicts # Verify that pyproject.toml is well formed - repo: https://github.com/abravalheri/validate-pyproject rev: 17e12779811926f000bdfa1795f9e3735dd71ac3 diff --git a/python-project-template/.github/pull_request_template.md b/python-project-template/.github/pull_request_template.md index 5f341fd..a8b83bd 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 - From 9c4a3cfc3202f0bbfe869e3979b6b13aba4f20b7 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 12:46:25 -0400 Subject: [PATCH 2/5] fix --- .pre-commit-config.yaml | 2 +- .../.pre-commit-config.yaml.jinja | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c87d06e..e2b49f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: description: Prevent the user from committing very large files. args: ['--maxkb=500'] - id: trailing-whitespace - args: [--markdown-linebreak-ext=md] # Keep markdown line breaks + exclude: \.(rst|md|txt|html)$ # Skip rst, md, txt, and html files name: Fix trailing whitespace - id: end-of-file-fixer name: Files end with a newline diff --git a/python-project-template/.pre-commit-config.yaml.jinja b/python-project-template/.pre-commit-config.yaml.jinja index 86041e3..5023767 100644 --- a/python-project-template/.pre-commit-config.yaml.jinja +++ b/python-project-template/.pre-commit-config.yaml.jinja @@ -21,7 +21,12 @@ repos: stages: [pre-commit] language: system entry: jupyter nbconvert --clear-output - # Prevents committing directly branches named 'main' and 'master'. + # Run a series of standard precommit checks, including: + # - no commits to branches named 'main' and 'master'. + # - No large files (>= 500kb) + # - All YAML and TOML files are valid. + # - No whitespace at the end of lines and a single newline at end of file. + # - No outstanding merge conflict markers in the codebase. - repo: https://github.com/pre-commit/pre-commit-hooks rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0 hooks: @@ -32,6 +37,18 @@ repos: name: Check for large files description: Prevent the user from committing very large files. args: ['--maxkb=500'] + - id: trailing-whitespace + exclude: \.(rst|md|txt|html)$ # Skip rst, md, txt, and html files + name: Fix trailing whitespace + - id: end-of-file-fixer + name: Files end with a newline + - id: check-toml + name: Validate TOML files + - id: check-yaml + args: [--allow-multiple-documents] # Allow multiple document format + name: Validate YAML files + - id: check-merge-conflict + name: Check for merge conflicts # Verify that pyproject.toml is well formed - repo: https://github.com/abravalheri/validate-pyproject rev: 17e12779811926f000bdfa1795f9e3735dd71ac3 # v0.26 From 576df537cccc0a74d0271b45e6b310be7737034e Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 12:48:13 -0400 Subject: [PATCH 3/5] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e2b49f3..2ad994d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -96,7 +96,9 @@ repos: # supported by your project here, or alternatively use # pre-commit's default_language_version, see # https://pre-commit.com/#top_level-default_language_version - language_version: python3.11 + # This currently uses the default language version. Uncomment + # the following line to use the max version. + # language_version: python{{ py.max(python_versions) }} # Run unit tests, verify that they pass. Note that coverage is run against # the ./src directory here because that is what will be committed. In the # github workflow script, the coverage is run against the installed package From e4fd4661eaa65f8b2666002765932aea38184fbd Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 12:49:34 -0400 Subject: [PATCH 4/5] Fix presubmit errors --- .git_archival.txt | 2 +- .gitattributes | 2 +- .github/pull_request_template.md | 2 +- .github/workflows/pre-commit-ci.yml | 2 +- .github/workflows/smoke-test.yml | 4 ++-- .github/workflows/testing-and-coverage.yml | 2 +- .pre-commit-config.yaml | 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/issue_pr_templating.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 +- docs/source/update_project.rst | 2 +- pyproject.toml | 2 +- python-project-template/.git_archival.txt | 2 +- python-project-template/.gitattributes | 2 +- .../.github/ISSUE_TEMPLATE/0-general_issue.md | 2 +- .../.github/ISSUE_TEMPLATE/README.md | 2 +- .../.github/workflows/README.md | 2 +- .../.github/workflows/pre-commit-ci.yml.jinja | 2 +- ...ins_code %}smoke-test.yml{% endif %}.jinja | 6 +++--- ...}testing-and-coverage.yml{% endif %}.jinja | 2 +- ...benchmarks %}asv-main.yml{% endif %}.jinja | 2 +- ...chmarks %}asv-nightly.yml{% endif %}.jinja | 2 +- ...e_benchmarks %}asv-pr.yml{% endif %}.jinja | 2 +- .../.initialize_new_project.sh | 2 +- .../.pre-commit-config.yaml.jinja | 2 +- python-project-template/README.md.jinja | 6 +++--- .../README.md | 2 +- .../asv.conf.json.jinja | 2 +- ...de %}DEVELOPMENT_GUIDE.md{% endif %}.jinja | 1 - .../Makefile.jinja | 1 - .../notebooks/README.md | 2 +- .../requirements.txt.jinja | 2 +- ...icense == 'GPL3' %}LICENSE{% endif%}.jinja | 2 +- python-versions.jinja | 20 +++++++++---------- tox.ini | 1 - 51 files changed, 60 insertions(+), 66 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index b1a286b..8fb235d 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 343a755..f0e3f77 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/.github/pull_request_template.md b/.github/pull_request_template.md index a3e0ee0..41df0d3 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 cbffeda..db2ed2b 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 9eaf488..a1468eb 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -10,7 +10,7 @@ on: # Runs this workflow automatically schedule: - cron: 45 6 * * * - + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -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 fb10015..ace6183 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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ad994d..b14b692 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # Compare the local template version to the latest remote template version - # This hook should always pass. It will print a message if the local version + # This hook should always pass. It will print a message if the local version # is out of date. - repo: https://github.com/lincc-frameworks/pre-commit-hooks rev: 439dda8bd784f4aa721851ecec03877df286f6b5 diff --git a/.setup_dev.sh b/.setup_dev.sh index 5286e41..c09be48 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 af209d7..387d475 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 f5215be..4b054df 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 aa8ae08..20fa136 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 233c867..6cc8acd 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 37b0a97..4cd1922 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 3cfed8e..e9176ce 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/issue_pr_templating.rst b/docs/practices/issue_pr_templating.rst index 4d85f3b..d159b65 100644 --- a/docs/practices/issue_pr_templating.rst +++ b/docs/practices/issue_pr_templating.rst @@ -59,4 +59,4 @@ provides generic fields for: As well as a set of additional project and issue-specific fields. This template only serves as an initial framework, and you should feel free to modify this as -you see fit by directly modifying the template file. \ No newline at end of file +you see fit by directly modifying the template file. diff --git a/docs/practices/overview.rst b/docs/practices/overview.rst index 8d15ada..6741577 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 2627b7a..8f506ff 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 5c2dced..a1484fe 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 981b556..38bf9fc 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 be13496..d0e5cdc 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 4ac568c..bea0e1e 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 1ee3f86..0b1a040 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 6e0845c..ba89ab2 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 f6e616f..13e71ac 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 b7c8cf3..7799c8a 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 bafa1a7..c9b0709 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/docs/source/update_project.rst b/docs/source/update_project.rst index 7a688fd..7cefd7d 100644 --- a/docs/source/update_project.rst +++ b/docs/source/update_project.rst @@ -141,4 +141,4 @@ For all the details about updating with Copier checkout the Still have questions? ------------------------------------- -:doc:`/source/contact` \ No newline at end of file +:doc:`/source/contact` diff --git a/pyproject.toml b/pyproject.toml index cdca29a..e6a6169 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/.git_archival.txt b/python-project-template/.git_archival.txt index b1a286b..8fb235d 100644 --- a/python-project-template/.git_archival.txt +++ b/python-project-template/.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/python-project-template/.gitattributes b/python-project-template/.gitattributes index 343a755..f0e3f77 100644 --- a/python-project-template/.gitattributes +++ b/python-project-template/.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/.github/ISSUE_TEMPLATE/0-general_issue.md b/python-project-template/.github/ISSUE_TEMPLATE/0-general_issue.md index 84bb0d7..0288ee4 100644 --- a/python-project-template/.github/ISSUE_TEMPLATE/0-general_issue.md +++ b/python-project-template/.github/ISSUE_TEMPLATE/0-general_issue.md @@ -5,4 +5,4 @@ title: '' labels: '' assignees: '' ---- \ No newline at end of file +--- diff --git a/python-project-template/.github/ISSUE_TEMPLATE/README.md b/python-project-template/.github/ISSUE_TEMPLATE/README.md index 46dc08e..af7f0c8 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/workflows/README.md b/python-project-template/.github/workflows/README.md index e34a71f..231bf1e 100644 --- a/python-project-template/.github/workflows/README.md +++ b/python-project-template/.github/workflows/README.md @@ -6,4 +6,4 @@ or when you create a new PR. For more information about CI and workflows, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci.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/workflows/pre-commit-ci.yml.jinja b/python-project-template/.github/workflows/pre-commit-ci.yml.jinja index 47e522f..9f40a11 100644 --- a/python-project-template/.github/workflows/pre-commit-ci.yml.jinja +++ b/python-project-template/.github/workflows/pre-commit-ci.yml.jinja @@ -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/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 5784d9a..1a25aa5 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: @@ -122,4 +122,4 @@ jobs: ] } {%- endraw %} -{%- endif %} \ No newline at end of file +{%- endif %} diff --git a/python-project-template/.github/workflows/{% if contains_code %}testing-and-coverage.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if contains_code %}testing-and-coverage.yml{% endif %}.jinja index f620030..5972f33 100644 --- a/python-project-template/.github/workflows/{% if contains_code %}testing-and-coverage.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if contains_code %}testing-and-coverage.yml{% endif %}.jinja @@ -83,4 +83,4 @@ jobs: run: | source venv/bin/activate python -m pytest -{%- endif %} \ No newline at end of file +{%- endif %} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja index 2eb356d..1b7b295 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja @@ -73,4 +73,4 @@ jobs: with: branch: gh-pages folder: ${{env.WORKING_DIR}}/_html -{%- endraw -%} \ No newline at end of file +{%- endraw -%} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja index 745b136..8282fdf 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja @@ -79,4 +79,4 @@ jobs: with: path: ${{env.WORKING_DIR}} key: nightly-results-${{steps.nightly-dates.outputs.today}} -{%- endraw -%} \ No newline at end of file +{%- endraw -%} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja index 511785a..babafbb 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja @@ -78,4 +78,4 @@ jobs: with: name: benchmark-artifacts path: ${{env.ARTIFACTS_DIR}} -{%- endraw -%} \ No newline at end of file +{%- endraw -%} diff --git a/python-project-template/.initialize_new_project.sh b/python-project-template/.initialize_new_project.sh index 2693260..9f55632 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/.pre-commit-config.yaml.jinja b/python-project-template/.pre-commit-config.yaml.jinja index 5023767..837e9de 100644 --- a/python-project-template/.pre-commit-config.yaml.jinja +++ b/python-project-template/.pre-commit-config.yaml.jinja @@ -126,7 +126,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 %} diff --git a/python-project-template/README.md.jinja b/python-project-template/README.md.jinja index 2913a20..777dee0 100644 --- a/python-project-template/README.md.jinja +++ b/python-project-template/README.md.jinja @@ -15,13 +15,13 @@ [![Benchmarks](https://img.shields.io/github/actions/workflow/status/{{project_organization}}/{{project_name}}/asv-main.yml?label=benchmarks)](https://{{project_organization}}.github.io/{{project_name}}/) {%- endif %} -This project was automatically generated using the LINCC-Frameworks +This project was automatically generated using the LINCC-Frameworks [python-project-template](https://github.com/lincc-frameworks/python-project-template). A repository badge was added to show that this project uses the python-project-template, however it's up to you whether or not you'd like to display it! -For more information about the project template see the +For more information about the project template see the [documentation](https://lincc-ppt.readthedocs.io/en/latest/). ## Dev Guide - Getting Started @@ -47,7 +47,7 @@ development using the following commands: Notes: 1. `./.setup_dev.sh` will initialize pre-commit for this local repository, so that a set of tests will be run prior to completing a local commit. For more - information, see the Python Project Template documentation on + information, see the Python Project Template documentation on [pre-commit](https://lincc-ppt.readthedocs.io/en/latest/practices/precommit.html) {%- if include_notebooks %} 2. Install `pandoc` allows you to verify that automatic rendering of Jupyter notebooks 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 5259778..cc65fa7 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 590c076..2830236 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_dev_guide %}DEVELOPMENT_GUIDE.md{% endif %}.jinja b/python-project-template/{% if include_dev_guide %}DEVELOPMENT_GUIDE.md{% endif %}.jinja index da6d001..dc1b89d 100644 --- a/python-project-template/{% if include_dev_guide %}DEVELOPMENT_GUIDE.md{% endif %}.jinja +++ b/python-project-template/{% if include_dev_guide %}DEVELOPMENT_GUIDE.md{% endif %}.jinja @@ -65,4 +65,3 @@ benchmarks/ ASV performance benchmarks - **File naming:** `tests/{{package_name}}//test_.py`, mirroring the `src/{{package_name}}/` layout. - **Fixtures:** defined in `tests/conftest.py`. Use existing fixtures, do not duplicate test data. - Default test run: `python -m pytest` - 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 e32f1af..075e18c 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 2b4fb45..3049d4a 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 e96005e..2d23c8c 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-project-template/{% if project_license == 'GPL3' %}LICENSE{% endif%}.jinja b/python-project-template/{% if project_license == 'GPL3' %}LICENSE{% endif%}.jinja index e72bfdd..f288702 100644 --- a/python-project-template/{% if project_license == 'GPL3' %}LICENSE{% endif%}.jinja +++ b/python-project-template/{% if project_license == 'GPL3' %}LICENSE{% endif%}.jinja @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. diff --git a/python-versions.jinja b/python-versions.jinja index 0845287..28d7745 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 3db556f..31a7f70 100644 --- a/tox.ini +++ b/tox.ini @@ -9,4 +9,3 @@ deps = pylint commands = pytest tests - From 83032d6f1f1098473b42a9d6400d3b7baf055397 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:03:28 -0400 Subject: [PATCH 5/5] Add newlines --- .../{% if include_benchmarks %}asv-main.yml{% endif %}.jinja | 1 + .../{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja | 1 + .../{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja | 1 + ...clude_benchmarks %}publish-benchmarks-pr.yml{% endif %}.jinja | 1 + 4 files changed, 4 insertions(+) diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja index 1b7b295..5aaa2e9 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-main.yml{% endif %}.jinja @@ -73,4 +73,5 @@ jobs: with: branch: gh-pages folder: ${{env.WORKING_DIR}}/_html + {%- endraw -%} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja index 8282fdf..3459efc 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-nightly.yml{% endif %}.jinja @@ -79,4 +79,5 @@ jobs: with: path: ${{env.WORKING_DIR}} key: nightly-results-${{steps.nightly-dates.outputs.today}} + {%- endraw -%} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja index babafbb..5440bea 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}asv-pr.yml{% endif %}.jinja @@ -78,4 +78,5 @@ jobs: with: name: benchmark-artifacts path: ${{env.ARTIFACTS_DIR}} + {%- endraw -%} diff --git a/python-project-template/.github/workflows/{% if include_benchmarks %}publish-benchmarks-pr.yml{% endif %}.jinja b/python-project-template/.github/workflows/{% if include_benchmarks %}publish-benchmarks-pr.yml{% endif %}.jinja index f1aa290..70c53fa 100644 --- a/python-project-template/.github/workflows/{% if include_benchmarks %}publish-benchmarks-pr.yml{% endif %}.jinja +++ b/python-project-template/.github/workflows/{% if include_benchmarks %}publish-benchmarks-pr.yml{% endif %}.jinja @@ -55,4 +55,5 @@ jobs: issue-number: ${{ steps.pr-info.outputs.pr }} body-path: output edit-mode: replace + {%- endraw -%}