Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- [ ] This change includes integration testing, or is small enough to be covered by existing tests
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
if: failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ jobs:
}
}
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
python -m pytest tests -o log_cli=true -vv --python_version ${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion .setup_dev.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

2 changes: 1 addition & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-]*$')) %}
Expand Down
3 changes: 1 addition & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -23,4 +23,3 @@ clean:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ please :doc:`/source/contact`
practices/publishing_package
practices/customizing_project
practices/development_guide

2 changes: 1 addition & 1 deletion docs/practices/ci_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/LSSTDESC/rail/blob/main/.github/workflows/smoke-test.yml#L45-L82>`_
An example can be found in the `rail project <https://github.com/LSSTDESC/rail/blob/main/.github/workflows/smoke-test.yml#L45-L82>`_
2 changes: 1 addition & 1 deletion docs/practices/conda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
repo created above) to publish the new version of the package.
2 changes: 1 addition & 1 deletion docs/practices/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Practices
Still have questions?
--------------------------------

:doc:`/source/contact`
:doc:`/source/contact`
2 changes: 1 addition & 1 deletion docs/practices/pipx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Don't forget to run ``pipx ensurepath`` to finalize the installation.
2 changes: 1 addition & 1 deletion docs/practices/pypi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Releasing new versions

Now, when you
`create a new release <https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release>`_
from your repository, a workflow will run that will package and deploy the code to PyPI.
from your repository, a workflow will run that will package and deploy the code to PyPI.
2 changes: 1 addition & 1 deletion docs/practices/pytest_timing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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!
raw results!
2 changes: 1 addition & 1 deletion docs/practices/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ supports tests embedded in documentation using pytest's
`doctest <https://doc.pytest.org/en/latest/how-to/doctest.html>`_ component.
Documentation comments in all source files, as well as ``.rst`` files in the ``./docs``
directory can contain doctests in the format outlined
`here <https://doc.pytest.org/en/latest/how-to/doctest.html>`_.
`here <https://doc.pytest.org/en/latest/how-to/doctest.html>`_.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
sphinx
sphinx-autoapi
sphinx-copybutton
sphinx-rtd-theme>=3.1.0
sphinx-rtd-theme>=3.1.0
2 changes: 1 addition & 1 deletion docs/source/citation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
}
2 changes: 1 addition & 1 deletion docs/source/configuration_checklist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ Get the most out of this template
Still have questions?
-------------------------------------------------------------------------------

:doc:`/source/contact`
:doc:`/source/contact`
2 changes: 1 addition & 1 deletion docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Do you want to help out, but you're not sure how? :doc:`/source/contact`
2 changes: 1 addition & 1 deletion docs/source/existing_project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ to conclude the setup.
Still have questions?
----------------------------------------

:doc:`/source/contact`
:doc:`/source/contact`
2 changes: 1 addition & 1 deletion docs/source/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ Now choose your next adventure...
-------------------------------------
* :doc:`Start a new project<new_project>`
* :doc:`Configure a new project<configuration_checklist>`
* :doc:`Upgrade an existing project<existing_project>`
* :doc:`Upgrade an existing project<existing_project>`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ profile = "black"
line_length = 110

[tool.pytest.ini_options]
log_cli_level = "INFO"
log_cli_level = "INFO"
2 changes: 1 addition & 1 deletion python-project-template/.github/ISSUE_TEMPLATE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
2 changes: 1 addition & 1 deletion python-project-template/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Change Description
<!---
<!---
Closes #???
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion python-project-template/.initialize_new_project.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion python-project-template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
For more information, see the documentation here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci_benchmarking.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ clean:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Original file line number Diff line number Diff line change
Expand Up @@ -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
Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ nbsphinx
sphinx
sphinx-autoapi
sphinx-copybutton
sphinx-rtd-theme>=3.0
sphinx-rtd-theme>=3.0
20 changes: 10 additions & 10 deletions python-versions.jinja
Original file line number Diff line number Diff line change
@@ -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 -%}
Expand All @@ -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 -%}
{%- endmacro -%}
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ deps =
pylint
commands =
pytest tests

Loading