diff --git a/.copier-answers.yml b/.copier-answers.yml index 23c4d24..f54acce 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -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 @@ -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 diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md index 20fd071..84e10bc 100644 --- a/.github/ISSUE_TEMPLATE/1-bug_report.md +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -12,6 +12,13 @@ assignees: '' **Environment Information** +
+Traceback + +FILL IN YOUR STACK TRACE HERE + +
+ **Before submitting** Please check the following: diff --git a/.github/workflows/pre-commit-ci.yml b/.github/workflows/pre-commit-ci.yml index aca3579..392feed 100644 --- a/.github/workflows/pre-commit-ci.yml +++ b/.github/workflows/pre-commit-ci.yml @@ -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 diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index f3a254f..d190a60 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -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 diff --git a/.github/workflows/testing-and-coverage.yml b/.github/workflows/testing-and-coverage.yml index 287e636..14cebdb 100644 --- a/.github/workflows/testing-and-coverage.yml +++ b/.github/workflows/testing-and-coverage.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb268ca..2ff0924 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index e8d8121..d8f5d66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/pre_commit_hooks/test_pre_executed_nb_never_execute.py b/tests/pre_commit_hooks/test_pre_executed_nb_never_execute.py index 8332e98..2d62cc8 100644 --- a/tests/pre_commit_hooks/test_pre_executed_nb_never_execute.py +++ b/tests/pre_commit_hooks/test_pre_executed_nb_never_execute.py @@ -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" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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