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
5 changes: 3 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changes here will be overwritten by Copier
_commit: v2.1.2
_commit: v2.2.0
_src_path: gh://lincc-frameworks/python-project-template
author_email: lincc-frameworks-team@lists.lsst.org
author_name: LINCC Frameworks
create_example_module: false
custom_install: true
custom_install: custom
enforce_style:
- pylint
- black
Expand All @@ -14,6 +14,7 @@ include_benchmarks: false
include_docs: false
mypy_type_checking: none
package_name: pre_commit_hooks
project_description: Pre-Commit Hooks for LINCC Frameworks Python Project Template
project_license: BSD
project_name: template-version-check
project_organization: lincc-frameworks
Expand Down
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ assignees: ''
**Environment Information**


<details>
<summary>Traceback</summary>

FILL IN YOUR STACK TRACE HERE

</details>

**Before submitting**
Please check the following:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
# 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: v0.1.2
rev: v0.2.2
hooks:
- id: check-lincc-frameworks-template-version
name: Check template version
Expand All @@ -23,7 +23,7 @@ repos:
entry: jupyter nbconvert --clear-output
# Prevents committing directly branches named 'main' and 'master'.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
name: Prevent main branch commits
Expand All @@ -41,13 +41,13 @@ repos:
description: Verify that pyproject.toml adheres to the established schema.
# Verify that GitHub workflows are well formed
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
rev: 0.36.1
hooks:
- id: check-github-workflows
args: ["--verbose"]
# Automatically sort the imports used in .py files
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 7.0.0
hooks:
- id: isort
name: Run isort
Expand Down Expand Up @@ -85,7 +85,7 @@ repos:
]
# Analyze the code style and report code that doesn't adhere.
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 26.1.0
hooks:
- id: black-jupyter
name: Format code using black
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ readme = "README.md"
authors = [
{ name = "LINCC Frameworks", email = "lincc-frameworks-team@lists.lsst.org" }
]
description = "Pre-Commit Hooks for LINCC Frameworks Python Project Template"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -59,7 +60,6 @@ addopts = "--doctest-modules --doctest-glob=*.rst"

[tool.black]
line-length = 110
target-version = ["py39"]
[tool.isort]
profile = "black"
line_length = 110
Expand Down
Empty file added requirements.txt
Empty file.
36 changes: 12 additions & 24 deletions tests/pre_commit_hooks/test_pre_executed_nb_never_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
def test_nb_never_metadata(caplog, capsys, tmp_path):
notebook_path = tmp_path / "empty_metadata.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""{
fh.write("""{
"metadata": {
"nbsphinx": {
"execute": "never"
Expand All @@ -14,8 +13,7 @@ def test_nb_never_metadata(caplog, capsys, tmp_path):
"nbformat": 4,
"nbformat_minor": 5
}
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 0

Expand All @@ -29,15 +27,13 @@ def test_nb_never_metadata(caplog, capsys, tmp_path):
def test_nb_empty_metadata(caplog, tmp_path):
notebook_path = tmp_path / "empty_metadata.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""{
fh.write("""{
"metadata": {
},
"nbformat": 4,
"nbformat_minor": 5
}
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 1

Expand All @@ -49,13 +45,11 @@ def test_nb_empty_metadata(caplog, tmp_path):
def test_nb_no_metadata(caplog, tmp_path):
notebook_path = tmp_path / "no_metadata.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""{
fh.write("""{
"nbformat": 4,
"nbformat_minor": 5
}
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 1

Expand All @@ -67,16 +61,14 @@ def test_nb_no_metadata(caplog, tmp_path):
def test_nb_always_executes(caplog, tmp_path):
notebook_path = tmp_path / "always_execute.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""{
fh.write("""{
"metadata": {
"nbsphinx": {
"execute": "always"
}
}
}
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 1

Expand All @@ -88,14 +80,12 @@ def test_nb_always_executes(caplog, tmp_path):
def test_nb_metadata_wrong_type(caplog, tmp_path):
notebook_path = tmp_path / "wrong_metadata.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""{
fh.write("""{
"metadata": {
"nbsphinx": "never"
}
}
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 1

Expand All @@ -107,11 +97,9 @@ def test_nb_metadata_wrong_type(caplog, tmp_path):
def test_nb_not_a_nb(caplog, tmp_path):
notebook_path = tmp_path / "not_a_nb.ipynb"
with notebook_path.open("w") as fh:
fh.write(
"""# README
fh.write("""# README
Hey man, this is just a readme.
"""
)
""")
result = pre_executed_nb_never_execute.main(tmp_path)
assert result == 1

Expand Down