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: 2 additions & 3 deletions .github/workflows/docs_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
docs:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
name: "Flake8"
permissions:
contents: read
runs-on: "ubuntu-22.04"

steps:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
permissions:
contents: read
name: "mypy / ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/octocheese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -79,6 +77,9 @@ jobs:

Coverage:
needs: tests
permissions:
actions: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -128,7 +129,10 @@ jobs:

Deploy:
needs: tests

permissions:
actions: write
issues: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -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/')
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ docs/_build/
doc/build
target/
.ipynb_checkpoints
.python-version
celerybeat-schedule
celerybeat.pid
*.sage.py
Expand Down
18 changes: 11 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc-source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
1 change: 1 addition & 0 deletions doc-source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 7 additions & 23 deletions formate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70
squish_stubs = 80
newline_after_equals = 90

[hooks.yapf]
priority = 30
Expand All @@ -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
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion make_conda_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
- {author}
- github.com/{github_username}

"""
""",
)

print(f"Wrote recipe to {recipe_dir / 'meta.yaml'}")
Expand Down
14 changes: 8 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -90,22 +90,24 @@ 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
flake8-slots>=0.1.0
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
git+https://github.com/python-formate/flake8-unused-arguments.git@magic-methods
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]
Expand Down Expand Up @@ -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 = """
Expand Down
Loading