From e0801d81fce8fe9b03c27397d4b46e4ca5e82f2b Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 15:19:04 +0000 Subject: [PATCH 1/2] Updated files with 'repo_helper'. --- .github/workflows/docs_test_action.yml | 5 ++--- .github/workflows/flake8.yml | 5 ++--- .github/workflows/mypy.yml | 5 ++--- .github/workflows/octocheese.yml | 5 ++--- .github/workflows/python_ci.yml | 8 +++---- .github/workflows/python_ci_linux.yml | 18 ++++++++++------ .github/workflows/python_ci_macos.yml | 8 +++---- .gitignore | 1 - .pre-commit-config.yaml | 18 ++++++++++------ .style.yapf | 2 +- README.rst | 4 ++-- doc-source/index.rst | 2 +- doc-source/requirements.txt | 1 + formate.toml | 30 ++++++-------------------- justfile | 3 +++ tox.ini | 14 ++++++------ 16 files changed, 59 insertions(+), 70 deletions(-) diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index 81c4025..dc03fd3 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -9,11 +9,10 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: docs: + permissions: + contents: read runs-on: ubuntu-latest steps: - name: Checkout 🛎️ diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 5e67c5c..1ecb7b9 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -10,12 +10,11 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: Run: name: "Flake8" + permissions: + contents: read runs-on: "ubuntu-22.04" steps: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 4c22a52..b889816 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -10,11 +10,10 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: Run: + permissions: + contents: read name: "mypy / ${{ matrix.os }}" runs-on: ${{ matrix.os }} diff --git a/.github/workflows/octocheese.yml b/.github/workflows/octocheese.yml index 8fcf700..0a8a91a 100644 --- a/.github/workflows/octocheese.yml +++ b/.github/workflows/octocheese.yml @@ -6,11 +6,10 @@ on: schedule: - cron: 0 12 * * * -permissions: - contents: write - jobs: Run: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: domdfcoding/octocheese@master diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 8aa2808..c8d55e4 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -11,13 +11,11 @@ on: pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "windows-2022 / Python ${{ matrix.config.python-version }}" runs-on: "windows-2022" continue-on-error: ${{ matrix.config.experimental }} diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index d8051f4..cb8ec3e 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -12,13 +12,11 @@ on: - '*' pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}" runs-on: "ubuntu-22.04" continue-on-error: ${{ matrix.config.experimental }} @@ -79,6 +77,9 @@ jobs: Coverage: needs: tests + permissions: + actions: write + contents: read runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ @@ -128,7 +129,10 @@ jobs: Deploy: needs: tests - + permissions: + actions: write + issues: write + contents: read runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ @@ -159,7 +163,7 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - skip_existing: true + skip-existing: true - name: Close milestone 🚪 if: startsWith(github.ref, 'refs/tags/') diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 5c5c896..7901196 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -11,13 +11,11 @@ on: pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}" runs-on: "macos-${{ matrix.config.os-ver }}" continue-on-error: ${{ matrix.config.experimental }} diff --git a/.gitignore b/.gitignore index 909d9fa..0a85809 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,6 @@ docs/_build/ doc/build target/ .ipynb_checkpoints -.python-version celerybeat-schedule celerybeat.pid *.sage.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c360a5a..62859e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ ci: repos: - repo: https://github.com/repo-helper/pyproject-parser - rev: v0.13.0 + rev: v0.14.0 hooks: - id: reformat-pyproject @@ -18,7 +18,6 @@ repos: - id: check-added-large-files - id: check-ast - id: fix-byte-order-marker - - id: check-byte-order-marker - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json @@ -33,7 +32,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/domdfcoding/pre-commit-hooks - rev: v0.4.0 + rev: v0.6.0 hooks: - id: requirements-txt-sorter args: @@ -61,8 +60,8 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.0 + - repo: https://github.com/python-formate/pyupgrade + rev: '2e49872' hooks: - id: pyupgrade args: @@ -81,13 +80,18 @@ repos: - id: snippet-fmt - repo: https://github.com/python-formate/formate - rev: v0.8.0 + rev: v1.2.0 hooks: - id: formate exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$ + additional_dependencies: + - formate-trailing-commas>=0.1.1 + types_or: + - python + - pyi - repo: https://github.com/python-coincidence/dep_checker - rev: v0.8.0 + rev: v0.9.0 hooks: - id: dep_checker args: diff --git a/.style.yapf b/.style.yapf index e64be7c..9378f04 100644 --- a/.style.yapf +++ b/.style.yapf @@ -312,7 +312,7 @@ split_before_dict_set_generator=True # # foo = ('This is a really long string: {}, {}, {}, {}' # .format(a, b, c, d)) -split_before_dot=False +split_before_dot=True # Split after the opening paren which surrounds an expression if it doesn't # fit on a single line. diff --git a/README.rst b/README.rst index 63c1d02..2e34c94 100644 --- a/README.rst +++ b/README.rst @@ -98,11 +98,11 @@ notebook2script :target: https://github.com/PyMassSpec/notebook2script/commit/master :alt: GitHub last commit -.. |maintained| image:: https://img.shields.io/maintenance/yes/2025 +.. |maintained| image:: https://img.shields.io/maintenance/yes/2026 :alt: Maintenance .. |pypi-downloads| image:: https://img.shields.io/pypi/dm/notebook2script - :target: https://pypi.org/project/notebook2script/ + :target: https://pypistats.org/packages/notebook2script :alt: PyPI - Downloads .. end shields diff --git a/doc-source/index.rst b/doc-source/index.rst index 9ffc4b4..e5e7180 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -104,7 +104,7 @@ notebook2script :last-commit: :alt: GitHub last commit - .. |maintained| maintained-shield:: 2025 + .. |maintained| maintained-shield:: 2026 :alt: Maintenance .. |pypi-downloads| pypi-shield:: diff --git a/doc-source/requirements.txt b/doc-source/requirements.txt index 29ec6c0..f0198bc 100644 --- a/doc-source/requirements.txt +++ b/doc-source/requirements.txt @@ -6,6 +6,7 @@ furo==2021.06.18b36 html-section>=0.3.0 roman>=4.0 seed-intersphinx-mapping>=1.2.2 +setuptools<81 sphinx>=3.0.3 sphinx-copybutton>=0.5.2 sphinx-debuginfo>=0.2.2 diff --git a/formate.toml b/formate.toml index 087eb9d..585d007 100644 --- a/formate.toml +++ b/formate.toml @@ -5,6 +5,7 @@ reformat-generics = 40 noqa-reformat = 60 ellipsis-reformat = 70 squish_stubs = 80 +newline_after_equals = 90 [hooks.yapf] priority = 30 @@ -27,32 +28,15 @@ lines_between_types = 0 use_parentheses = true remove_redundant_aliases = true default_section = "THIRDPARTY" -known_third_party = [ - "astroid", - "click", - "coincidence", - "consolekit", - "coverage", - "coverage_pyver_pragma", - "domdf_python_tools", - "github", - "importlib_metadata", - "ipython", - "isort", - "nbconvert", - "pre_commit_hooks", - "pylint", - "pytest", - "pytest_cov", - "pytest_randomly", - "pytest_rerunfailures", - "pytest_timeout", - "requests", - "yapf_isort", -] known_first_party = [ "notebook2script",] line_length = 115 +[hooks.trailing_commas] +priority = 21 + +[hooks.trailing_commas.kwargs] +format_ImportFrom = false + [config] indent = " " line_length = 115 diff --git a/justfile b/justfile index e8ed871..9cd8b78 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,9 @@ unused-imports: incomplete-defs: tox -e lint -- --select MAN +commas: + tox -e lint -- --select C810,C812,C813,C814,C815,C816 + vdiff: git diff $(repo-helper show version -q)..HEAD diff --git a/tox.ini b/tox.ini index fff73e7..8f84e12 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ requires = pip>=21,!=22.2 tox-envlist>=0.2.1 tox~=3.0 - virtualenv!=20.16.0 + virtualenv!=20.16.0,<20.39 [envlists] test = py37, py38, py39, py310 @@ -90,7 +90,7 @@ deps = flake8-dunder-all>=0.1.1 flake8-encodings>=0.1.0 flake8-github-actions>=0.1.0 - flake8-noqa>=1.1.0,<=1.2.2 + git+https://github.com/python-formate/flake8-noqa.git@v1.2.2-python-formate.0 flake8-pyi>=20.10.0,<=22.8.0 flake8-pytest-style>=1.3.0,<2 flake8-quotes>=3.3.0 @@ -98,6 +98,9 @@ deps = flake8-sphinx-links>=0.0.4 flake8-strftime>=0.1.1 flake8-typing-imports>=1.10.0 + flake8-params>=0.1.0 + flake8-unused-fstrings>=2.0.0 + git+https://github.com/python-formate/flake8-commas.git@4.0.0-python-formate.0 git+https://github.com/domdfcoding/restructuredtext-lint.git@fix-deprecations git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git git+https://github.com/domdfcoding/flake8-rst-docstrings.git @@ -105,7 +108,6 @@ deps = git+https://github.com/python-formate/flake8-missing-annotations.git git+https://github.com/domdfcoding/pydocstyle.git@stub-functions pygments>=2.7.1 - importlib_metadata<4.5.0; python_version<'3.8' commands = python3 -m flake8_rst_docstrings_sphinx notebook2script tests --allow-toolbox {posargs} [testenv:perflint] @@ -164,11 +166,11 @@ rst-directives = license-info rst-roles = choosealicense per-file-ignores = - notebook2script/pointless_checker/__init__.py: PRM002 - notebook2script/pointless_checker/base.py: PRM002 - notebook2script/pointless.py: PRM002 tests/*: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 PRM001 PRM002 PRM003 */*.pyi: E301 E302 E305 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 PRM001 PRM002 PRM003 + notebook2script/pointless.py: PRM002 + notebook2script/pointless_checker/__init__.py: PRM002 + notebook2script/pointless_checker/base.py: PRM002 pytest-parametrize-names-type = csv inline-quotes = " multiline-quotes = """ From 09ff9f9e6c677160095fa18efe0146d56167d8d5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 15:19:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- make_conda_recipe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_conda_recipe.py b/make_conda_recipe.py index 4ea6b53..73c33fa 100755 --- a/make_conda_recipe.py +++ b/make_conda_recipe.py @@ -84,7 +84,7 @@ - {author} - github.com/{github_username} -""" +""", ) print(f"Wrote recipe to {recipe_dir / 'meta.yaml'}")