From 10f3bbf1a74e7cc431c978430f1f2b8fe285f153 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 9 Feb 2024 19:05:38 +0000 Subject: [PATCH 001/265] Make a tox.ini which is more sunpy like - Mk II (#26) * Make a tox.ini which is more sunpy like * Add the tox pypi filter req * Fix pytest-cov * Fix coverage yml * Sack off pre-commit * maybe this will fix the py39 build? * reduce env_list. --- .../pyproject.toml | 3 +- {{ cookiecutter.package_name }}/tox.ini | 70 ++++++++++--------- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 65f11d9..b62d903 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -33,9 +33,10 @@ open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.exampl {% endif -%} [project.optional-dependencies] -test = [ +tests = [ "pytest", "pytest-doctestplus", + "pytest-cov", ] docs = [ "sphinx", diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 549c04e..99a6387 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -1,57 +1,63 @@ [tox] min_version = 4.0 +requires = + tox-pypi-filter>=0.14 envlist = - py{38,39,310,311}-test - py38-test-oldestdeps + py{39,310,311,312} + py312-devdeps + py39-oldestdeps build_docs -isolated_build = true [testenv] -# tox environments are constructed with so-called 'factors' (or terms) -# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: -# will only take effect if that factor is included in the environment name. To -# see a list of example environments that can be run, along with a description, -# run: -# -# tox -l -v -# +pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt +# Run the tests in a temporary directory to make sure that we don't import +# the package from the source tree +change_dir = .tmp/{envname} description = run tests oldestdeps: with the oldest supported version of key dependencies + devdeps: with the latest developer version of key dependencies -# Pass through the following environment variables which may be needed for the CI -pass_env = - HOME - WINDIR - LC_ALL - LC_CTYPE - CC - CI - TRAVIS - -# Suppress display of matplotlib plots generated during docs build -set_env = +set_env = MPLBACKEND=agg - -# Run the tests in a temporary directory to make sure that we don't import -# the package from the source tree -change_dir = .tmp/{envname} + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + # Define the base test command here to allow us to add more flags for each tox factor + PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/pyproject.toml {toxinidir}/docs deps = + # For packages which publish nightly wheels this will pull the latest nightly + devdeps: numpy>=0.0.dev0 + # Packages without nightly wheels will be built from source like this + # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies - pytest-cov -# The following indicates which extras_require from setup.cfg will be installed +# The following indicates which extras_require will be installed extras = - test + tests commands_pre = oldestdeps: minimum_dependencies packagename --filename requirements-min.txt oldestdeps: pip install -r requirements-min.txt - pip freeze + pip freeze --all --no-input commands = - pytest --pyargs packagename --cov {{ cookiecutter.module_name }} --cov-report xml:coverage.xml --cov-report term-missing {posargs} + # To run different commands for different factors exclude the factor from the default command like this + # !online: {env:PYTEST_COMMAND} {posargs} + # Then specify a specific one like this + # online: {env:PYTEST_COMMAND} --remote-data=any {posargs} + # If you have no factors which require different commands this is all you need: + {env:PYTEST_COMMAND} {posargs} + +# Uncomment this once we add pre-commit +#[testenv:codestyle] +#pypi_filter = +#skip_install = true +#description = Run all style and file checks with pre-commit +#deps = +# pre-commit +#commands = +# pre-commit install-hooks +# pre-commit run --color always --all-files --show-diff-on-failure [testenv:build_docs] description = invoke sphinx-build to build the HTML docs From 013e2e3a2a1fd703718f77afdc3fd851699cae40 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 13 Feb 2024 09:04:13 +0000 Subject: [PATCH 002/265] First version of sunpy test workflow - Mk II (#27) * First version of sunpy test workflow * escape github actions syntax for jinja * Make global python be a template variable * Add binary wheel builds for compiled extension mode --- .../.github/workflows/ci.yml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/.github/workflows/ci.yml diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml new file mode 100644 index 0000000..ce62e2b --- /dev/null +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -0,0 +1,129 @@ +{% set default_python = '3.10' %} +name: CI + +on: + push: + branches: + - 'main' + - '*.*' + - '!*backport*' + tags: + - 'v*' + - '!*dev*' + - '!*pre*' + - '!*post*' + pull_request: + # Allow manual runs through the web UI + workflow_dispatch: + +concurrency: + group: {{ '${{ github.workflow }}-${{ github.ref }}' }} + cancel-in-progress: true + +jobs: + core: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + submodules: false + coverage: codecov + toxdeps: tox-pypi-filter + envs: | + - linux: py312 + secrets: + CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} + + sdist_verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '{{ default_python }}' + - run: python -m pip install -U --user build + - run: python -m build . --sdist + - run: python -m pip install -U --user twine + - run: python -m twine check dist/* + + test: + needs: [core, sdist_verify] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + submodules: false + coverage: codecov + toxdeps: tox-pypi-filter + posargs: -n auto + envs: | + - windows: py311 + - macos: py310 + - linux: py310-oldestdeps + secrets: + CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} + + docs: + needs: [core] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + default_python: '{{ default_python }}' + submodules: false + pytest: false + toxdeps: tox-pypi-filter + envs: | + - linux: build_docs + + cron: + if: | + github.event_name == 'workflow_dispatch' || ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Run cron CI') + ) + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + default_python: '{{ default_python }}' + submodules: false + coverage: codecov + toxdeps: tox-pypi-filter + envs: | + - linux: py311-devdeps + secrets: + CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} + +{% if cookiecutter.use_compiled_extensions == 'y' -%} + publish: + # Build wheels when pushing to any branch except main + # publish.yml will only publish if tagged ^v.* + if: | + ( + github.event_name != 'pull_request' && ( + github.ref_name != 'main' || + github.event_name == 'workflow_dispatch' + ) + ) || ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Run publish') + ) + needs: [test, docs] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main + with: + sdist: true + test_extras: 'tests' + test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' + submodules: false + targets: | + - cp3{9,10,11,12}-manylinux*_x86_64 + - cp3{9,10,11,12}-macosx_x86_64 + - cp3{9,10,11,12}-macosx_arm64 + - cp3{9,10,11,12}-win_amd64 + secrets: + pypi_token: {{ '${{ secrets.pypi_token }}' }} +{%- else -%} + publish_pure: + needs: [test, docs] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + with: + python-version: '{{ default_python }}' + test_extras: 'tests' + test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' + submodules: false + secrets: + pypi_token: {{ '${{ secrets.pypi_token }}' }} +{%- endif %} From 078717a0c77c87e16a7e3f3425b66ecf62a6827f Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Wed, 14 Feb 2024 15:19:25 +0000 Subject: [PATCH 003/265] Adds pre-commit and linting support (#29) * Updating from SunPy core test * lessons sunpy example update applied * Adds docs configuration Inculdes supporting conda environment configuration * Adds basic pre commit hook functionality * Cleaning up .gitignore * Adds linting functionality * Addressing PR comments * Fixes errors in pre-commit configurations * Update {{ cookiecutter.package_name }}/licenses/TEMPLATE_LICENSE.rst --------- Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.flake8 | 27 ++++ {{ cookiecutter.package_name }}/.gitignore | 141 +++++++++++++++--- .../.pre-commit-config.yml | 22 +++ .../.readthedocs.yaml | 29 ++++ .../.rtd-environment.yml | 7 + {{ cookiecutter.package_name }}/.ruff.toml | 39 +++++ .../licenses/TEMPLATE_LICENSE.rst | 6 +- 7 files changed, 247 insertions(+), 24 deletions(-) create mode 100644 {{ cookiecutter.package_name }}/.flake8 create mode 100644 {{ cookiecutter.package_name }}/.pre-commit-config.yml create mode 100644 {{ cookiecutter.package_name }}/.readthedocs.yaml create mode 100644 {{ cookiecutter.package_name }}/.rtd-environment.yml create mode 100644 {{ cookiecutter.package_name }}/.ruff.toml diff --git a/{{ cookiecutter.package_name }}/.flake8 b/{{ cookiecutter.package_name }}/.flake8 new file mode 100644 index 0000000..aa349c3 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.flake8 @@ -0,0 +1,27 @@ +[flake8] +ignore = + # missing-whitespace-around-operator + E225 + # missing-whitespace-around-arithmetic-operator + E226 + # line-too-long + E501 + # unused-import + F401 + # undefined-local-with-import-star + F403 + # redefined-while-unused + F811 + # Line break occurred before a binary operator + W503, + # Line break occurred after a binary operator + W504 +max-line-length = 110 +exclude = + .git + __pycache__ + docs/conf.py + build + {{ cookiecutter.package_name }}/__init__.py, +rst-directives = + plot diff --git a/{{ cookiecutter.package_name }}/.gitignore b/{{ cookiecutter.package_name }}/.gitignore index 8fb9b8a..84749f7 100644 --- a/{{ cookiecutter.package_name }}/.gitignore +++ b/{{ cookiecutter.package_name }}/.gitignore @@ -1,13 +1,17 @@ +### Python: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class +tmp/ # C extensions *.so # Distribution / packaging .Python +pip-wheel-metadata/ build/ develop-eggs/ dist/ @@ -99,13 +103,6 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - # pdm # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. #pdm.lock @@ -133,10 +130,6 @@ ENV/ env.bak/ venv.bak/ -# Spyder project settings -.spyderproject -.spyproject - # Rope project settings .ropeproject @@ -145,21 +138,127 @@ venv.bak/ # mypy .mypy_cache/ -.dmypy.json -dmypy.json # Pyre type checker .pyre/ +# IDE +# PyCharm +.idea + +# Spyder project settings +.spyderproject +.spyproject + +### VScode: https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore +.vscode/* +.vs/* + +### https://raw.github.com/github/gitignore/master/Global/OSX.gitignore +.DS_Store +.AppleDouble +.LSOverride + +# Icon must ends with two \r. +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +### Linux: https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + # pytype static type analyzer .pytype/ -# Cython debug symbols -cython_debug/ +# General +.DS_Store +.AppleDouble +.LSOverride -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Windows: https://raw.githubusercontent.com/github/gitignore/master/Global/Windows.gitignore + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### Extra Python Items and SunPy Specific +docs/whatsnew/latest_changelog.txt +examples/**/*.csv +figure_test_images* +tags +baseline + +# Release script +.github_cache + +# Misc Stuff +.history +*.orig +.tmp +node_modules/ +package-lock.json +package.json +.prettierrc + +# Log files generated by 'vagrant up' +*.log diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yml b/{{ cookiecutter.package_name }}/.pre-commit-config.yml new file mode 100644 index 0000000..59d7541 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yml @@ -0,0 +1,22 @@ +repos: + # This should be before any formatting hooks like isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.2.1" + hooks: + - id: ruff + args: ["--fix"] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: trailing-whitespace + exclude: ".*(.fits|.fts|.fit|.header|.txt)$" + - id: check-yaml + - id: debug-statements + - id: check-added-large-files + args: ["--enforce-all", "--maxkb=1054"] + - id: end-of-file-fixer + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" + - id: mixed-line-ending + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" diff --git a/{{ cookiecutter.package_name }}/.readthedocs.yaml b/{{ cookiecutter.package_name }}/.readthedocs.yaml new file mode 100644 index 0000000..790abab --- /dev/null +++ b/{{ cookiecutter.package_name }}/.readthedocs.yaml @@ -0,0 +1,29 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "mambaforge-4.10" + jobs: + post_checkout: + - git fetch --unshallow || true + pre_install: + - git update-index --assume-unchanged .rtd-environment.yml docs/conf.py + +conda: + environment: .rtd-environment.yml + +sphinx: + builder: html + configuration: docs/conf.py + fail_on_warning: false + +formats: + - htmlzip + +python: + install: + - method: pip + extra_requirements: + - docs + path: . diff --git a/{{ cookiecutter.package_name }}/.rtd-environment.yml b/{{ cookiecutter.package_name }}/.rtd-environment.yml new file mode 100644 index 0000000..16c606e --- /dev/null +++ b/{{ cookiecutter.package_name }}/.rtd-environment.yml @@ -0,0 +1,7 @@ +name: {{ cookiecutter.package_name }} +channels: + - conda-forge +dependencies: + - python=3.10 + - pip + - graphviz!=2.42.*,!=2.43.* diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml new file mode 100644 index 0000000..8a197eb --- /dev/null +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -0,0 +1,39 @@ +target-version = "py310" +line-length = 110 +exclude = [ + ".git,", + "__pycache__", + "build", + "{{ cookiecutter.package_name }}/version.py", +] + +[lint] +select = ["E", "F", "W", "UP", "PT"] +extend-ignore = [ + # pycodestyle (E, W) + "E501", # LineTooLong # TODO! fix + # pytest (PT) + "PT001", # Always use pytest.fixture() + "PT004", # Fixtures which don't return anything should have leading _ + "PT007", # Parametrize should be lists of tuples # TODO! fix + "PT011", # Too broad exception assert # TODO! fix + "PT023", # Always use () on pytest decorators +] + +[flake8-tidy-imports] +[flake8-tidy-imports.banned-api] +"warnings.warn".msg = "Use sunpy specific warning helpers warn_* from sunpy.utils.exceptions" + +[per-file-ignores] +# Part of configuration, not a package. +"setup.py" = ["INP001"] +"conftest.py" = ["INP001"] +# Implicit-namespace-package. The examples are not a package. +"docs/*.py" = ["INP001"] +"__init__.py" = ["E402", "F401", "F403"] +"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] +# Need to import clients to register them, but don't use them in file +"{{ cookiecutter.package_name }}/net/__init__.py" = ["F811"] + +[pydocstyle] +convention = "numpy" diff --git a/{{ cookiecutter.package_name }}/licenses/TEMPLATE_LICENSE.rst b/{{ cookiecutter.package_name }}/licenses/TEMPLATE_LICENSE.rst index f29177b..544a2db 100644 --- a/{{ cookiecutter.package_name }}/licenses/TEMPLATE_LICENSE.rst +++ b/{{ cookiecutter.package_name }}/licenses/TEMPLATE_LICENSE.rst @@ -1,10 +1,10 @@ -This project is based upon the Astropy package template -(https://github.com/astropy/package-template/) which is licenced under the terms +This project is based upon the OpenAstronomy package template +(https://github.com/OpenAstronomy/package-template/) which is licensed under the terms of the following licence. --- -Copyright (c) 2018, Astropy Developers +Copyright (c) 2018, OpenAstronomy Developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, From 2d45e572cdb08623eaab16e8da0a007f2f3f9e96 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 14 Feb 2024 15:36:02 +0000 Subject: [PATCH 004/265] Add pass_env (#30) --- {{ cookiecutter.package_name }}/tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 99a6387..7bb7e9e 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -18,6 +18,14 @@ description = oldestdeps: with the oldest supported version of key dependencies devdeps: with the latest developer version of key dependencies +pass_env = + # Custom compiler locations (such as ccache) + CC + # Location of locales (needed by sphinx on some systems) + LOCALE_ARCHIVE + # If the user has set a LC override we should follow it + LC_ALL + set_env = MPLBACKEND=agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple From c26a53f1c7e99ec96ba4016f48752293b1d21dca Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 16 Feb 2024 09:56:57 +0000 Subject: [PATCH 005/265] Rename .pre-commit-config.yml --- .../{.pre-commit-config.yml => .pre-commit-config.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{ cookiecutter.package_name }}/{.pre-commit-config.yml => .pre-commit-config.yaml} (100%) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml similarity index 100% rename from {{ cookiecutter.package_name }}/.pre-commit-config.yml rename to {{ cookiecutter.package_name }}/.pre-commit-config.yaml From 610b72419cc2535580a39f41ea1c2bb1bc892fd7 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 19 Feb 2024 10:43:44 +0000 Subject: [PATCH 006/265] Add docs/api to the gitignore --- {{ cookiecutter.package_name }}/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.gitignore b/{{ cookiecutter.package_name }}/.gitignore index 84749f7..50cda2b 100644 --- a/{{ cookiecutter.package_name }}/.gitignore +++ b/{{ cookiecutter.package_name }}/.gitignore @@ -79,6 +79,8 @@ instance/ # Sphinx documentation docs/_build/ +# automodapi +docs/api # PyBuilder .pybuilder/ From fdd9f1e439d06f0c646e4424cef7f6617919b1ac Mon Sep 17 00:00:00 2001 From: David Stansby Date: Wed, 21 Feb 2024 15:16:18 +0000 Subject: [PATCH 007/265] Remove old isolated build option in tox --- {{ cookiecutter.package_name }}/tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 741f412..c85172c 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -7,7 +7,6 @@ envlist = py312-devdeps py39-oldestdeps build_docs -isolated_build = true [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt From 74b4ef6d57c2b3f0dac7e8230e918eac94f45403 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 27 Feb 2024 15:26:36 +0000 Subject: [PATCH 008/265] Adds codestyle env to tox.ini (#49) * Adds codestyle env to tox.ini * Attempt to fix pre commit/lining issues * Fix codestyle issues * Passing tox tests and pre-commit * for science --------- Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.ruff.toml | 8 ++++---- {{ cookiecutter.package_name }}/tox.ini | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 8a197eb..bfc789e 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -20,11 +20,11 @@ extend-ignore = [ "PT023", # Always use () on pytest decorators ] -[flake8-tidy-imports] -[flake8-tidy-imports.banned-api] +[lint.flake8-tidy-imports] +[lint.flake8-tidy-imports.banned-api] "warnings.warn".msg = "Use sunpy specific warning helpers warn_* from sunpy.utils.exceptions" -[per-file-ignores] +[lint.per-file-ignores] # Part of configuration, not a package. "setup.py" = ["INP001"] "conftest.py" = ["INP001"] @@ -35,5 +35,5 @@ extend-ignore = [ # Need to import clients to register them, but don't use them in file "{{ cookiecutter.package_name }}/net/__init__.py" = ["F811"] -[pydocstyle] +[lint.pydocstyle] convention = "numpy" diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index c85172c..7cc13f9 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -6,6 +6,7 @@ envlist = py{39,310,311,312} py312-devdeps py39-oldestdeps + codestyle build_docs [testenv] @@ -57,16 +58,15 @@ commands = # If you have no factors which require different commands this is all you need: {env:PYTEST_COMMAND} {posargs} -# Uncomment this once we add pre-commit -#[testenv:codestyle] -#pypi_filter = -#skip_install = true -#description = Run all style and file checks with pre-commit -#deps = -# pre-commit -#commands = -# pre-commit install-hooks -# pre-commit run --color always --all-files --show-diff-on-failure +[testenv:codestyle] +pypi_filter = +skip_install = true +description = Run all style and file checks with pre-commit +deps = + pre-commit +commands = + pre-commit install-hooks + pre-commit run --color always --all-files --show-diff-on-failure [testenv:build_docs] description = invoke sphinx-build to build the HTML docs From 31e62add7400477edda83fa5ac399a5df0b86c89 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 27 Feb 2024 15:42:29 +0000 Subject: [PATCH 009/265] disable pre-commit autofix (#52) --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 59d7541..ab0ad3f 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -20,3 +20,6 @@ repos: exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" - id: mixed-line-ending exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" +ci: + autofix_prs: false + autoupdate_schedule: "quarterly" From e8329e8277792991f1f3b9da67748da515d916a2 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 27 Feb 2024 19:43:37 +0000 Subject: [PATCH 010/265] Adding testing and coverage functionality --- {{ cookiecutter.package_name }}/.codecov.yaml | 11 +++++ {{ cookiecutter.package_name }}/.coveragerc | 34 ++++++++++++++ .../pyproject.toml | 44 ------------------- {{ cookiecutter.package_name }}/pytest.ini | 8 ++++ 4 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 {{ cookiecutter.package_name }}/.codecov.yaml create mode 100644 {{ cookiecutter.package_name }}/.coveragerc create mode 100644 {{ cookiecutter.package_name }}/pytest.ini diff --git a/{{ cookiecutter.package_name }}/.codecov.yaml b/{{ cookiecutter.package_name }}/.codecov.yaml new file mode 100644 index 0000000..33e3794 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.codecov.yaml @@ -0,0 +1,11 @@ +comment: off +coverage: + status: + project: + default: + threshold: 0.2% + +codecov: + require_ci_to_pass: false + notify: + wait_for_ci: true \ No newline at end of file diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc new file mode 100644 index 0000000..f98bd67 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -0,0 +1,34 @@ +[tool.coverage.run] +omit = [ + "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", + "{{ cookiecutter.module_name }}/conftest.py", + "{{ cookiecutter.module_name }}/*setup_package*", + "{{ cookiecutter.module_name }}/tests/*", + "{{ cookiecutter.module_name }}/*/tests/*", + "{{ cookiecutter.module_name }}/extern/*", + "{{ cookiecutter.module_name }}/version*", + "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", + "*/{{ cookiecutter.module_name }}/conftest.py", + "*/{{ cookiecutter.module_name }}/*setup_package*", + "*/{{ cookiecutter.module_name }}/tests/*", + "*/{{ cookiecutter.module_name }}/*/tests/*", + "*/{{ cookiecutter.module_name }}/extern/*", + "*/{{ cookiecutter.module_name }}/version*", +] + +[tool.coverage.report] +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + # Don't complain about packages we have installed + "except ImportError", + # Don't complain if tests don't hit assertions + "raise AssertionError", + "raise NotImplementedError", + # Don't complain about script hooks + "def main(.*):", + # Ignore branches that don't pertain to this version of Python + "pragma: py{ignore_python_version}", + # Don't complain about IPython completion helper + "def _ipython_key_completions_" +] \ No newline at end of file diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index abf1b14..6822f22 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -61,47 +61,3 @@ write_to = "{{ cookiecutter.module_name }}/_version.py" {%- else -%} write_to = "{{ cookiecutter.module_name }}/version.py" {%- endif %} - -[tool.pytest.ini_options] -testpaths = [ - "{{ cookiecutter.module_name }}", - "docs", -] -doctest_plus = "enabled" -text_file_format = "rst" -addopts = "--doctest-rst" - -[tool.coverage.run] -omit = [ - "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "{{ cookiecutter.module_name }}/conftest.py", - "{{ cookiecutter.module_name }}/*setup_package*", - "{{ cookiecutter.module_name }}/tests/*", - "{{ cookiecutter.module_name }}/*/tests/*", - "{{ cookiecutter.module_name }}/extern/*", - "{{ cookiecutter.module_name }}/version*", - "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "*/{{ cookiecutter.module_name }}/conftest.py", - "*/{{ cookiecutter.module_name }}/*setup_package*", - "*/{{ cookiecutter.module_name }}/tests/*", - "*/{{ cookiecutter.module_name }}/*/tests/*", - "*/{{ cookiecutter.module_name }}/extern/*", - "*/{{ cookiecutter.module_name }}/version*", -] - -[tool.coverage.report] -exclude_lines = [ - # Have to re-enable the standard pragma - "pragma: no cover", - # Don't complain about packages we have installed - "except ImportError", - # Don't complain if tests don't hit assertions - "raise AssertionError", - "raise NotImplementedError", - # Don't complain about script hooks - "def main(.*):", - # Ignore branches that don't pertain to this version of Python - "pragma: py{ignore_python_version}", - # Don't complain about IPython completion helper - "def _ipython_key_completions_", -] diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini new file mode 100644 index 0000000..9d1774c --- /dev/null +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -0,0 +1,8 @@ +[tool.pytest.ini_options] +testpaths = [ + "{{ cookiecutter.module_name }}", + "docs", +] +doctest_plus = "enabled" +text_file_format = "rst" +addopts = "--doctest-rst" From f336761cdd4b401f0a966f3f65ccda02b82a2f5d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:06:26 +0000 Subject: [PATCH 011/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- {{ cookiecutter.package_name }}/.codecov.yaml | 2 +- {{ cookiecutter.package_name }}/.coveragerc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.codecov.yaml b/{{ cookiecutter.package_name }}/.codecov.yaml index 33e3794..8fe09b7 100644 --- a/{{ cookiecutter.package_name }}/.codecov.yaml +++ b/{{ cookiecutter.package_name }}/.codecov.yaml @@ -8,4 +8,4 @@ coverage: codecov: require_ci_to_pass: false notify: - wait_for_ci: true \ No newline at end of file + wait_for_ci: true diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index f98bd67..b64a2b7 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -31,4 +31,4 @@ exclude_lines = [ "pragma: py{ignore_python_version}", # Don't complain about IPython completion helper "def _ipython_key_completions_" -] \ No newline at end of file +] From b6aadaeb719ab1f3db9f99ad8cf7619f9d2774f4 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 27 Feb 2024 21:12:17 +0000 Subject: [PATCH 012/265] Update {{ cookiecutter.package_name }}/pytest.ini Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pytest.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 9d1774c..6dfda84 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -1,4 +1,3 @@ -[tool.pytest.ini_options] testpaths = [ "{{ cookiecutter.module_name }}", "docs", From 2dc738ea4f34364d9bf892d36383b2281fb8e45c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 27 Feb 2024 21:12:24 +0000 Subject: [PATCH 013/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index b64a2b7..d2371c0 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -16,7 +16,7 @@ omit = [ "*/{{ cookiecutter.module_name }}/version*", ] -[tool.coverage.report] +[report] exclude_lines = [ # Have to re-enable the standard pragma "pragma: no cover", From db32c9b1639a54903144a8de46a7e7420c35f281 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 27 Feb 2024 21:12:33 +0000 Subject: [PATCH 014/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index d2371c0..430d321 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -1,4 +1,4 @@ -[tool.coverage.run] +[run] omit = [ "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", "{{ cookiecutter.module_name }}/conftest.py", From 395d314c20f9b145bd510de3c5e4e2a6d941da85 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 28 Feb 2024 11:43:30 +0000 Subject: [PATCH 015/265] Adds .pre-commit-config --- .../.pre-commit-config.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/.pre-commit-config.yaml diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml new file mode 100644 index 0000000..2a22a08 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +repos: + # This should be before any formatting hooks like isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.2.1" + hooks: + - id: ruff + args: ["--fix"] + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|sunpy/extern)$" + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: trailing-whitespace + exclude: ".*(.fits|.fts|.fit|.header|.txt)$" + - id: check-yaml + - id: debug-statements + - id: check-added-large-files + args: ["--enforce-all", "--maxkb=1054"] + - id: end-of-file-fixer + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" + - id: mixed-line-ending + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + additional_dependencies: + - tomli + args: [ "--write-changes" ] \ No newline at end of file From 73ea77e4b768d5006fc344487e2a20830d1f8e87 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:48:25 +0000 Subject: [PATCH 016/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 2a22a08..960f333 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -31,4 +31,4 @@ repos: - id: codespell additional_dependencies: - tomli - args: [ "--write-changes" ] \ No newline at end of file + args: [ "--write-changes" ] From aad3e84b3752517e1e38c5a5740d86c7dcaaa364 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 28 Feb 2024 13:40:44 +0000 Subject: [PATCH 017/265] Complies with isort --- .../{{ cookiecutter.module_name }}/__init__.py | 2 +- .../{{ cookiecutter.module_name }}/example_mod.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py index c94805a..dd871d1 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -1,7 +1,7 @@ from .version import version as __version__ -{%- if cookiecutter.include_example_code == 'y' %} from .example_mod import do_primes +{%- if cookiecutter.include_example_code == 'y' %} # Then you can be explicit to control what ends up in the namespace, __all__ = ['do_primes'] {% else %} diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index 6f4e0c5..f399f92 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -54,9 +54,10 @@ def do_primes(n, usecython=False): def main(args=None): - from astropy.utils.compat import argparse from time import time + from astropy.utils.compat import argparse + parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('-c', '--use-cython', dest='cy', action='store_true', help='Use the Cython-based Prime number generator.') From badc1b3d320b524e67d6393c808039356e904254 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 28 Feb 2024 13:55:43 +0000 Subject: [PATCH 018/265] Attempt to fix build --- {{ cookiecutter.package_name }}/pytest.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 6dfda84..35b03de 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -1,7 +1,7 @@ -testpaths = [ - "{{ cookiecutter.module_name }}", - "docs", -] +[pytest] +testpaths = + "{{ cookiecutter.module_name }}" + "docs" doctest_plus = "enabled" text_file_format = "rst" addopts = "--doctest-rst" From f2659eea96cf26fe0b3bbf59667cb5da1ece6e7b Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 29 Feb 2024 11:55:55 +0000 Subject: [PATCH 019/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index 430d321..1c1ee36 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -1,6 +1,5 @@ [run] omit = [ - "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", "{{ cookiecutter.module_name }}/conftest.py", "{{ cookiecutter.module_name }}/*setup_package*", "{{ cookiecutter.module_name }}/tests/*", From 9644ba6f73f1da1fd559a082bec50ea523634c91 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 29 Feb 2024 12:03:32 +0000 Subject: [PATCH 020/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index 1c1ee36..d3f03a9 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -2,8 +2,6 @@ omit = [ "{{ cookiecutter.module_name }}/conftest.py", "{{ cookiecutter.module_name }}/*setup_package*", - "{{ cookiecutter.module_name }}/tests/*", - "{{ cookiecutter.module_name }}/*/tests/*", "{{ cookiecutter.module_name }}/extern/*", "{{ cookiecutter.module_name }}/version*", "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", From 9a163c5f45d3dc1fcf4c073c0a958161a47c49a3 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 29 Feb 2024 12:04:17 +0000 Subject: [PATCH 021/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index d3f03a9..d90eb21 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -4,7 +4,6 @@ omit = [ "{{ cookiecutter.module_name }}/*setup_package*", "{{ cookiecutter.module_name }}/extern/*", "{{ cookiecutter.module_name }}/version*", - "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", "*/{{ cookiecutter.module_name }}/conftest.py", "*/{{ cookiecutter.module_name }}/*setup_package*", "*/{{ cookiecutter.module_name }}/tests/*", From f5ba24a2f545127d1c68562bfc5204d472a92d3f Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 29 Feb 2024 12:04:32 +0000 Subject: [PATCH 022/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index d90eb21..917bf97 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -6,8 +6,6 @@ omit = [ "{{ cookiecutter.module_name }}/version*", "*/{{ cookiecutter.module_name }}/conftest.py", "*/{{ cookiecutter.module_name }}/*setup_package*", - "*/{{ cookiecutter.module_name }}/tests/*", - "*/{{ cookiecutter.module_name }}/*/tests/*", "*/{{ cookiecutter.module_name }}/extern/*", "*/{{ cookiecutter.module_name }}/version*", ] From d3d7eed8cfd5c097d0aa9599c2346044dd329764 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 29 Feb 2024 12:30:05 +0000 Subject: [PATCH 023/265] Update {{ cookiecutter.package_name }}/pytest.ini Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pytest.ini | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 35b03de..961b8b3 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -1,7 +1,27 @@ [pytest] +minversion = 7.0 testpaths = - "{{ cookiecutter.module_name }}" - "docs" -doctest_plus = "enabled" -text_file_format = "rst" -addopts = "--doctest-rst" + {{ cookiecutter.module_name }} + docs +norecursedirs = + .tox + build + docs/_build + docs/generated + *.egg-info + examples + {{ cookiecutter.module_name }}/_dev + .history + {{ cookiecutter.module_name }}/extern +doctest_plus = enabled +doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS +text_file_format = rst +addopts = --doctest-rst +filterwarnings = + # Turn all warnings into errors so they do not pass silently. + error + # Do not fail on pytest config issues (i.e. missing plugins) but do show them + always::pytest.PytestConfigWarning + # A list of warnings to ignore follows. If you add to this list, you MUST + # add a comment or ideally a link to an issue that explains why the warning + # is being ignored From 49aadf8c3ce076e4c42edf6e8079855dd8a42aa4 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 29 Feb 2024 13:42:10 +0000 Subject: [PATCH 024/265] Some fixes from templating sunkit-magex (#59) * Some fixes from templating sunkit-magex * Other ruff fixes fixes sunpy/package-template#57 * Add default_role to conf.py * pyproject --- docs/conf.py | 3 ++ .../.github/workflows/ci.yml | 3 ++ .../.pre-commit-config.yaml | 2 +- {{ cookiecutter.package_name }}/.ruff.toml | 12 ++---- .../docs/index.rst | 3 +- .../pyproject.toml | 42 +++++++++---------- .../__init__.py | 2 +- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f9336f3..2ad477a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,6 +36,9 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +# Treat everything in single ` as a Python reference. +default_role = 'py:obj' + # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index ce62e2b..953975d 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -67,6 +67,9 @@ jobs: submodules: false pytest: false toxdeps: tox-pypi-filter + libraries: | + apt: + - graphviz envs: | - linux: build_docs diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index ab0ad3f..a3fed62 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.2.1" + rev: "v0.2.2" hooks: - id: ruff args: ["--fix"] diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index bfc789e..78e4fa0 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -20,20 +20,16 @@ extend-ignore = [ "PT023", # Always use () on pytest decorators ] -[lint.flake8-tidy-imports] -[lint.flake8-tidy-imports.banned-api] -"warnings.warn".msg = "Use sunpy specific warning helpers warn_* from sunpy.utils.exceptions" - [lint.per-file-ignores] # Part of configuration, not a package. "setup.py" = ["INP001"] "conftest.py" = ["INP001"] -# Implicit-namespace-package. The examples are not a package. -"docs/*.py" = ["INP001"] +"docs/*.py" = [ + "INP001", # Implicit-namespace-package. The examples are not a package. + "E402", # Module imports not at top of file +] "__init__.py" = ["E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] -# Need to import clients to register them, but don't use them in file -"{{ cookiecutter.package_name }}/net/__init__.py" = ["F811"] [lint.pydocstyle] convention = "numpy" diff --git a/{{ cookiecutter.package_name }}/docs/index.rst b/{{ cookiecutter.package_name }}/docs/index.rst index 7b96581..894eea6 100644 --- a/{{ cookiecutter.package_name }}/docs/index.rst +++ b/{{ cookiecutter.package_name }}/docs/index.rst @@ -1,5 +1,6 @@ +{{ '*' * (cookiecutter.package_name + " Documentation")|length }} {{ cookiecutter.package_name }} Documentation -{{ '-' * (cookiecutter.package_name + " Documentation")|length }} +{{ '*' * (cookiecutter.package_name + " Documentation")|length }} This is the documentation for {{ cookiecutter.package_name }}. diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index f5d4ced..6d97f2e 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -14,8 +14,8 @@ build-backend = "setuptools.build_meta" [project] name = "{{ cookiecutter.module_name }}" description = "{{ cookiecutter.short_description }}" -readme = "README.rst" requires-python = ">={{ cookiecutter.minimum_python_version }}" +readme = { file = "README.rst", content-type = "text/x-rst" } license = { file = "licenses/LICENSE.rst", content-type = "text/plain" } {%- if cookiecutter.author_name and cookiecutter.author_email %} authors = [ @@ -34,14 +34,14 @@ open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.exampl {% endif -%} [project.optional-dependencies] tests = [ - "pytest", - "pytest-doctestplus", - "pytest-cov" + "pytest", + "pytest-doctestplus", + "pytest-cov" ] docs = [ - "sphinx", - "sphinx-automodapi", - "tomli; python_version <\"3.11\"", + "sphinx", + "sphinx-automodapi", + "tomli; python_version <\"3.11\"", ] {% if cookiecutter.project_url -%} @@ -73,20 +73,20 @@ addopts = "--doctest-rst" [tool.coverage.run] omit = [ - "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "{{ cookiecutter.module_name }}/conftest.py", - "{{ cookiecutter.module_name }}/*setup_package*", - "{{ cookiecutter.module_name }}/tests/*", - "{{ cookiecutter.module_name }}/*/tests/*", - "{{ cookiecutter.module_name }}/extern/*", - "{{ cookiecutter.module_name }}/version*", - "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "*/{{ cookiecutter.module_name }}/conftest.py", - "*/{{ cookiecutter.module_name }}/*setup_package*", - "*/{{ cookiecutter.module_name }}/tests/*", - "*/{{ cookiecutter.module_name }}/*/tests/*", - "*/{{ cookiecutter.module_name }}/extern/*", - "*/{{ cookiecutter.module_name }}/version*", + "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", + "{{ cookiecutter.module_name }}/conftest.py", + "{{ cookiecutter.module_name }}/*setup_package*", + "{{ cookiecutter.module_name }}/tests/*", + "{{ cookiecutter.module_name }}/*/tests/*", + "{{ cookiecutter.module_name }}/extern/*", + "{{ cookiecutter.module_name }}/version*", + "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", + "*/{{ cookiecutter.module_name }}/conftest.py", + "*/{{ cookiecutter.module_name }}/*setup_package*", + "*/{{ cookiecutter.module_name }}/tests/*", + "*/{{ cookiecutter.module_name }}/*/tests/*", + "*/{{ cookiecutter.module_name }}/extern/*", + "*/{{ cookiecutter.module_name }}/version*", ] [tool.coverage.report] diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py index 5bd9399..5d44213 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -1,6 +1,6 @@ from .version import version as __version__ - {%- if cookiecutter.include_example_code == 'y' %} + from .example_mod import do_primes # Then you can be explicit to control what ends up in the namespace, __all__ = ['do_primes'] From e933fe50a1ee3f6e784b09cc81b2e29755906b62 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Fri, 1 Mar 2024 11:04:24 +0000 Subject: [PATCH 025/265] Update {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py Co-authored-by: Stuart Mumford --- .../{{ cookiecutter.module_name }}/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py index 3a6be8d..0afca6f 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -8,4 +8,4 @@ __all__ = ['do_primes'] {%- else -%} __all__ = [] -{%- endif -%} +{% endif -%} From 221d7a7b8e8d15ff78ddb8b928d42e4af6b2cf59 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Fri, 1 Mar 2024 11:04:34 +0000 Subject: [PATCH 026/265] Update {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py Co-authored-by: Stuart Mumford --- .../{{ cookiecutter.module_name }}/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py index 0afca6f..86d71b2 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -6,6 +6,6 @@ {% if cookiecutter.include_example_code == 'y' -%} # Then you can be explicit to control what ends up in the namespace, __all__ = ['do_primes'] -{%- else -%} +{% else -%} __all__ = [] {% endif -%} From d0935ea52e3f3b2c7c0e4a5bbf0772e31fdaab09 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Fri, 1 Mar 2024 11:07:17 +0000 Subject: [PATCH 027/265] Update {{ cookiecutter.package_name }}/.coveragerc Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.coveragerc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index 917bf97..f1b4cd2 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -25,4 +25,8 @@ exclude_lines = [ "pragma: py{ignore_python_version}", # Don't complain about IPython completion helper "def _ipython_key_completions_" + # typing.TYPE_CHECKING is False at runtime + "if TYPE_CHECKING:", + # Ignore typing overloads + "@overload", ] From 830d65357508f43d9d8b53e186122edc8685a8e8 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 1 Mar 2024 11:14:42 +0000 Subject: [PATCH 028/265] Cleans up .coveragerc file --- {{ cookiecutter.package_name }}/.coveragerc | 40 ++++++++++----------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index f1b4cd2..3eb03b1 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -1,32 +1,30 @@ [run] -omit = [ - "{{ cookiecutter.module_name }}/conftest.py", - "{{ cookiecutter.module_name }}/*setup_package*", - "{{ cookiecutter.module_name }}/extern/*", - "{{ cookiecutter.module_name }}/version*", - "*/{{ cookiecutter.module_name }}/conftest.py", - "*/{{ cookiecutter.module_name }}/*setup_package*", - "*/{{ cookiecutter.module_name }}/extern/*", - "*/{{ cookiecutter.module_name }}/version*", -] +omit = + {{ cookiecutter.module_name }}/conftest.py + {{ cookiecutter.module_name }}/*setup_package* + {{ cookiecutter.module_name }}/extern/* + {{ cookiecutter.module_name }}/version* + */{{ cookiecutter.module_name }}/conftest.py + */{{ cookiecutter.module_name }}/*setup_package* + */{{ cookiecutter.module_name }}/extern/* + */{{ cookiecutter.module_name }}/version* [report] -exclude_lines = [ +exclude_lines = # Have to re-enable the standard pragma - "pragma: no cover", + pragma: no cover # Don't complain about packages we have installed - "except ImportError", + except ImportError # Don't complain if tests don't hit assertions - "raise AssertionError", - "raise NotImplementedError", + raise AssertionError + raise NotImplementedError # Don't complain about script hooks - "def main(.*):", + def main(.*): # Ignore branches that don't pertain to this version of Python - "pragma: py{ignore_python_version}", + pragma: py{ignore_python_version} # Don't complain about IPython completion helper - "def _ipython_key_completions_" + def _ipython_key_completions_ # typing.TYPE_CHECKING is False at runtime - "if TYPE_CHECKING:", + if TYPE_CHECKING: # Ignore typing overloads - "@overload", -] + @overload From e52e3fd3336e288de7e3c04465cafb38ed6e1c19 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:18:01 +0000 Subject: [PATCH 029/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- {{ cookiecutter.package_name }}/.coveragerc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.coveragerc b/{{ cookiecutter.package_name }}/.coveragerc index 3eb03b1..17874e8 100644 --- a/{{ cookiecutter.package_name }}/.coveragerc +++ b/{{ cookiecutter.package_name }}/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = +omit = {{ cookiecutter.module_name }}/conftest.py {{ cookiecutter.module_name }}/*setup_package* {{ cookiecutter.module_name }}/extern/* @@ -10,7 +10,7 @@ omit = */{{ cookiecutter.module_name }}/version* [report] -exclude_lines = +exclude_lines = # Have to re-enable the standard pragma pragma: no cover # Don't complain about packages we have installed From b9b127586cb302e44770af142067b40cf964acd1 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Fri, 1 Mar 2024 11:23:52 +0000 Subject: [PATCH 030/265] Disables precommit on root --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b4a6ad5..b7d4097 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,3 +14,5 @@ repos: exclude: "{{ cookiecutter.package_name }}" - id: debug-statements exclude: "{{ cookiecutter.package_name }}" +ci: + autofix_prs: false From 2a216965e49b8aef4a8e083d52c6065e0dedf31b Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 1 Mar 2024 11:33:55 +0000 Subject: [PATCH 031/265] Remove unnessesary test --- .../{{ cookiecutter.module_name }}/tests/test_example.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py index 446761f..33d4574 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py @@ -7,11 +7,3 @@ def test_primes_c(): def test_primes(): from ..example_mod import primes assert primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] - - -def test_deprecation(): - import warnings - warnings.warn( - "This is deprecated, but shouldn't raise an exception, unless " - "enable_deprecations_as_exceptions() called from conftest.py", - DeprecationWarning) From 91c83b5a4a42bc7f20cfe075de642c500d8bba3f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 1 Mar 2024 11:44:24 +0000 Subject: [PATCH 032/265] Add workflow to open PR with changes from OpenAstronomy (#60) --- .github/workflows/oa_update.yml | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/oa_update.yml diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml new file mode 100644 index 0000000..efdccae --- /dev/null +++ b/.github/workflows/oa_update.yml @@ -0,0 +1,74 @@ +name: Automatic Update from OpenAstronomy/packging-guide +permissions: + contents: write + pull-requests: write + +on: + # Allow manual runs through the web UI + workflow_dispatch: + schedule: + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: '0 7 * * 1' # Every Monday at 7am UTC + +jobs: + update: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - uses: actions/checkout@v4 + + - name: Add OpenAstronomy/packaging-guide remote + run: | + git remote add openastronomy git@github.com:OpenAstronomy/packaging-guide.git + git remote update + + - name: Check if there are new commits in OpenAstronomy/packaging-guide + continue-on-error: false + id: check + run: | + CHANGES=0 + if [ "$(git rev-list main..openastronomy/main --count)" -gt 0 ]; then + CHANGES=1 + fi + echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT" + + - name: Merge in OpenAstronomy/packaging-guide + if: steps.check.outputs.has_changes == '1' + id: merge + run: | + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git config --global user.name "${{ github.actor }}" + + git merge --no-edit openastronomy/main + if [[ -n $(git ls-files --unmerged) ]]; then + CONFLICTS=1 + # Commit the unresolved conflicts + git commit -m "Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)" + else + CONFLICTS=0 + # No conflicts, commit the merge + git commit -m "Merge branch 'OpenAstronomy/main' into main" + fi + echo "has_conflicts=$CONFLICTS" >> "$GITHUB_OUTPUT" + + - name: Create pull request + if: steps.check.outputs.has_changes == '1' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: ${{ steps.merge.outputs.has_conflicts == '1' }} + delete-branch: true + branch-suffix: timestamp + title: "Updates from OpenAstronomy/packaging-guide" + body: | + This is an autogenerated PR, which merges commits from OpenAstronomy/packaging-guide. + + ${{ steps.merge.outputs.has_conflicts == '1' && '**These changes have conflicts that need to be manually resolved.**' || '' }} + + *Do not squash merge this PR! All commits from upstream should be present in the repos history.* From e2cd7e81a4008a8e2b647ab9ae30a5c1c47c078a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 1 Mar 2024 11:46:01 +0000 Subject: [PATCH 033/265] Fix workflow --- .github/workflows/oa_update.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index efdccae..2bbc002 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -22,10 +22,12 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Add OpenAstronomy/packaging-guide remote run: | - git remote add openastronomy git@github.com:OpenAstronomy/packaging-guide.git + git remote add openastronomy https://github.com/OpenAstronomy/packaging-guide.git git remote update - name: Check if there are new commits in OpenAstronomy/packaging-guide @@ -33,7 +35,7 @@ jobs: id: check run: | CHANGES=0 - if [ "$(git rev-list main..openastronomy/main --count)" -gt 0 ]; then + if [ "$(git rev-list HEAD..openastronomy/main --count)" -gt 0 ]; then CHANGES=1 fi echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT" @@ -41,14 +43,16 @@ jobs: - name: Merge in OpenAstronomy/packaging-guide if: steps.check.outputs.has_changes == '1' id: merge + continue-on-error: false run: | git config --global user.email "${{ github.actor }}@users.noreply.github.com" git config --global user.name "${{ github.actor }}" - git merge --no-edit openastronomy/main + git merge --no-edit openastronomy/main || true if [[ -n $(git ls-files --unmerged) ]]; then CONFLICTS=1 # Commit the unresolved conflicts + git add . git commit -m "Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)" else CONFLICTS=0 From 6e4d52d249fbb9698ea35280e084c61dfff1bb24 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 1 Mar 2024 12:14:27 +0000 Subject: [PATCH 034/265] Update pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 3776975..ed926e7 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -39,14 +39,8 @@ tests = [ "pytest-cov" ] docs = [ -<<<<<<< HEAD "sphinx", "sphinx-automodapi", - "tomli; python_version <\"3.11\"", -======= - "sphinx", - "sphinx-automodapi", ->>>>>>> openastronomy/main ] {% if cookiecutter.project_url -%} From 5beeaf88de2781db969009664d58f889eba64405 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 1 Mar 2024 12:18:57 +0000 Subject: [PATCH 035/265] Update tox.ini --- {{ cookiecutter.package_name }}/tox.ini | 34 +++---------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index bd7b1cd..7be9173 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -10,38 +10,8 @@ envlist = build_docs [testenv] -<<<<<<< HEAD pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt -======= -# tox environments are constructed with so-called 'factors' (or terms) -# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: -# will only take effect if that factor is included in the environment name. To -# see a list of example environments that can be run, along with a description, -# run: -# -# tox -l -v -# -description = - run tests - oldestdeps: with the oldest supported version of key dependencies -# Pass through the following environment variables which may be needed for the CI -pass_env = - # A variable to tell tests we are on a CI system - CI - # Custom compiler locations (such as ccache) - CC - # Location of locales (needed by sphinx on some systems) - LOCALE_ARCHIVE - # If the user has set a LC override we should follow it - # (note LANG is automatically passed through by tox) - LC_ALL - -# Suppress display of matplotlib plots generated during docs build -set_env = - MPLBACKEND = agg - ->>>>>>> openastronomy/main # Run the tests in a temporary directory to make sure that we don't import # the package from the source tree change_dir = .tmp/{envname} @@ -51,6 +21,8 @@ description = devdeps: with the latest developer version of key dependencies pass_env = + # A variable to tell tests we are on a CI system + CI # Custom compiler locations (such as ccache) CC # Location of locales (needed by sphinx on some systems) @@ -59,7 +31,7 @@ pass_env = LC_ALL set_env = - MPLBACKEND=agg + MPLBACKEND = agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Define the base test command here to allow us to add more flags for each tox factor PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/pyproject.toml {toxinidir}/docs From 5c00702f4979705b683bd11fdee1199f5e85f821 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 1 Mar 2024 14:09:36 +0000 Subject: [PATCH 036/265] Apply suggestions from code review --- {{ cookiecutter.package_name }}/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 961b8b3..2da8814 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -16,7 +16,7 @@ norecursedirs = doctest_plus = enabled doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS text_file_format = rst -addopts = --doctest-rst +addopts = --doctest-rst -p no:unraisableexception -p no:threadexception filterwarnings = # Turn all warnings into errors so they do not pass silently. error From 9a506ab254b728a0aeed24f7d9828448bcccfb70 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 4 Mar 2024 10:20:37 +0000 Subject: [PATCH 037/265] Adds ci schedule --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 960f333..f987627 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -32,3 +32,6 @@ repos: additional_dependencies: - tomli args: [ "--write-changes" ] +ci: + autofix_prs: false + autoupdate_schedule: quarterly \ No newline at end of file From 6ae3c5cd02981eea1bafec1f97639267d0e6493d Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 5 Mar 2024 20:25:17 +0000 Subject: [PATCH 038/265] Adds py12 enviroment to parent tox --- {{ cookiecutter.package_name }}/docs/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 53d03dc..c029976 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -7,12 +7,14 @@ import datetime -# -- Project information ----------------------------------------------------- - # The full version, including alpha/beta/rc tags from {{ cookiecutter.module_name }} import __version__ release = __version__ +# -- Project information ----------------------------------------------------- + + + project = "{{ cookiecutter.package_name }}" copyright = str(datetime.datetime.now().year) + " , {{ cookiecutter.author_name }}" # noqa: A001 From e07eeac6526e308688f049fb871d1d0b81be916c Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 8 Mar 2024 13:36:49 +0000 Subject: [PATCH 039/265] Update pyproject.toml --- .../pyproject.toml | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index bede6b6..03733fd 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -60,54 +60,3 @@ write_to = "{{ cookiecutter.module_name }}/_version.py" {%- else -%} write_to = "{{ cookiecutter.module_name }}/version.py" {%- endif %} -<<<<<<< HEAD -======= - -[tool.pytest.ini_options] -testpaths = [ - "{{ cookiecutter.module_name }}", - "docs", -] -doctest_plus = "enabled" -text_file_format = "rst" -addopts = "--doctest-rst" - -[tool.coverage.run] -omit = [ - "{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "{{ cookiecutter.module_name }}/conftest.py", - "{{ cookiecutter.module_name }}/*setup_package*", - "{{ cookiecutter.module_name }}/tests/*", - "{{ cookiecutter.module_name }}/*/tests/*", - "{{ cookiecutter.module_name }}/extern/*", - "{{ cookiecutter.module_name }}/version*", - "*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*", - "*/{{ cookiecutter.module_name }}/conftest.py", - "*/{{ cookiecutter.module_name }}/*setup_package*", - "*/{{ cookiecutter.module_name }}/tests/*", - "*/{{ cookiecutter.module_name }}/*/tests/*", - "*/{{ cookiecutter.module_name }}/extern/*", - "*/{{ cookiecutter.module_name }}/version*", -] - -[tool.coverage.report] -exclude_lines = [ - # Have to re-enable the standard pragma - "pragma: no cover", - # Don't complain about packages we have installed - "except ImportError", - # Don't complain if tests don't hit assertions - "raise AssertionError", - "raise NotImplementedError", - # Don't complain about script hooks - "def main(.*):", - # Ignore branches that don't pertain to this version of Python - "pragma: py{ignore_python_version}", - # Don't complain about IPython completion helper - "def _ipython_key_completions_", - # typing.TYPE_CHECKING is False at runtime - "if TYPE_CHECKING:", - # Ignore typing overloads - "@overload", -] ->>>>>>> openastronomy/main From a59d939cc13bbe10c6b211cb3c100a7508a2fe57 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 8 Mar 2024 16:29:28 +0000 Subject: [PATCH 040/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 37f825f..dd93e0e 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -15,9 +15,6 @@ release = __version__ # -- Project information ----------------------------------------------------- - - - project = "{{ cookiecutter.package_name }}" copyright = str(datetime.datetime.now().year) + " , {{ cookiecutter.author_name }}" # noqa: A001 author = "{{ cookiecutter.author_name }}" From 5b3a1f51affef28efb02b29730d1bf7cfc99a429 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 8 Mar 2024 16:30:17 +0000 Subject: [PATCH 041/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index dd93e0e..b15cce2 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -13,7 +13,6 @@ release = __version__ -# -- Project information ----------------------------------------------------- project = "{{ cookiecutter.package_name }}" copyright = str(datetime.datetime.now().year) + " , {{ cookiecutter.author_name }}" # noqa: A001 From 42babf422893662ce76c7d799467d301f89eefe8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 8 Mar 2024 16:55:50 +0000 Subject: [PATCH 042/265] Add isort and codespell config files --- {{ cookiecutter.package_name }}/.codespellrc | 13 +++++++++++++ {{ cookiecutter.package_name }}/.isort.cfg | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/.codespellrc create mode 100644 {{ cookiecutter.package_name }}/.isort.cfg diff --git a/{{ cookiecutter.package_name }}/.codespellrc b/{{ cookiecutter.package_name }}/.codespellrc new file mode 100644 index 0000000..042a14e --- /dev/null +++ b/{{ cookiecutter.package_name }}/.codespellrc @@ -0,0 +1,13 @@ +[codespell] +skip = *.asdf,*.fits,*.fts,*.header,*.json,*.xsh,*cache*,*egg*,*extern*,.git,.idea,.tox,_build,*truncated,*.svg,.asv_env,.history +ignore-words-list = + alog, + nd, + nin, + observ, + ot, + te, + upto, + afile, + precessed, + precess diff --git a/{{ cookiecutter.package_name }}/.isort.cfg b/{{ cookiecutter.package_name }}/.isort.cfg new file mode 100644 index 0000000..e3ad818 --- /dev/null +++ b/{{ cookiecutter.package_name }}/.isort.cfg @@ -0,0 +1,16 @@ +[settings] +balanced_wrapping = true +skip = + docs/conf.py, + {{ cookiecutter.module_name }}/__init__.py, +default_section = THIRDPARTY +include_trailing_comma = true +known_astropy = astropy, asdf +known_sunpy = sunpy +known_first_party = {{ cookiecutter.module_name }} +length_sort = false +length_sort_sections = stdlib +line_length = 110 +multi_line_output = 3 +no_lines_before = LOCALFOLDER +sections = STDLIB, THIRDPARTY, ASTROPY, SUNPY, FIRSTPARTY, LOCALFOLDER From c93fae92807d21ef81284abe9bec3d4d4219d989 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Mon, 11 Mar 2024 11:35:38 +0000 Subject: [PATCH 043/265] Update {{ cookiecutter.package_name }}/.pre-commit-config.yaml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index a958dad..e935831 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: rev: 5.13.2 hooks: - id: isort - exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|sunpy/extern)$" + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: From 773c763ad4cc6fe32fff4c8854d89242fa7244e8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Mar 2024 13:28:32 +0000 Subject: [PATCH 044/265] Update {{ cookiecutter.package_name }}/.pre-commit-config.yaml --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index e935831..1f19f5c 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -29,8 +29,6 @@ repos: rev: v2.2.6 hooks: - id: codespell - additional_dependencies: - - tomli args: [ "--write-changes" ] ci: autofix_prs: false From 13c39d2a28ee294975da08b2ff85bffc1c649ca8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Mar 2024 14:07:42 +0000 Subject: [PATCH 045/265] Don't commit merge twice --- .github/workflows/oa_update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 2bbc002..a91e05c 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -48,7 +48,7 @@ jobs: git config --global user.email "${{ github.actor }}@users.noreply.github.com" git config --global user.name "${{ github.actor }}" - git merge --no-edit openastronomy/main || true + git merge --no-edit --no-commit openastronomy/main || true if [[ -n $(git ls-files --unmerged) ]]; then CONFLICTS=1 # Commit the unresolved conflicts From 7ff03ccce5ebc5b2144d1415bbbf81e409b93515 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Mar 2024 15:03:39 +0000 Subject: [PATCH 046/265] Update .flake8 --- {{ cookiecutter.package_name }}/.flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.flake8 b/{{ cookiecutter.package_name }}/.flake8 index aa349c3..2d17646 100644 --- a/{{ cookiecutter.package_name }}/.flake8 +++ b/{{ cookiecutter.package_name }}/.flake8 @@ -22,6 +22,6 @@ exclude = __pycache__ docs/conf.py build - {{ cookiecutter.package_name }}/__init__.py, + {{ cookiecutter.package_name }}/__init__.py rst-directives = plot From 621f8a4a750bbc55531d7b13dbfab0ab7d2e9b15 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Mar 2024 15:07:12 +0000 Subject: [PATCH 047/265] Update .isort.cfg --- {{ cookiecutter.package_name }}/.isort.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.isort.cfg b/{{ cookiecutter.package_name }}/.isort.cfg index e3ad818..269e6be 100644 --- a/{{ cookiecutter.package_name }}/.isort.cfg +++ b/{{ cookiecutter.package_name }}/.isort.cfg @@ -1,8 +1,8 @@ [settings] balanced_wrapping = true skip = - docs/conf.py, - {{ cookiecutter.module_name }}/__init__.py, + docs/conf.py + {{ cookiecutter.module_name }}/__init__.py default_section = THIRDPARTY include_trailing_comma = true known_astropy = astropy, asdf From bb36795e0f6fb49a9646454f9b6e92f79ea15c56 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Mar 2024 16:19:49 +0000 Subject: [PATCH 048/265] Update pytest.ini --- {{ cookiecutter.package_name }}/pytest.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 2da8814..2367b69 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -1,8 +1,8 @@ [pytest] minversion = 7.0 testpaths = - {{ cookiecutter.module_name }} - docs + {{ cookiecutter.module_name }} + docs norecursedirs = .tox build From 49129d60d7e905c3f8c206a2cff40e058563f6d2 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 13 Mar 2024 11:00:06 +0000 Subject: [PATCH 049/265] Updates from sunpy register --- {{ cookiecutter.package_name }}/.ruff.toml | 2 +- {{ cookiecutter.package_name }}/tox.ini | 25 +++++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 78e4fa0..1dabeba 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -24,9 +24,9 @@ extend-ignore = [ # Part of configuration, not a package. "setup.py" = ["INP001"] "conftest.py" = ["INP001"] +"docs/conf.py" = ["E402"] "docs/*.py" = [ "INP001", # Implicit-namespace-package. The examples are not a package. - "E402", # Module imports not at top of file ] "__init__.py" = ["E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 9bf1f39..2aa23a1 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -5,9 +5,9 @@ requires = envlist = py{310,311,312} py312-devdeps - py39-oldestdeps - codestyle + py310-oldestdeps build_docs + codestyle [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt @@ -42,7 +42,6 @@ deps = # Packages without nightly wheels will be built from source like this # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies - pytest-cov # The following indicates which extras_require will be installed extras = @@ -61,16 +60,6 @@ commands = # If you have no factors which require different commands this is all you need: {env:PYTEST_COMMAND} {posargs} -[testenv:codestyle] -pypi_filter = -skip_install = true -description = Run all style and file checks with pre-commit -deps = - pre-commit -commands = - pre-commit install-hooks - pre-commit run --color always --all-files --show-diff-on-failure - [testenv:build_docs] description = invoke sphinx-build to build the HTML docs change_dir = @@ -79,3 +68,13 @@ extras = docs commands = sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} + +[testenv:codestyle] +pypi_filter = +skip_install = true +description = Run all style and file checks with pre-commit +deps = + pre-commit +commands = + pre-commit install-hooks + pre-commit run --color always --all-files --show-diff-on-failure \ No newline at end of file From 2df78c2c2e4d0aaecc1e58659e2d311686f78a14 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 13 Mar 2024 11:00:06 +0000 Subject: [PATCH 050/265] Updates from sunpy register --- {{ cookiecutter.package_name }}/.ruff.toml | 4 +++- {{ cookiecutter.package_name }}/tox.ini | 23 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 78e4fa0..55f69cb 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -24,9 +24,11 @@ extend-ignore = [ # Part of configuration, not a package. "setup.py" = ["INP001"] "conftest.py" = ["INP001"] +"docs/conf.py" = [ + "E402" # Module imports not at top of file +] "docs/*.py" = [ "INP001", # Implicit-namespace-package. The examples are not a package. - "E402", # Module imports not at top of file ] "__init__.py" = ["E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 9bf1f39..c99e627 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -5,9 +5,9 @@ requires = envlist = py{310,311,312} py312-devdeps - py39-oldestdeps - codestyle + py310-oldestdeps build_docs + codestyle [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt @@ -42,7 +42,6 @@ deps = # Packages without nightly wheels will be built from source like this # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies - pytest-cov # The following indicates which extras_require will be installed extras = @@ -61,6 +60,15 @@ commands = # If you have no factors which require different commands this is all you need: {env:PYTEST_COMMAND} {posargs} +[testenv:build_docs] +description = invoke sphinx-build to build the HTML docs +change_dir = + docs +extras = + docs +commands = + sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} + [testenv:codestyle] pypi_filter = skip_install = true @@ -70,12 +78,3 @@ deps = commands = pre-commit install-hooks pre-commit run --color always --all-files --show-diff-on-failure - -[testenv:build_docs] -description = invoke sphinx-build to build the HTML docs -change_dir = - docs -extras = - docs -commands = - sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} From aa2a5d72293b17041eded4ce39a8f9b591c1ac3e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:12:04 +0000 Subject: [PATCH 051/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- {{ cookiecutter.package_name }}/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 2aa23a1..c99e627 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -77,4 +77,4 @@ deps = pre-commit commands = pre-commit install-hooks - pre-commit run --color always --all-files --show-diff-on-failure \ No newline at end of file + pre-commit run --color always --all-files --show-diff-on-failure From e29ee54cea870e5d1b111995ccf4519417397c0f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 13 Mar 2024 15:36:53 +0000 Subject: [PATCH 052/265] tox formatting changes --- {{ cookiecutter.package_name }}/tox.ini | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index c99e627..e6004c7 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -11,7 +11,6 @@ envlist = [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt - # Run the tests in a temporary directory to make sure that we don't import # the package from the source tree change_dir = .tmp/{envname} @@ -19,7 +18,6 @@ description = run tests oldestdeps: with the oldest supported version of key dependencies devdeps: with the latest developer version of key dependencies - pass_env = # A variable to tell tests we are on a CI system CI @@ -29,29 +27,24 @@ pass_env = LOCALE_ARCHIVE # If the user has set a LC override we should follow it LC_ALL - set_env = MPLBACKEND = agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Define the base test command here to allow us to add more flags for each tox factor PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/pyproject.toml {toxinidir}/docs - deps = # For packages which publish nightly wheels this will pull the latest nightly devdeps: numpy>=0.0.dev0 # Packages without nightly wheels will be built from source like this # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies - -# The following indicates which extras_require will be installed +# The following indicates which extras will be installed with the package extras = tests - commands_pre = oldestdeps: minimum_dependencies {{ cookiecutter.module_name }} --filename requirements-min.txt oldestdeps: pip install -r requirements-min.txt pip freeze --all --no-input - commands = # To run different commands for different factors exclude the factor from the default command like this # !online: {env:PYTEST_COMMAND} {posargs} From 51a83af783244c38e58e7aa12678fa968d67570e Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 13 Mar 2024 15:43:40 +0000 Subject: [PATCH 053/265] changing point of refernce for pytest in tox.ini --- {{ cookiecutter.package_name }}/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index c99e627..f226611 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -34,7 +34,7 @@ set_env = MPLBACKEND = agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Define the base test command here to allow us to add more flags for each tox factor - PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/pyproject.toml {toxinidir}/docs + PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/.coveragerc {toxinidir}/docs deps = # For packages which publish nightly wheels this will pull the latest nightly From f94a147ce41f03592502d4a35a325fb4c4731a22 Mon Sep 17 00:00:00 2001 From: Marcus Hughes Date: Fri, 22 Mar 2024 08:09:05 -0600 Subject: [PATCH 054/265] Indent publish_pure --- .../.github/workflows/ci.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 953975d..1b5afef 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -119,14 +119,14 @@ jobs: secrets: pypi_token: {{ '${{ secrets.pypi_token }}' }} {%- else -%} - publish_pure: - needs: [test, docs] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main - with: - python-version: '{{ default_python }}' - test_extras: 'tests' - test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' - submodules: false - secrets: - pypi_token: {{ '${{ secrets.pypi_token }}' }} + publish_pure: + needs: [test, docs] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + with: + python-version: '{{ default_python }}' + test_extras: 'tests' + test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' + submodules: false + secrets: + pypi_token: {{ '${{ secrets.pypi_token }}' }} {%- endif %} From 1edeb517695edd6a3c67b23e08e6861434fca47b Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 27 Mar 2024 09:46:26 +0000 Subject: [PATCH 055/265] Update tox.ini --- {{ cookiecutter.package_name }}/tox.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 4598c24..63ddc72 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -55,7 +55,6 @@ commands_pre = pip freeze --all --no-input commands = -<<<<<<< HEAD # To run different commands for different factors exclude the factor from the default command like this # !online: {env:PYTEST_COMMAND} {posargs} # Then specify a specific one like this @@ -72,9 +71,6 @@ deps = commands = pre-commit install-hooks pre-commit run --color always --all-files --show-diff-on-failure -======= - pytest --pyargs {{ cookiecutter.module_name }} --cov {{ cookiecutter.module_name }} --cov-report xml:coverage.xml --cov-report term-missing {posargs} ->>>>>>> openastronomy/main [testenv:build_docs] description = invoke sphinx-build to build the HTML docs From 193040b62b27c893cb51f5033f087cf550016a28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:19:16 +0000 Subject: [PATCH 056/265] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7d4097..37525ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-case-conflict - id: trailing-whitespace From a97b7c56b089e625aab47929932c7559240957e2 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 17 Apr 2024 13:56:25 +0100 Subject: [PATCH 057/265] Add workflow to update pre-commit.yaml --- .github/workflows/pre-commit-update.yaml | 45 +++++++++++++++++++ .../.pre-commit-config.yaml | 1 + 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/pre-commit-update.yaml diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml new file mode 100644 index 0000000..74be0f8 --- /dev/null +++ b/.github/workflows/pre-commit-update.yaml @@ -0,0 +1,45 @@ +name: Update template pre-commit +permissions: + contents: write + pull-requests: write + +on: + # Allow manual runs through the web UI + workflow_dispatch: + schedule: + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: '0 7 * * 1' # Every Monday at 7am UTC + +jobs: + update: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit update + id: check + run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' + + - name: Create pull request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + delete-branch: true + branch-suffix: timestamp + title: "pre-commit updates in the template" + body: | + This is an autogenerated PR, which updates the `{{ cookiecutter.package_name }}/.pre-commit-config.yaml` file. diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 1f19f5c..ed490ce 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +{# Note that this file must be valid yaml (and not only after rendering by jinja) so that pre-commit can autoupdate it. #} repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit From 8063830129b5472658e21ba2d2db2573d7ce8113 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 17 Apr 2024 14:57:41 +0100 Subject: [PATCH 058/265] oh the sweet irony --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index ed490ce..1f19f5c 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,4 +1,3 @@ -{# Note that this file must be valid yaml (and not only after rendering by jinja) so that pre-commit can autoupdate it. #} repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit From baaced4456c9f3a9c51056fd266f551fc47300ef Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:59:24 +0000 Subject: [PATCH 059/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 1f19f5c..226bb9a 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.2.2" + rev: "v0.3.7" hooks: - id: ruff args: ["--fix"] @@ -11,7 +11,7 @@ repos: - id: isort exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict From 969d0c6e228744fef96a1669d24f4da932181103 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Apr 2024 10:29:17 +0100 Subject: [PATCH 060/265] Update pre-commit-update.yaml --- .github/workflows/pre-commit-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 74be0f8..69aabaa 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -12,7 +12,7 @@ on: # │ │ ┌───────── day of the month (1 - 31) # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - - cron: '0 7 * * 1' # Every Monday at 7am UTC + - cron: '0 7 * * 3' # Every Wednesday at 7am UTC (so it can be merged before the monday package updates) jobs: update: From aed88ef06d4aa517ec08416becf7e7f1f06c3f94 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Apr 2024 15:13:41 +0100 Subject: [PATCH 061/265] Update pytest.ini --- {{ cookiecutter.package_name }}/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index 2367b69..a6dd770 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -16,7 +16,7 @@ norecursedirs = doctest_plus = enabled doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS text_file_format = rst -addopts = --doctest-rst -p no:unraisableexception -p no:threadexception +addopts = --doctest-rst -p no:unraisableexception -p no:threadexception filterwarnings = # Turn all warnings into errors so they do not pass silently. error From eb3f096c70565aa60779f4c4a90edcb31d310012 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Apr 2024 15:21:17 +0100 Subject: [PATCH 062/265] Install pytest-xdist --- {{ cookiecutter.package_name }}/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 03733fd..48f778a 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -37,6 +37,7 @@ tests = [ "pytest", "pytest-doctestplus", "pytest-cov" + "pytest-xdist" ] docs = [ "sphinx", From d2b7a1012697e3ed32fa46151f052f3808002b3f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Apr 2024 15:25:27 +0100 Subject: [PATCH 063/265] Update {{ cookiecutter.package_name }}/pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 48f778a..2422726 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -36,8 +36,8 @@ open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.exampl tests = [ "pytest", "pytest-doctestplus", - "pytest-cov" - "pytest-xdist" + "pytest-cov", + "pytest-xdist", ] docs = [ "sphinx", From cba7b99d804aff409ec3aea349ba96893f96373e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 22 Apr 2024 14:34:43 +0100 Subject: [PATCH 064/265] More comments from the ndcube work --- {{ cookiecutter.package_name }}/.gitignore | 1 + {{ cookiecutter.package_name }}/pyproject.toml | 2 +- {{ cookiecutter.package_name }}/pytest.ini | 10 ++++++++-- {{ cookiecutter.package_name }}/tox.ini | 7 ------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.gitignore b/{{ cookiecutter.package_name }}/.gitignore index 50cda2b..bf4ec7c 100644 --- a/{{ cookiecutter.package_name }}/.gitignore +++ b/{{ cookiecutter.package_name }}/.gitignore @@ -81,6 +81,7 @@ instance/ docs/_build/ # automodapi docs/api +docs/sg_execution_times.rst # PyBuilder .pybuilder/ diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 8b1ba4b..51f5cc8 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -54,7 +54,7 @@ zip-safe = false include-package-data = true [tool.setuptools.packages.find] -{% if cookiecutter.enable_dynamic_dev_versions == 'y' -%} +{%- if cookiecutter.enable_dynamic_dev_versions == 'y' %} exclude = ["{{ cookiecutter.module_name }}._dev*"] {%- endif %} diff --git a/{{ cookiecutter.package_name }}/pytest.ini b/{{ cookiecutter.package_name }}/pytest.ini index a6dd770..b5fb97a 100644 --- a/{{ cookiecutter.package_name }}/pytest.ini +++ b/{{ cookiecutter.package_name }}/pytest.ini @@ -14,9 +14,15 @@ norecursedirs = .history {{ cookiecutter.module_name }}/extern doctest_plus = enabled -doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS +doctest_optionflags = + NORMALIZE_WHITESPACE + FLOAT_CMP + ELLIPSIS text_file_format = rst -addopts = --doctest-rst -p no:unraisableexception -p no:threadexception +addopts = + --doctest-rst + -p no:unraisableexception + -p no:threadexception filterwarnings = # Turn all warnings into errors so they do not pass silently. error diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index 63ddc72..a68b434 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -12,7 +12,6 @@ envlist = [testenv] pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt - # Run the tests in a temporary directory to make sure that we don't import # the package from the source tree change_dir = .tmp/{envname} @@ -20,7 +19,6 @@ description = run tests oldestdeps: with the oldest supported version of key dependencies devdeps: with the latest developer version of key dependencies - pass_env = # A variable to tell tests we are on a CI system CI @@ -30,13 +28,11 @@ pass_env = LOCALE_ARCHIVE # If the user has set a LC override we should follow it LC_ALL - set_env = MPLBACKEND = agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Define the base test command here to allow us to add more flags for each tox factor PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/.coveragerc {toxinidir}/docs - deps = # For packages which publish nightly wheels this will pull the latest nightly devdeps: numpy>=0.0.dev0 @@ -44,16 +40,13 @@ deps = # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies pytest-cov - # The following indicates which extras_require will be installed extras = tests - commands_pre = oldestdeps: minimum_dependencies {{ cookiecutter.module_name }} --filename requirements-min.txt oldestdeps: pip install -r requirements-min.txt pip freeze --all --no-input - commands = # To run different commands for different factors exclude the factor from the default command like this # !online: {env:PYTEST_COMMAND} {posargs} From 4acdefbd6017fccde618375edf7f09ba9d7d53d4 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 22 Apr 2024 14:45:21 +0100 Subject: [PATCH 065/265] Drop env:PYTEST_COMMAND --- {{ cookiecutter.package_name }}/tox.ini | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index a68b434..f70ab0a 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -31,15 +31,12 @@ pass_env = set_env = MPLBACKEND = agg devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple - # Define the base test command here to allow us to add more flags for each tox factor - PYTEST_COMMAND = pytest -vvv -r fEs --pyargs {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/.coveragerc {toxinidir}/docs deps = # For packages which publish nightly wheels this will pull the latest nightly devdeps: numpy>=0.0.dev0 # Packages without nightly wheels will be built from source like this # devdeps: git+https://github.com/ndcube/ndcube oldestdeps: minimum_dependencies - pytest-cov # The following indicates which extras_require will be installed extras = tests @@ -48,12 +45,18 @@ commands_pre = oldestdeps: pip install -r requirements-min.txt pip freeze --all --no-input commands = - # To run different commands for different factors exclude the factor from the default command like this - # !online: {env:PYTEST_COMMAND} {posargs} - # Then specify a specific one like this - # online: {env:PYTEST_COMMAND} --remote-data=any {posargs} + # To amend the pytest command for different factors you can add a line + # which starts with a factor like `online: --remote-data=any \` # If you have no factors which require different commands this is all you need: - {env:PYTEST_COMMAND} {posargs} + pytest \ + -vvv \ + -r fEs \ + --pyargs {{ cookiecutter.module_name }} \ + --cov-report=xml \ + --cov={{ cookiecutter.module_name }} \ + --cov-config={toxinidir}/.coveragerc \ + {toxinidir}/docs \ + {posargs} [testenv:codestyle] pypi_filter = From 2e387817888e3f70674fa84514884f60781717da Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 24 Apr 2024 07:02:13 +0000 Subject: [PATCH 066/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 226bb9a..5ad8c91 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.3.7" + rev: "v0.4.1" hooks: - id: ruff args: ["--fix"] From 523c70697a4ac5886346978c41801a4867671a17 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 8 May 2024 07:01:48 +0000 Subject: [PATCH 067/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 5ad8c91..9654988 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.1" + rev: "v0.4.3" hooks: - id: ruff args: ["--fix"] From 37c77281e714808786c9a6d1c112a1b09d1e3f19 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 15 May 2024 07:02:06 +0000 Subject: [PATCH 068/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 9654988..4a8d284 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.3" + rev: "v0.4.4" hooks: - id: ruff args: ["--fix"] From fd94e9444adaffe1fed6bba31236c5118e2667a4 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Mon, 20 May 2024 10:13:39 +0100 Subject: [PATCH 069/265] Update sub_package_update.yml --- .../.github/workflows/sub_package_update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 94a9e7e..ede1177 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -42,7 +42,7 @@ jobs: python-version: "3.11" - name: Install Cruft - run: python -m pip install cruft + run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1 - name: Check if update is available continue-on-error: false From 4165e7da2ef4cab24c3ce641cbb3f168f10e0d65 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 29 May 2024 07:02:17 +0000 Subject: [PATCH 070/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 4a8d284..983f1e7 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.4.6" hooks: - id: ruff args: ["--fix"] @@ -26,7 +26,7 @@ repos: - id: mixed-line-ending exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: [ "--write-changes" ] From 0d1b8da47602f490dbac9bd044419234839a953d Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:02:02 +0000 Subject: [PATCH 071/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 983f1e7..84168bd 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.6" + rev: "v0.4.7" hooks: - id: ruff args: ["--fix"] From 54a1df2be5673c17c03b981280ec179249231597 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 5 Jun 2024 16:27:35 +0100 Subject: [PATCH 072/265] Remove reject PR --- .../.github/workflows/sub_package_update.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index ede1177..0677948 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -28,11 +28,6 @@ jobs: branch: cruft/update commit-message: "Automatic package template update" title: Updates from the package template - - add-paths: .cruft.json - body: reject these changes for this repo. - branch: cruft/reject - commit-message: "Reject this package template update" - title: Reject new updates from package template steps: - uses: actions/checkout@v4 From 99adbda1486a56d046de3c0b10f5f5874cb1c325 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 12 Jun 2024 07:01:42 +0000 Subject: [PATCH 073/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 84168bd..8f5cadf 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.7" + rev: "v0.4.8" hooks: - id: ruff args: ["--fix"] From abbfd3738e04c0d7102e85cf931c586ee4de46cc Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:01:49 +0000 Subject: [PATCH 074/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 8f5cadf..7b0ecc8 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.8" + rev: "v0.4.9" hooks: - id: ruff args: ["--fix"] From 68da3331e568220937b02602833dc5eba0d030cc Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Wed, 19 Jun 2024 17:30:25 +0100 Subject: [PATCH 075/265] remove duplicate in envlist --- {{ cookiecutter.package_name }}/tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index f70ab0a..c1e2bc1 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -6,7 +6,6 @@ envlist = py{310,311,312} py312-devdeps py310-oldestdeps - build_docs codestyle build_docs From 9d6eb6b8294f47dfc2b6f7a6ba1c22dcf42b8130 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 26 Jun 2024 07:01:49 +0000 Subject: [PATCH 076/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 7b0ecc8..b4ce7a3 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.9" + rev: "v0.4.10" hooks: - id: ruff args: ["--fix"] From fd680e725a943095cc4e4623f0292984fcb40514 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:01:53 +0000 Subject: [PATCH 077/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index b4ce7a3..2cee766 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.10" + rev: "v0.5.0" hooks: - id: ruff args: ["--fix"] From fe3862a9080c62747147a7f363b96e8b20652ee4 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 10 Jul 2024 07:02:03 +0000 Subject: [PATCH 078/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 2cee766..cc691a6 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.0" + rev: "v0.5.1" hooks: - id: ruff args: ["--fix"] From 154068581f817355ca95db957c3389fe5a71f2c0 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 17 Jul 2024 07:01:44 +0000 Subject: [PATCH 079/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index cc691a6..0c33a25 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.1" + rev: "v0.5.2" hooks: - id: ruff args: ["--fix"] From 1e8031614fccf908260d17825f2f6079b1d7bf26 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Tue, 23 Jul 2024 15:52:59 -0700 Subject: [PATCH 080/265] Removes non-existent key for the licence field --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 51f5cc8..35122ff 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -16,7 +16,7 @@ name = "{{ cookiecutter.module_name }}" description = "{{ cookiecutter.short_description }}" requires-python = ">={{ cookiecutter.minimum_python_version }}" readme = { file = "README.rst", content-type = "text/x-rst" } -license = { file = "licenses/LICENSE.rst", content-type = "text/plain" } +license = { file = "licenses/LICENSE.rst" } {%- if cookiecutter.author_name and cookiecutter.author_email %} authors = [ { name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" }, From 1bda0a3b9b89029a57b24e84a1b9630cb0755feb Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:02:05 +0000 Subject: [PATCH 081/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 0c33a25..3c063ed 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.2" + rev: "v0.5.4" hooks: - id: ruff args: ["--fix"] From 28ae8ef0fbbc12c17cefbc8a57bd6810b35463ff Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 23 Jul 2024 08:49:33 +0100 Subject: [PATCH 082/265] Update CI config --- .../.github/workflows/ci.yml | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 1b5afef..9e16a35 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -{% set default_python = '3.10' %} +{% set default_python = '3.12' %} name: CI on: @@ -90,21 +90,17 @@ jobs: secrets: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} -{% if cookiecutter.use_compiled_extensions == 'y' -%} publish: - # Build wheels when pushing to any branch except main - # publish.yml will only publish if tagged ^v.* + needs: [test, docs] + # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* + # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi if: | + github.event_name != 'pull_request' || ( - github.event_name != 'pull_request' && ( - github.ref_name != 'main' || - github.event_name == 'workflow_dispatch' - ) - ) || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run publish') ) - needs: [test, docs] +{%- if cookiecutter.use_compiled_extensions == 'y' %} uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main with: sdist: true @@ -116,17 +112,13 @@ jobs: - cp3{9,10,11,12}-macosx_x86_64 - cp3{9,10,11,12}-macosx_arm64 - cp3{9,10,11,12}-win_amd64 +{%- else %} + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + with: + python-version: '{{ default_python }}' + test_extras: 'tests' + test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' + submodules: false +{%- endif %} secrets: pypi_token: {{ '${{ secrets.pypi_token }}' }} -{%- else -%} - publish_pure: - needs: [test, docs] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main - with: - python-version: '{{ default_python }}' - test_extras: 'tests' - test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' - submodules: false - secrets: - pypi_token: {{ '${{ secrets.pypi_token }}' }} -{%- endif %} From b471cb4ca622e8370d4a1aa2b0eb17fe797c650e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 24 Jul 2024 14:49:03 +0100 Subject: [PATCH 083/265] bake some cookies --- .github/workflows/tests.yml | 8 ++++++++ .gitignore | 1 + tests/conftest.py | 16 ++++++++++++---- tests/test_build_artifacts.py | 25 +++++++++++++++++++++++++ tox.ini | 4 +++- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 tests/test_build_artifacts.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b706242..605d890 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,3 +19,11 @@ jobs: - linux: py311-test - linux: py312-test - linux: build_docs + + bake_cookies: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + artifact-path: | + cookies + envs: | + - linux: bake_cookies diff --git a/.gitignore b/.gitignore index 5e581a5..0f21137 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,4 @@ dmypy.json # Just in case you want to test out the defaults in the repo packagename None/ +cookies diff --git a/tests/conftest.py b/tests/conftest.py index 6f27dfa..5aa42ab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,8 @@ -import py +import py # noqa: F401 import pytest -import tox -from tox.pytest import init_fixture +import tox # noqa: F401 +from tox.pytest import init_fixture # noqa: F401 @pytest.fixture(params=["bake_default", @@ -88,5 +88,13 @@ def bake_examples_compiled_dev_version(cookies): result = cookies.bake(extra_context={"include_example_code": "y", "use_compiled_extensions": "y", "enable_dynamic_dev_versions": "y", - "author_name": "test"}) + "author_name": "test", + "include_cruft_update_github_workflow": "n", + }) return _handle_cookiecutter_errors(result) + + +# Add support for saving out rendered cookies to a specific location for inspection + +def pytest_addoption(parser): + parser.addoption("--cookie-location", action="store", default=None) diff --git a/tests/test_build_artifacts.py b/tests/test_build_artifacts.py new file mode 100644 index 0000000..0896594 --- /dev/null +++ b/tests/test_build_artifacts.py @@ -0,0 +1,25 @@ +""" +This test file let's you render the examples we use in the tests to a given +directory for ease of inspection. +This means that you can check things like whitespace or other issues in a rendered example. +""" +import pytest +import shutil +from pathlib import Path + + +@pytest.mark.parametrize("bake_name", + ["bake_default", + "bake_examples", + "bake_examples_compiled", + "bake_examples_compiled_dev_version"]) +def test_render_template(request, bake_name, pytestconfig): + bake = request.getfixturevalue(bake_name) + cached_dir = pytestconfig.getoption("--cookie-location") + if not cached_dir: + pytest.skip("No cookie location provided skipping render") + + target_dir = Path(cached_dir) / bake_name.removeprefix("bake_") + if target_dir.exists(): + shutil.rmtree(target_dir) + shutil.copytree(bake.project_path, target_dir) diff --git a/tox.ini b/tox.ini index 17b9b0c..974e5d8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = py{310,311,312}-test + bake_cookies build-docs [testenv] @@ -20,7 +21,8 @@ deps = tox[testing] commands = - pytest tests/ {posargs} + !bake_cookies: pytest tests/ {posargs} + bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies [testenv:build_docs] description = invoke sphinx-build to build the HTML docs From 4ee3aedbdc74aedc3125f8b959d11f28abb9da9d Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 24 Jul 2024 15:02:43 +0100 Subject: [PATCH 084/265] Fix a bug where if we weren't including the update workflow no gh workflows would be included --- hooks/post_gen_project.py | 2 +- tests/conftest.py | 2 +- tests/test_hooks.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 94ff8ab..c56e114 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -37,7 +37,7 @@ def process_version(enable_dynamic_dev_versions): def process_github_workflow(include_cruft_update_github_workflow): if include_cruft_update_github_workflow != "y": - remove_dir(os.path.join(PROJECT_DIRECTORY, '.github')) + remove_file(os.path.join(PROJECT_DIRECTORY, '.github', 'workflows', 'sub_package_update.yml')) if __name__ == '__main__': diff --git a/tests/conftest.py b/tests/conftest.py index 5aa42ab..d3ad4d1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,7 +89,7 @@ def bake_examples_compiled_dev_version(cookies): "use_compiled_extensions": "y", "enable_dynamic_dev_versions": "y", "author_name": "test", - "include_cruft_update_github_workflow": "n", + "include_cruft_update_github_workflow": "y", }) return _handle_cookiecutter_errors(result) diff --git a/tests/test_hooks.py b/tests/test_hooks.py index d548861..f5b1950 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -77,3 +77,33 @@ def test_other_licence(cookies): for name, lfile in license_files.items(): assert (cj.project_path / "licenses" / lfile).exists() + + +def test_cruft_update_exists(bake_examples_compiled_dev_version): + cj = bake_examples_compiled_dev_version + + present_files = [ + ".github/workflows/sub_package_update.yml", + ".github/workflows/ci.yml", + ] + + for afile in present_files: + assert (cj.project_path / afile).exists() + + +def test_cruft_update_absent(bake_examples_compiled): + cj = bake_examples_compiled + + present_files = [ + ".github/workflows/ci.yml" + ] + + absent_files = [ + ".github/workflows/sub_package_update.yml" + ] + + for afile in present_files: + assert (cj.project_path / afile).exists() + + for afile in absent_files: + assert not (cj.project_path / afile).exists() From 4adce8ecb5a107987c205d71d969428fa8de6a0f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 24 Jul 2024 15:39:17 +0100 Subject: [PATCH 085/265] Fix a whitespace bug with pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 35122ff..e4d8c2f 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -6,8 +6,8 @@ requires = [ {%- if cookiecutter.use_compiled_extensions == 'y' %} "extension-helpers", "numpy>=1.25", - "cython" -{% endif -%} + "cython", +{%- endif %} ] build-backend = "setuptools.build_meta" From 7ece5f06deb9e54ff51b9b23da4af03dbcf13cde Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 24 Jul 2024 15:43:24 +0100 Subject: [PATCH 086/265] docs --- README.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index a75ef86..a9d552a 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,10 @@ -OpenAstronomy Packaging Guide -============================= +SunPy Package Template +====================== -The `OpenAstronomy Python Packaging Guide `__ that contains an embedded `cookiecutter `__ template. -Please see also the `instructions for using the template `__. +This repo extends the `OpenAstronomy Python Packaging Guide `__ to add SunPy specific features such as config files which are shared over all of SunPy's packages. + +Previewing Rendered Templates +----------------------------- + +To make it easier to preview changes to files when rendering the template there is a tox environment named ``bake_cookies``. +If you run ``tox -e bake_cookies`` a new directory named ``cookies`` will be present with a variety of test renders of the template in (see ``tests/conftest.py`` for the configuration options). From a1e8503c807fee8549459d6b8018dc0df7848630 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 24 Jul 2024 21:07:12 +0100 Subject: [PATCH 087/265] Update tests/conftest.py Co-authored-by: Nabil Freij --- tests/conftest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d3ad4d1..3902009 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -94,7 +94,6 @@ def bake_examples_compiled_dev_version(cookies): return _handle_cookiecutter_errors(result) -# Add support for saving out rendered cookies to a specific location for inspection - def pytest_addoption(parser): + # Add support for saving out rendered cookies to a specific location for inspection parser.addoption("--cookie-location", action="store", default=None) From 845680ef01dd0dbb390659004c2ef43f2208356b Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 31 Jul 2024 07:01:40 +0000 Subject: [PATCH 088/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 3c063ed..c369eeb 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.4" + rev: "v0.5.5" hooks: - id: ruff args: ["--fix"] From 402fcc2b3d4110f69ebd71560263d619e9f22d7d Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 7 Aug 2024 07:02:03 +0000 Subject: [PATCH 089/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index c369eeb..eeae735 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.5" + rev: "v0.5.6" hooks: - id: ruff args: ["--fix"] From 9be1de0a56b184fede19279c38085afc16d97174 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 14 Aug 2024 07:01:45 +0000 Subject: [PATCH 090/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index eeae735..485cbd2 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.6" + rev: "v0.5.7" hooks: - id: ruff args: ["--fix"] From 5da462e2bcaf058e9d3d7270532c3fb6a2cda230 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Wed, 7 Aug 2024 10:03:35 -0700 Subject: [PATCH 091/265] Update software versions for RTD --- {{ cookiecutter.package_name }}/.readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.readthedocs.yaml b/{{ cookiecutter.package_name }}/.readthedocs.yaml index 790abab..3d9312d 100644 --- a/{{ cookiecutter.package_name }}/.readthedocs.yaml +++ b/{{ cookiecutter.package_name }}/.readthedocs.yaml @@ -1,9 +1,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: "mambaforge-4.10" + python: "mambaforge-latest" jobs: post_checkout: - git fetch --unshallow || true From 3b70ed0ac676552570786ad6d52164f0e60bb577 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 19 Aug 2024 09:41:46 -0700 Subject: [PATCH 092/265] Add setup tools --- {{ cookiecutter.package_name }}/.rtd-environment.yml | 2 +- {{ cookiecutter.package_name }}/pyproject.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.rtd-environment.yml b/{{ cookiecutter.package_name }}/.rtd-environment.yml index 16c606e..5528179 100644 --- a/{{ cookiecutter.package_name }}/.rtd-environment.yml +++ b/{{ cookiecutter.package_name }}/.rtd-environment.yml @@ -2,6 +2,6 @@ name: {{ cookiecutter.package_name }} channels: - conda-forge dependencies: - - python=3.10 + - python=3.12 - pip - graphviz!=2.42.*,!=2.43.* diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index e4d8c2f..4635dd1 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -54,10 +54,14 @@ zip-safe = false include-package-data = true [tool.setuptools.packages.find] +include = ["{{ cookiecutter.module_name }}*"] {%- if cookiecutter.enable_dynamic_dev_versions == 'y' %} exclude = ["{{ cookiecutter.module_name }}._dev*"] {%- endif %} - +{% if cookiecutter.use_compiled_extensions == 'y' %} +[tool.setuptools.exclude-package-data] +"*" = ["*.c", "*.h"] +{% endif %} [tool.setuptools_scm] {% if cookiecutter.enable_dynamic_dev_versions == 'y' -%} write_to = "{{ cookiecutter.module_name }}/_version.py" From dbdbc9a665f382fec939764a2446c85e7deea1aa Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 21 Aug 2024 07:02:02 +0000 Subject: [PATCH 093/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 485cbd2..ecd1c59 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.7" + rev: "v0.6.1" hooks: - id: ruff args: ["--fix"] From 02c6498dacf1ff2ab5f75292f93fe29deffaf7e4 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 28 Aug 2024 07:01:53 +0000 Subject: [PATCH 094/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index ecd1c59..4699840 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.1" + rev: "v0.6.2" hooks: - id: ruff args: ["--fix"] From 3bf3b8eb6ea4ef772f21dfed477de2b2cac26f37 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 4 Sep 2024 07:01:45 +0000 Subject: [PATCH 095/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 4699840..6986531 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.2" + rev: "v0.6.3" hooks: - id: ruff args: ["--fix"] From 10120186ce3e6d33c8695ee62782fe71dee116df Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 10 Sep 2024 14:27:10 +0100 Subject: [PATCH 096/265] Add a script to update all repos --- scripts/all_update.py | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 scripts/all_update.py diff --git a/scripts/all_update.py b/scripts/all_update.py new file mode 100644 index 0000000..916721c --- /dev/null +++ b/scripts/all_update.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "typer", +# "batchpr@git+https://github.com/astrofrog/batchpr", +# "cruft@git+https://github.com/Cadair/cruft@patch-p1", +# ] +# /// +""" +This script runs cruft update on all templated sponsored affiliated packages and opens PRs. + +The main usecase for this script is when the CI files have been updated as +Github actions can't modify the Github actions workflow files. + +You can run this script with: + + pipx run ./all_update.py --help +""" + +import os +from typing import Annotated, Optional + +from batchpr import Updater +from cruft import update +import typer + + +ALL_REPOS = ( + "sunpy/sunpy", + "sunpy/ndcube", + "sunpy/sunkit-magex", + "sunpy/streamtracer", + "sunpy/sunkit-dem", + "sunpy/mpl-animators", + "sunpy/sunkit-image", + "sunpy/sunkit-pyvista", + "sunpy/sunpy-soar", +) + + +class CruftUpdater(Updater): + + def process_repo(self): + ret = update(skip_apply_ask=True, refresh_private_variables=True) + if not ret: + self.error(f"Cruft update failed for {self.repo}") + return False + self.add(".") + return True + + @property + def commit_message(self): + return "Update cruft with batchpr" + + @property + def branch_name(self): + return 'cruft-manual-update' + + @property + def pull_request_title(self): + return "Updates from package template" + + @property + def pull_request_body(self): + return "This PR has been generated by a script, it should update the repo with the latest changes from the package template." + + +def run_multi_updater( + github_token: Annotated[str, typer.Option(envvar="GITHUB_TOKEN")], + repos: Annotated[list[str], typer.Option()] = ALL_REPOS, + dry_run: bool = False, + verbose: bool = False +): + """ + Run the Cruft Updater script against all repos. + + The GITHUB_TOKEN should be a Personal Access Token (classic) with the workflow permission and public_repo permissions. + """ + helper = CruftUpdater(token=os.environ["GITHUB_TOKEN"], dry_run=dry_run, verbose=verbose) + for repo in repos: + helper.run(repo) + + +if __name__ == "__main__": + typer.run(run_multi_updater) From 6853cf9552e434b72f872dbbdc75f03d27654415 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 09:51:22 +0100 Subject: [PATCH 097/265] Better name for the script [ci skip] --- scripts/all_update.py => tools/batchpr_manual_cruft_update.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/all_update.py => tools/batchpr_manual_cruft_update.py (100%) mode change 100644 => 100755 diff --git a/scripts/all_update.py b/tools/batchpr_manual_cruft_update.py old mode 100644 new mode 100755 similarity index 100% rename from scripts/all_update.py rename to tools/batchpr_manual_cruft_update.py From a7a65480c61a8a9a4acd5dd9ed17ed734b9228db Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:01:47 +0000 Subject: [PATCH 098/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 6986531..e96762e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.3" + rev: "v0.6.4" hooks: - id: ruff args: ["--fix"] From 20f0af1fbac404a7c57845b5487efb8d446eaae4 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 09:58:20 +0100 Subject: [PATCH 099/265] Add dependabot for us and the template --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..06dbaf9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "{{ cookiecutter.package_name }}/" + schedule: + interval: "weekly" From cc15ef7f05cbecc97f0bfed2a86edfe65e428492 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:05:08 +0100 Subject: [PATCH 100/265] Update dependabot.yml --- .github/dependabot.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 06dbaf9..cb63a24 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,9 @@ version: 2 updates: - package-ecosystem: "github-actions" + directroies: + - "/" + - "{{ cookiecutter.package_name }}/.github/workflows" directory: "/" schedule: interval: "weekly" - - package-ecosystem: "github-actions" - directory: "{{ cookiecutter.package_name }}/" - schedule: - interval: "weekly" From 1b89ec25d7a75c2ac841388d3dcbebe04e3f703c Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:05:36 +0100 Subject: [PATCH 101/265] Update dependabot.yml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cb63a24..06b34f5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: "github-actions" - directroies: + directories: - "/" - "{{ cookiecutter.package_name }}/.github/workflows" directory: "/" From 7255d64a92bb4780312f2a77c80bde776137e7d4 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:07:35 +0100 Subject: [PATCH 102/265] Update dependabot.yml --- .github/dependabot.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 06b34f5..3f3367a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,5 @@ updates: directories: - "/" - "{{ cookiecutter.package_name }}/.github/workflows" - directory: "/" schedule: interval: "weekly" From 6590e6dc9f16c8c131c965e2707db2e73bf779a1 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:14:58 +0100 Subject: [PATCH 103/265] Update dependabot.yml --- .github/dependabot.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f3367a..0b1b060 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,7 @@ updates: - package-ecosystem: "github-actions" directories: - "/" - - "{{ cookiecutter.package_name }}/.github/workflows" + # This doesn't work because of jinja templating. + # - "{{ cookiecutter.package_name }}/.github/workflows" schedule: interval: "weekly" From b897bf17751545a06163f469e8fe86100a0762e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:15:41 +0000 Subject: [PATCH 104/265] Bump peter-evans/create-pull-request from 6 to 7 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index a91e05c..3f592c3 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -63,7 +63,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} draft: ${{ steps.merge.outputs.has_conflicts == '1' }} diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 69aabaa..b190942 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -35,7 +35,7 @@ jobs: run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' - name: Create pull request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true From 9c6988beb2777f3eeb071d21c5d1df303fcbbc0e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:19:56 +0100 Subject: [PATCH 105/265] Update sub_package_update.yml --- .../.github/workflows/sub_package_update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 0677948..7455847 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -65,7 +65,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} add-paths: ${{ matrix.add-paths }} From 284970c3a30606b9f4bcfea09c0045d67fbf889c Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 10:39:24 +0100 Subject: [PATCH 106/265] because I just love to please @nabobalis --- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 9e16a35..9a3d4e1 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -91,7 +91,6 @@ jobs: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} publish: - needs: [test, docs] # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi if: | @@ -100,6 +99,7 @@ jobs: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run publish') ) + needs: [test, docs] {%- if cookiecutter.use_compiled_extensions == 'y' %} uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main with: From c480aec0b8887ba3f39920c5bd3780da86064b0d Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Sep 2024 11:21:44 +0100 Subject: [PATCH 107/265] Add sunkit-instruments to the script list --- tools/batchpr_manual_cruft_update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/batchpr_manual_cruft_update.py b/tools/batchpr_manual_cruft_update.py index 916721c..cdabd4e 100755 --- a/tools/batchpr_manual_cruft_update.py +++ b/tools/batchpr_manual_cruft_update.py @@ -36,6 +36,7 @@ "sunpy/sunkit-image", "sunpy/sunkit-pyvista", "sunpy/sunpy-soar", + "sunpy/sunkit-instruments", ) From d4d21979c9c778b223a4a672952c4113364595de Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 18 Sep 2024 07:01:57 +0000 Subject: [PATCH 108/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index e96762e..fd20e83 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.4" + rev: "v0.6.5" hooks: - id: ruff args: ["--fix"] From c71b62fa6adb9ab336324b16364d957cfb83d524 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 25 Sep 2024 07:01:59 +0000 Subject: [PATCH 109/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index fd20e83..965b786 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.5" + rev: "v0.6.7" hooks: - id: ruff args: ["--fix"] From dcd5ea6d36eff10abd5bd4e1b7bd5b9493594950 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Tue, 17 Sep 2024 16:19:24 -0400 Subject: [PATCH 110/265] better version parsing for docs build --- {{ cookiecutter.package_name }}/docs/conf.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index e595c98..c5c5355 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -6,12 +6,23 @@ import datetime +from packaging.version import Version + # -- Project information ----------------------------------------------------- # The full version, including alpha/beta/rc tags from {{ cookiecutter.module_name }} import __version__ -release = __version__ +_version_ = Version(__version__) +# NOTE: Avoid "post" appearing in version string in rendered docs +if _version_.is_postrelease: + version = release = f'{_version_.major}.{_version_.minor}.{_version_.micro}' +# NOTE: Avoid long githashes in rendered Sphinx docs +elif _version_.is_devrelease: + version = release = f'{_version_.major}.{_version_.minor}.dev{_version_.dev}' +else: + version = release = str(_version_) +is_development = _version_.is_devrelease project = "{{ cookiecutter.package_name }}" author = "{{ cookiecutter.author_name }}" From 33f857c4fd4053f75f7ccc7876fd5dc4e15c2113 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Tue, 24 Sep 2024 14:09:08 -0400 Subject: [PATCH 111/265] use base version --- {{ cookiecutter.package_name }}/docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index c5c5355..1789d57 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -16,10 +16,10 @@ _version_ = Version(__version__) # NOTE: Avoid "post" appearing in version string in rendered docs if _version_.is_postrelease: - version = release = f'{_version_.major}.{_version_.minor}.{_version_.micro}' + version = release = _version_.base_version # NOTE: Avoid long githashes in rendered Sphinx docs elif _version_.is_devrelease: - version = release = f'{_version_.major}.{_version_.minor}.dev{_version_.dev}' + version = release = f'{_version_.base_version}.dev{_version_.dev}' else: version = release = str(_version_) is_development = _version_.is_devrelease From 68df6ae634405d809b40d28bd14e6b8a5b240485 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Wed, 25 Sep 2024 07:17:40 -0400 Subject: [PATCH 112/265] Update conf.py Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/docs/conf.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 1789d57..fb8fa45 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -13,16 +13,15 @@ # The full version, including alpha/beta/rc tags from {{ cookiecutter.module_name }} import __version__ -_version_ = Version(__version__) -# NOTE: Avoid "post" appearing in version string in rendered docs -if _version_.is_postrelease: - version = release = _version_.base_version -# NOTE: Avoid long githashes in rendered Sphinx docs -elif _version_.is_devrelease: - version = release = f'{_version_.base_version}.dev{_version_.dev}' -else: - version = release = str(_version_) -is_development = _version_.is_devrelease +_version = Version(__version__) +version = release = str(_version) +# Avoid "post" appearing in version string in rendered docs +if _version.is_postrelease: + version = release = _version.base_version +# Avoid long githashes in rendered Sphinx docs +elif _version.is_devrelease: + version = release = f'{_version.base_version}.dev{_version.dev}' +is_development = _version.is_devrelease project = "{{ cookiecutter.package_name }}" author = "{{ cookiecutter.author_name }}" From 93135e04b90973a471c362fed83c8560ac0887ca Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 25 Sep 2024 13:50:09 +0100 Subject: [PATCH 113/265] Add packaging dep to docs --- {{ cookiecutter.package_name }}/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 4635dd1..5054519 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -42,6 +42,7 @@ tests = [ docs = [ "sphinx", "sphinx-automodapi", + "packaging", ] {%- if cookiecutter.project_url %} From 174811c5a1e126ca273cd2a9b76335c28f782579 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 30 Sep 2024 11:41:44 +0100 Subject: [PATCH 114/265] Add an is_release variable --- {{ cookiecutter.package_name }}/docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index fb8fa45..c8f8668 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -22,6 +22,7 @@ elif _version.is_devrelease: version = release = f'{_version.base_version}.dev{_version.dev}' is_development = _version.is_devrelease +is_release = not(_version.is_prerelease or _version.is_devrelease) project = "{{ cookiecutter.package_name }}" author = "{{ cookiecutter.author_name }}" From 68d0582d1020fea64d658f8e13b4de08a9560def Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 30 Sep 2024 11:49:23 +0100 Subject: [PATCH 115/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index c8f8668..e625dd3 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -63,7 +63,7 @@ master_doc = "index" # Treat everything in single ` as a Python reference. -default_role = 'py:obj' +default_role = "py:obj" # -- Options for intersphinx extension --------------------------------------- From bc171f15fcf56a55fb03178208739ad15b71acd0 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 30 Sep 2024 12:13:30 +0100 Subject: [PATCH 116/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index e625dd3..0d8ccf3 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -20,7 +20,7 @@ version = release = _version.base_version # Avoid long githashes in rendered Sphinx docs elif _version.is_devrelease: - version = release = f'{_version.base_version}.dev{_version.dev}' + version = release = f"{_version.base_version}.dev{_version.dev}" is_development = _version.is_devrelease is_release = not(_version.is_prerelease or _version.is_devrelease) From e29ff4914d64d93ba8322c12808cd1e3d714c340 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 2 Oct 2024 07:01:53 +0000 Subject: [PATCH 117/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 965b786..cd5dbe7 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.7" + rev: "v0.6.8" hooks: - id: ruff args: ["--fix"] From c11a88c2c259ffc9945b27254d0c96a662f52cff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:14:11 +0000 Subject: [PATCH 118/265] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37525ff..30b0079 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-case-conflict - id: trailing-whitespace From 1f8da704a40238290c1b2efcf997718cd81b250e Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 9 Oct 2024 07:02:05 +0000 Subject: [PATCH 119/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index cd5dbe7..a14fd99 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.8" + rev: "v0.6.9" hooks: - id: ruff args: ["--fix"] @@ -11,7 +11,7 @@ repos: - id: isort exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-ast - id: check-case-conflict From 3f5d6fcd6fe999a5f63b9b1bc4ddf7733acebd76 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 16 Oct 2024 11:36:33 +0100 Subject: [PATCH 120/265] Update __init__.py --- .../{{ cookiecutter.module_name }}/_dev/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/__init__.py index 72583c0..e38b3a8 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/__init__.py @@ -1,5 +1,5 @@ """ -This package contains utilities that are only used when developing drms in a +This package contains utilities that are only used when developing in a copy of the source repository. These files are not installed, and should not be assumed to exist at runtime. From 8334c24250a0f7da1ce0cb4d0f13ae5b1cc81a7a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 16 Oct 2024 14:55:16 +0100 Subject: [PATCH 121/265] Adds graphviz arguments to docs/conf --- {{ cookiecutter.package_name }}/docs/conf.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 0d8ccf3..dbc36cb 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -76,6 +76,18 @@ # a list of builtin themes. html_theme = "{{ cookiecutter._sphinx_theme }}" +# Render inheritance diagrams in SVG +graphviz_output_format = "svg" + +graphviz_dot_args = [ + "-Nfontsize=10", + "-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif", + "-Efontsize=10", + "-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif", + "-Gfontsize=10", + "-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif", +] + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". From a6c38c53d7eb081b4f2d2e4599f87fd39b172c28 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 21 Oct 2024 08:34:09 +0100 Subject: [PATCH 122/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index dbc36cb..fcda2e7 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -48,7 +48,7 @@ ] # Add any paths that contain templates here, relative to this directory. -# templates_path = ["_templates"] +# templates_path = ["_templates"] # NOQA: ERA001 # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From aec53b81aed2e7e534045e59303d82712fe82fb1 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 21 Oct 2024 08:34:51 +0100 Subject: [PATCH 123/265] Update conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index fcda2e7..2334ed8 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -91,7 +91,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] +# html_static_path = ["_static"] # NOQA: ERA001 # By default, when rendering docstrings for classes, sphinx.ext.autodoc will # make docs with the class-level docstring and the class-method docstrings, From 653a294b40f8e64123b5d24bf47863d5eaa95419 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 23 Oct 2024 07:02:00 +0000 Subject: [PATCH 124/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index a14fd99..3097e25 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.9" + rev: "v0.7.0" hooks: - id: ruff args: ["--fix"] From 69d58df3b6a28e491d40ab0e8b557a4dd1f59954 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 14:14:20 +0000 Subject: [PATCH 125/265] Adds proposed new .ruff.toml --- {{ cookiecutter.package_name }}/.ruff.toml | 49 +++++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 55f69cb..a4b09c9 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -1,5 +1,5 @@ target-version = "py310" -line-length = 110 +line-length = 120 exclude = [ ".git,", "__pycache__", @@ -8,16 +8,53 @@ exclude = [ ] [lint] -select = ["E", "F", "W", "UP", "PT"] +select = [ + "E", + "F", + "W", + "N", + "UP", + "BLE", + "A", + "C4", + "INP", + "PIE", + "T20", + "PT", + "RET", + "TID", + "PTH", + "PD", + "PLC", + "PLE", + "FLY", + "NPY", + "PERF", + "RUF", +] extend-ignore = [ - # pycodestyle (E, W) - "E501", # LineTooLong # TODO! fix + "E501", # ignore line length will use a formatter instead + "E712", + "E721", + # flake8-pie + "PIE808", # Disallow passing 0 as the first argument to range + # upgrades + "UP038", # Use | in isinstance - not compatible with models and is slower + # numpy + "NPY002", # TODO: migrate from np.random.rand to np.random.Generator # pytest (PT) "PT001", # Always use pytest.fixture() "PT004", # Fixtures which don't return anything should have leading _ - "PT007", # Parametrize should be lists of tuples # TODO! fix - "PT011", # Too broad exception assert # TODO! fix + "PT011", # except(ValueRaises) is too broad + "PT012", # TODO: temporary override for test_global_coords::test_overwrite "PT023", # Always use () on pytest decorators + # flake8-use-pathlib + "PTH123", # open() should be replaced by Path.open() + # Ruff + "RUF003", # Ignore ambiguous quote marks, doesn't allow ' in comments + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "RUF013", # PEP 484 prohibits implicit `Optional` + "RUF015", # Prefer `next(iter(...))` over single element slice ] [lint.per-file-ignores] From 083d2041c96a4d7f672aa2ba284b73de430f3158 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 14:41:44 +0000 Subject: [PATCH 126/265] Modifies tox[testing] tox[test] In line with https://github.com/tox-dev/tox/pull/3422 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 974e5d8..a43cce1 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[testing] + tox[test] commands = !bake_cookies: pytest tests/ {posargs} From d4075da5750750aa9aa1b5f2cfe11ca3603bb350 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 15:46:36 +0000 Subject: [PATCH 127/265] Make relative imports absolute --- {{ cookiecutter.package_name }}/.ruff.toml | 9 ++++++--- {{ cookiecutter.package_name }}/docs/conf.py | 4 ++-- .../{{ cookiecutter.module_name }}/_dev/scm_version.py | 4 ++-- .../{{ cookiecutter.module_name }}/example_mod.py | 5 ++--- .../{{ cookiecutter.module_name }}/tests/test_example.py | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index a4b09c9..e355731 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -33,9 +33,10 @@ select = [ "RUF", ] extend-ignore = [ + # pycodestyle "E501", # ignore line length will use a formatter instead - "E712", - "E721", + "E712", # Avoid equality comparisons to True; use if {cond}: for truth checks + "E721", # type comparison Use is and is not for type comparisons, or isinstance() for isinstance checks # flake8-pie "PIE808", # Disallow passing 0 as the first argument to range # upgrades @@ -46,7 +47,6 @@ extend-ignore = [ "PT001", # Always use pytest.fixture() "PT004", # Fixtures which don't return anything should have leading _ "PT011", # except(ValueRaises) is too broad - "PT012", # TODO: temporary override for test_global_coords::test_overwrite "PT023", # Always use () on pytest decorators # flake8-use-pathlib "PTH123", # open() should be replaced by Path.open() @@ -67,6 +67,9 @@ extend-ignore = [ "docs/*.py" = [ "INP001", # Implicit-namespace-package. The examples are not a package. ] +"{{ cookiecutter.package_name }}/*.py" = [ + "T201", # allow use of print in examples +] "__init__.py" = ["E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 2334ed8..dbc36cb 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -48,7 +48,7 @@ ] # Add any paths that contain templates here, relative to this directory. -# templates_path = ["_templates"] # NOQA: ERA001 +# templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -91,7 +91,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ["_static"] # NOQA: ERA001 +# html_static_path = ["_static"] # By default, when rendering docstrings for classes, sphinx.ext.autodoc will # make docs with the class-level docstring and the class-method docstrings, diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/scm_version.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/scm_version.py index 1bcf0dd..988debf 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/scm_version.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/_dev/scm_version.py @@ -1,11 +1,11 @@ # Try to use setuptools_scm to get the current version; this is only used # in development installations from the git repository. -import os.path +from pathlib import Path try: from setuptools_scm import get_version - version = get_version(root=os.path.join('..', '..'), relative_to=__file__) + version = get_version(root=Path('../..'), relative_to=__file__) except ImportError: raise except Exception as e: diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index b2eff69..5a6bbda 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -47,9 +47,8 @@ def do_primes(n, usecython=False): print('Using cython-based primes') return cprimes(n) {% endif %} - else: - print('Using pure python primes') - return primes(n) + print('Using pure python primes') + return primes(n) def main(args=None): diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py index 33d4574..9d766e5 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py @@ -1,9 +1,9 @@ {% if cookiecutter.use_compiled_extensions == 'y' %} def test_primes_c(): - from ..example_c import primes as primes_c + from {{ cookiecutter.module_name }}.example_c import primes as primes_c assert primes_c(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] {% endif %} def test_primes(): - from ..example_mod import primes + from {{ cookiecutter.module_name }}.example_mod import primes assert primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] From 3160866d9dc9331992d39f8b03cd0f0efb02dd60 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 16:57:02 +0000 Subject: [PATCH 128/265] Add logic to allow flexible roll out of ruff lint --- cookiecutter.json | 1 + {{ cookiecutter.package_name }}/.ruff.toml | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index d370543..b441004 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -22,6 +22,7 @@ "enable_dynamic_dev_versions": "n", "include_example_code": "n", "include_cruft_update_github_workflow": "n", + "use_extended_ruff_linting": "n", "_sphinx_theme": "alabaster", "_parent_project": "", "_install_requires": "", diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index e355731..a54f3f0 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -14,13 +14,14 @@ select = [ "W", "N", "UP", + "PT", + {% if cookiecutter.use_extended_ruff_linting == 'y' %} "BLE", "A", "C4", "INP", "PIE", "T20", - "PT", "RET", "TID", "PTH", @@ -31,23 +32,23 @@ select = [ "NPY", "PERF", "RUF", + {% endif -%} ] extend-ignore = [ # pycodestyle "E501", # ignore line length will use a formatter instead "E712", # Avoid equality comparisons to True; use if {cond}: for truth checks "E721", # type comparison Use is and is not for type comparisons, or isinstance() for isinstance checks - # flake8-pie - "PIE808", # Disallow passing 0 as the first argument to range # upgrades "UP038", # Use | in isinstance - not compatible with models and is slower - # numpy - "NPY002", # TODO: migrate from np.random.rand to np.random.Generator # pytest (PT) "PT001", # Always use pytest.fixture() "PT004", # Fixtures which don't return anything should have leading _ "PT011", # except(ValueRaises) is too broad "PT023", # Always use () on pytest decorators + {% if cookiecutter.use_extended_ruff_linting == 'y'} + # flake8-pie + "PIE808", # Disallow passing 0 as the first argument to range # flake8-use-pathlib "PTH123", # open() should be replaced by Path.open() # Ruff @@ -55,6 +56,7 @@ extend-ignore = [ "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` "RUF013", # PEP 484 prohibits implicit `Optional` "RUF015", # Prefer `next(iter(...))` over single element slice + {% endif -%} ] [lint.per-file-ignores] From 7184bf1af00748e1de4cd2e9d3f2cc28c0cbfc2f Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 17:14:24 +0000 Subject: [PATCH 129/265] add ruff to test matrix --- tests/conftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3902009..395ad61 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -65,7 +65,8 @@ def bake_examples(cookies): Examples on. """ result = cookies.bake(extra_context={"include_example_code": "y", - "author_name": "test"}) + "author_name": "test", + "use_extended_ruff_linting": "y"}) return _handle_cookiecutter_errors(result) @@ -76,7 +77,8 @@ def bake_examples_compiled(cookies): """ result = cookies.bake(extra_context={"include_example_code": "y", "use_compiled_extensions": "y", - "author_name": "test"}) + "author_name": "test", + "use_extended_ruff_linting": "n"}) return _handle_cookiecutter_errors(result) @@ -90,6 +92,7 @@ def bake_examples_compiled_dev_version(cookies): "enable_dynamic_dev_versions": "y", "author_name": "test", "include_cruft_update_github_workflow": "y", + "use_extended_ruff_linting": "y", }) return _handle_cookiecutter_errors(result) From 138304f53f9b1e37cae1e4f509d9ac9581adc88b Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 28 Oct 2024 17:18:14 +0000 Subject: [PATCH 130/265] fix syntax by removing it --- {{ cookiecutter.package_name }}/.ruff.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index a54f3f0..c242ecb 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -15,7 +15,7 @@ select = [ "N", "UP", "PT", - {% if cookiecutter.use_extended_ruff_linting == 'y' %} + {%- if cookiecutter.use_extended_ruff_linting == 'y' %} "BLE", "A", "C4", @@ -46,7 +46,6 @@ extend-ignore = [ "PT004", # Fixtures which don't return anything should have leading _ "PT011", # except(ValueRaises) is too broad "PT023", # Always use () on pytest decorators - {% if cookiecutter.use_extended_ruff_linting == 'y'} # flake8-pie "PIE808", # Disallow passing 0 as the first argument to range # flake8-use-pathlib @@ -56,7 +55,6 @@ extend-ignore = [ "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` "RUF013", # PEP 484 prohibits implicit `Optional` "RUF015", # Prefer `next(iter(...))` over single element slice - {% endif -%} ] [lint.per-file-ignores] From 892a1a7f69605bc530609836e34749f8d0794c59 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 29 Oct 2024 09:14:14 +0000 Subject: [PATCH 131/265] Uses SunPy docs theme in template --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index b441004..86e6a43 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -23,7 +23,7 @@ "include_example_code": "n", "include_cruft_update_github_workflow": "n", "use_extended_ruff_linting": "n", - "_sphinx_theme": "alabaster", + "_sphinx_theme": "sunpy", "_parent_project": "", "_install_requires": "", "_copy_without_render": [ From ec23899036f9d1db4a1dccc07d7d4dea3e1188b5 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 29 Oct 2024 14:59:13 +0000 Subject: [PATCH 132/265] Adds sunpy-sphinx-theme deps --- tox.ini | 1 + {{ cookiecutter.package_name }}/pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index a43cce1..46dead5 100644 --- a/tox.ini +++ b/tox.ini @@ -30,5 +30,6 @@ change_dir = docs deps = sphinx + sunpy-sphinx-theme commands = sphinx-build -W -b html . _build/html {posargs} diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 5054519..c743f14 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -42,6 +42,7 @@ tests = [ docs = [ "sphinx", "sphinx-automodapi", + "sunpy-sphinx-theme", "packaging", ] From 4e4a4568101362bd8ccd06d774458829d0d6b22a Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 30 Oct 2024 07:02:04 +0000 Subject: [PATCH 133/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 3097e25..6c5a7a0 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.0" + rev: "v0.7.1" hooks: - id: ruff args: ["--fix"] From dca494c8d4548fa92efb258defd5bd78b6835a72 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Oct 2024 11:38:21 +0000 Subject: [PATCH 134/265] Only run pre-commit update monthly --- .github/workflows/pre-commit-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index b190942..1c52cf6 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -12,7 +12,7 @@ on: # │ │ ┌───────── day of the month (1 - 31) # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - - cron: '0 7 * * 3' # Every Wednesday at 7am UTC (so it can be merged before the monday package updates) + - cron: '0 7 1 * 3' # First Wednesday of the month at 7am UTC (so it can be merged before the monday package updates) jobs: update: From 707f39dc56be035862a93f349758229b484ee91a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Oct 2024 12:00:16 +0000 Subject: [PATCH 135/265] Fix ruff and hidden cookies --- {{ cookiecutter.package_name }}/.ruff.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index c242ecb..7878589 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -12,10 +12,10 @@ select = [ "E", "F", "W", - "N", "UP", "PT", {%- if cookiecutter.use_extended_ruff_linting == 'y' %} + "N", "BLE", "A", "C4", @@ -32,7 +32,7 @@ select = [ "NPY", "PERF", "RUF", - {% endif -%} + {%- endif %} ] extend-ignore = [ # pycodestyle From 58f6da588529d5c3f3bfe1a4958b00764dcd1623 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Oct 2024 15:37:47 +0000 Subject: [PATCH 136/265] Improve cruft workflow --- .../.github/workflows/sub_package_update.yml | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 7455847..0b657f2 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -21,14 +21,6 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: true - matrix: - include: - - add-paths: . - body: apply the changes to this repo. - branch: cruft/update - commit-message: "Automatic package template update" - title: Updates from the package template - steps: - uses: actions/checkout@v4 @@ -55,25 +47,47 @@ jobs: echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT" - name: Run update if available + id: cruft_update if: steps.check.outputs.has_changes == '1' run: | git config --global user.email "${{ github.actor }}@users.noreply.github.com" git config --global user.name "${{ github.actor }}" - cruft update --skip-apply-ask --refresh-private-variables + cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables) + echo $cruft_output git restore --staged . - - name: Create pull request + if [[ "$cruft_output" == *"Failed to cleanly apply the update, there may be merge conflicts."* ]]; then + echo merge_conflicts=1 >> $GITHUB_OUTPUT + else + echo merge_conflicts=0 >> $GITHUB_OUTPUT + fi + + - name: Check if only .cruft.json is modified + id: cruft_json if: steps.check.outputs.has_changes == '1' + run: | + git status --porcelain=1 + if [[ "$(git status --porcelain=1)" == " M .cruft.json" ]]; then + echo "Only .cruft.json is modified. Exiting workflow early." + echo "has_changes=0" >> "$GITHUB_OUTPUT" + else + echo "has_changes=1" >> "$GITHUB_OUTPUT" + fi + + - name: Create pull request + if: steps.cruft_json.outputs.has_changes == '1' uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} - add-paths: ${{ matrix.add-paths }} - commit-message: ${{ matrix.commit-message }} - branch: ${{ matrix.branch }} + add-paths: "." + commit-message: "Automatic package template update" + branch: "cruft/update" delete-branch: true - branch-suffix: timestamp - title: ${{ matrix.title }} + draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }} + title: "Updates from the package template" body: | - This is an autogenerated PR, which will ${{ matrix.body }}. - [Cruft](https://cruft.github.io/cruft/) has detected updates from the Package Template + This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template). + If this pull request has been opened as a draft there are conflicts which need fixing. + + **To run the CI on this pull request you will need to close it and reopen it.** From ccdc2f5bd6878bfcea57caae791cac0bbfe28b3b Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Oct 2024 15:49:55 +0000 Subject: [PATCH 137/265] Fix examples exclude pattern --- {{ cookiecutter.package_name }}/.ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 7878589..a6097cc 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -67,7 +67,7 @@ extend-ignore = [ "docs/*.py" = [ "INP001", # Implicit-namespace-package. The examples are not a package. ] -"{{ cookiecutter.package_name }}/*.py" = [ +"examples/**.py" = [ "T201", # allow use of print in examples ] "__init__.py" = ["E402", "F401", "F403"] From a61f80422fa087dc666b7069223c443582c0ed4f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Oct 2024 15:58:25 +0000 Subject: [PATCH 138/265] ignore print in example mod code --- .../{{ cookiecutter.module_name }}/example_mod.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index 5a6bbda..c7e9bdc 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -44,10 +44,10 @@ def do_primes(n, usecython=False): raise Exception("This template does not have the example C code included.") {% else %} from .example_c import primes as cprimes - print('Using cython-based primes') + print('Using cython-based primes') # noqa: T201 return cprimes(n) {% endif %} - print('Using pure python primes') + print('Using pure python primes') # noqa: T201 return primes(n) @@ -73,11 +73,11 @@ def main(args=None): primes = do_primes(res.n, res.cy) post = time() - print(f'Found {len(primes)} prime numbers') - print(f'Largest prime: {primes[-1]}') + print(f'Found {len(primes)} prime numbers') # noqa: T201 + print(f'Largest prime: {primes[-1]}') # noqa: T201 if res.time: - print(f'Running time: {post - pre} s') + print(f'Running time: {post - pre} s') # noqa: T201 if res.prnt: - print(f'Primes: {primes}') + print(f'Primes: {primes}') # noqa: T201 From bdac7059dd828b5f2d23d5a5a4e15183b125b3c6 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Wed, 30 Oct 2024 17:28:27 +0000 Subject: [PATCH 139/265] Ignore F405 in __init__.py --- {{ cookiecutter.package_name }}/.ruff.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index a6097cc..2177bc2 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -72,6 +72,7 @@ extend-ignore = [ ] "__init__.py" = ["E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] +"__init__.py" = ["F405"] [lint.pydocstyle] convention = "numpy" From aae6367ab78b430e525c7332f4caecefbd67db35 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 31 Oct 2024 09:22:46 +0000 Subject: [PATCH 140/265] Update .ruff.toml --- {{ cookiecutter.package_name }}/.ruff.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 2177bc2..34912b6 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -70,9 +70,8 @@ extend-ignore = [ "examples/**.py" = [ "T201", # allow use of print in examples ] -"__init__.py" = ["E402", "F401", "F403"] +"__init__.py" = ["F405", "E402", "F401", "F403"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] -"__init__.py" = ["F405"] [lint.pydocstyle] convention = "numpy" From 79045ff18e1e88a4e89d05b44f079ac06ebcb603 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 31 Oct 2024 09:23:18 +0000 Subject: [PATCH 141/265] Update .ruff.toml --- {{ cookiecutter.package_name }}/.ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 34912b6..413b7c4 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -70,7 +70,7 @@ extend-ignore = [ "examples/**.py" = [ "T201", # allow use of print in examples ] -"__init__.py" = ["F405", "E402", "F401", "F403"] +"__init__.py" = ["E402", "F401", "F403", "F405"] "test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] [lint.pydocstyle] From 3fdfcf3c7a29c9f6a93e31a83cfab189c3ada66d Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 31 Oct 2024 09:56:49 +0000 Subject: [PATCH 142/265] More ruff --- {{ cookiecutter.package_name }}/.ruff.toml | 44 +++++++++++++--------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 413b7c4..6cc908a 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -35,43 +35,51 @@ select = [ {%- endif %} ] extend-ignore = [ - # pycodestyle + # pycodestyle (E, W) "E501", # ignore line length will use a formatter instead - "E712", # Avoid equality comparisons to True; use if {cond}: for truth checks - "E721", # type comparison Use is and is not for type comparisons, or isinstance() for isinstance checks - # upgrades + # pyupgrade (UP) "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() "PT004", # Fixtures which don't return anything should have leading _ - "PT011", # except(ValueRaises) is too broad "PT023", # Always use () on pytest decorators - # flake8-pie + # flake8-pie (PIE) "PIE808", # Disallow passing 0 as the first argument to range - # flake8-use-pathlib + # flake8-use-pathlib (PTH) "PTH123", # open() should be replaced by Path.open() - # Ruff + # Ruff (RUF) "RUF003", # Ignore ambiguous quote marks, doesn't allow ' in comments - "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` - "RUF013", # PEP 484 prohibits implicit `Optional` - "RUF015", # Prefer `next(iter(...))` over single element slice + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "RUF013", # PEP 484 prohibits implicit `Optional` + "RUF015", # Prefer `next(iter(...))` over single element slice ] [lint.per-file-ignores] -# Part of configuration, not a package. -"setup.py" = ["INP001"] -"conftest.py" = ["INP001"] +"setup.py" = [ + "INP001", # File is part of an implicit namespace package. +] +"conftest.py" = [ + "INP001", # File is part of an implicit namespace package. +] "docs/conf.py" = [ - "E402" # Module imports not at top of file + "E402" # Module imports not at top of file ] "docs/*.py" = [ - "INP001", # Implicit-namespace-package. The examples are not a package. + "INP001", # File is part of an implicit namespace package. ] "examples/**.py" = [ "T201", # allow use of print in examples + "INP001", # File is part of an implicit namespace package. +] +"__init__.py" = [ + "E402", # Module level import not at top of cell + "F401", # Unused import + "F403", # from {name} import * used; unable to detect undefined names + "F405", # {name} may be undefined, or defined from star imports +] +"test_*.py" = [ + "E402", # Module level import not at top of cell ] -"__init__.py" = ["E402", "F401", "F403", "F405"] -"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] [lint.pydocstyle] convention = "numpy" From 3ebe50e6963cf99c9c9c2bb8636da0f23e368514 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 31 Oct 2024 15:56:19 +0000 Subject: [PATCH 143/265] Add label sync workflow --- .../.github/workflows/label_sync.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/.github/workflows/label_sync.yml diff --git a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml new file mode 100644 index 0000000..ca0890f --- /dev/null +++ b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml @@ -0,0 +1,18 @@ +name: Label Sync +on: + workflow_dispatch: + schedule: + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: '0 0 * * *' # run every day at midnight UTC +jobs: + label_sync: + runs-on: ubuntu-latest + name: Label Sync + steps: + - uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd + with: + config-file: https://raw.githubusercontent.com/sunpy/.github/labels.yml From 3482e3123a2c980e2181884f9b6ff7da57680064 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 6 Nov 2024 07:05:33 +0000 Subject: [PATCH 144/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 6c5a7a0..24a9a61 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.1" + rev: "v0.7.2" hooks: - id: ruff args: ["--fix"] From f0e9789eee995a9c69d1d95897613983fb876f56 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Nov 2024 16:05:53 +0000 Subject: [PATCH 145/265] Remove N from extended ruff rules --- {{ cookiecutter.package_name }}/.ruff.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 6cc908a..283c678 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -15,7 +15,6 @@ select = [ "UP", "PT", {%- if cookiecutter.use_extended_ruff_linting == 'y' %} - "N", "BLE", "A", "C4", From a689df85e414dcb19ef06f3d846cb837d168936e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Nov 2024 17:13:33 +0000 Subject: [PATCH 146/265] Fix label config URL --- .../.github/workflows/label_sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml index ca0890f..350832d 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd with: - config-file: https://raw.githubusercontent.com/sunpy/.github/labels.yml + config-file: https://raw.githubusercontent.com/sunpy/.github/main/labels.yml From 75f84c4adf1753af67967930c3335bc73bca9bf5 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Nov 2024 17:26:30 +0000 Subject: [PATCH 147/265] Give label sync workflow write permissions for issues --- .../.github/workflows/label_sync.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml index 350832d..7f21775 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml @@ -8,6 +8,11 @@ on: # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - cron: '0 0 * * *' # run every day at midnight UTC + +# Give permissions to write issue labels +permissions: + issues: write + jobs: label_sync: runs-on: ubuntu-latest From d6e545d286970c2b127f5aa4c68bf9e1b3c3e340 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 12 Nov 2024 12:13:23 +0000 Subject: [PATCH 148/265] Adds Giles and Towncrier config --- .../pyproject.toml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 5054519..5e6f307 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -69,3 +69,76 @@ write_to = "{{ cookiecutter.module_name }}/_version.py" {%- else -%} write_to = "{{ cookiecutter.module_name }}/version.py" {%- endif %} + +[tool.gilesbot] + [tool.gilesbot.circleci_artifacts] + enabled = true + + [tool.gilesbot.circleci_artifacts.figure_report] + url = ".tmp/py312-figure/figure_test_images/fig_comparison.html" + message = "Click details to see the figure test comparisons, for py312-figure." + report_on_fail = true + + [tool.gilesbot.circleci_artifacts.figure_report_devdeps] + url = ".tmp/py312-figure-devdeps/figure_test_images/fig_comparison.html" + message = "Click details to see the figure test comparisons for py312-figure-devdeps." + report_on_fail = true + + [tool.gilesbot.pull_requests] + enabled = true + + [tool.gilesbot.towncrier_changelog] + enabled = true + verify_pr_number = true + changelog_skip_label = "No Changelog Entry Needed" + help_url = "https://github.com/sunpy/sunpy/blob/main/changelog/README.rst" + + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/sunpy/blob/main/changelog/README.rst)." + + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/sunpy/sunpy/blob/main/changelog/README.rst)" + + number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." + +# TODO: This should be in towncrier.toml but Giles currently only works looks in +# pyproject.toml we should move this back when it's fixed. +[tool.towncrier] + package = "{{ cookiecutter.package_name }}" + filename = "CHANGELOG.rst" + directory = "changelog/" + issue_format = "`#{issue} `__" + title_format = "{version} ({project_date})" + + [[tool.towncrier.type]] + directory = "breaking" + name = "Breaking Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "deprecation" + name = "Deprecations" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "feature" + name = "New Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bug Fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "trivial" + name = "Internal Changes" + showcontent = true From 2a5756746d3177711c4c606ca74ad45d7a92d264 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 13 Nov 2024 07:05:44 +0000 Subject: [PATCH 149/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 24a9a61..d969f45 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.2" + rev: "v0.7.3" hooks: - id: ruff args: ["--fix"] From bec852891f54e296e6067524d97674bf895e3876 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Nov 2024 17:26:30 +0000 Subject: [PATCH 150/265] Give label sync workflow write permissions for issues --- tox.ini | 2 +- .../.github/workflows/label_sync.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 46dead5..e433bf8 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[test] + tox[testing] commands = !bake_cookies: pytest tests/ {posargs} diff --git a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml index 350832d..7f21775 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml @@ -8,6 +8,11 @@ on: # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - cron: '0 0 * * *' # run every day at midnight UTC + +# Give permissions to write issue labels +permissions: + issues: write + jobs: label_sync: runs-on: ubuntu-latest From b45ef1fb9c2c79e2feb81eb57c8da4b648c113f7 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 14 Nov 2024 10:29:27 +0000 Subject: [PATCH 151/265] Temporarily removes figure tests in giles config --- {{ cookiecutter.package_name }}/pyproject.toml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index cc2fc01..c01921c 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -75,16 +75,6 @@ write_to = "{{ cookiecutter.module_name }}/version.py" [tool.gilesbot.circleci_artifacts] enabled = true - [tool.gilesbot.circleci_artifacts.figure_report] - url = ".tmp/py312-figure/figure_test_images/fig_comparison.html" - message = "Click details to see the figure test comparisons, for py312-figure." - report_on_fail = true - - [tool.gilesbot.circleci_artifacts.figure_report_devdeps] - url = ".tmp/py312-figure-devdeps/figure_test_images/fig_comparison.html" - message = "Click details to see the figure test comparisons for py312-figure-devdeps." - report_on_fail = true - [tool.gilesbot.pull_requests] enabled = true From bb7d084423071f2ccd7200b50836616bcf5ac1f8 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 14 Nov 2024 11:05:29 +0000 Subject: [PATCH 152/265] Adds changelog infrastructure --- {{ cookiecutter.package_name }}/CHANGELOG.rst | 0 .../changelog/README.rst | 34 +++++++++++++++++++ .../docs/whatsnew/changelog.rst | 10 ++++++ 3 files changed, 44 insertions(+) create mode 100644 {{ cookiecutter.package_name }}/CHANGELOG.rst create mode 100644 {{ cookiecutter.package_name }}/changelog/README.rst create mode 100644 {{ cookiecutter.package_name }}/docs/whatsnew/changelog.rst diff --git a/{{ cookiecutter.package_name }}/CHANGELOG.rst b/{{ cookiecutter.package_name }}/CHANGELOG.rst new file mode 100644 index 0000000..e69de29 diff --git a/{{ cookiecutter.package_name }}/changelog/README.rst b/{{ cookiecutter.package_name }}/changelog/README.rst new file mode 100644 index 0000000..7d388e3 --- /dev/null +++ b/{{ cookiecutter.package_name }}/changelog/README.rst @@ -0,0 +1,34 @@ +========= +Changelog +========= + +.. note:: + + This README was adapted from the pytest changelog readme under the terms of the MIT licence. + +This directory contains "news fragments" which are short files that contain a small **ReST**-formatted text that will be added to the next ``CHANGELOG``. + +The ``CHANGELOG`` will be read by users, so this description should be aimed at SunPy users instead of describing internal changes which are only relevant to the developers. + +Make sure to use full sentences with correct case and punctuation, for example:: + + Add support for Helioprojective coordinates in `sunpy.coordinates.frames`. + +Please try to use Sphinx intersphinx using backticks. + +Each file should be named like ``.[.].rst``, where ```` is a pull request number, ``COUNTER`` is an optional number if a PR needs multiple entries with the same type and ```` is one of: + +* ``breaking``: A change which requires users to change code and is not backwards compatible. (Not to be used for removal of deprecated features.) +* ``feature``: New user facing features and any new behavior. +* ``bugfix``: Fixes a reported bug. +* ``doc``: Documentation addition or improvement, like rewording an entire session or adding missing docs. +* ``deprecation``: Feature deprecation +* ``removal``: Feature removal. +* ``trivial``: A change which has no user facing effect or is tiny change. + +So for example: ``123.feature.rst``, ``456.bugfix.rst``. + +If you are unsure what pull request type to use, don't hesitate to ask in your PR. + +Note that the ``towncrier`` tool will automatically reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK and encouraged. +You can install ``towncrier`` and then run ``towncrier --draft`` if you want to get a preview of how your change will look in the final release notes. diff --git a/{{ cookiecutter.package_name }}/docs/whatsnew/changelog.rst b/{{ cookiecutter.package_name }}/docs/whatsnew/changelog.rst new file mode 100644 index 0000000..a3678c4 --- /dev/null +++ b/{{ cookiecutter.package_name }}/docs/whatsnew/changelog.rst @@ -0,0 +1,10 @@ +.. _changelog: + +************** +Full Changelog +************** + +.. changelog:: + :towncrier: ../../ + :towncrier-skip-if-empty: + :changelog_file: ../../CHANGELOG.rst From 9f1eacb09948360838f49ed3ce2678381aaf8fae Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 14 Nov 2024 11:38:46 +0000 Subject: [PATCH 153/265] Adds sphinx_changelog extension in conf.py --- {{ cookiecutter.package_name }}/docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index dbc36cb..60625ff 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -45,6 +45,7 @@ "sphinx.ext.mathjax", "sphinx_automodapi.automodapi", "sphinx_automodapi.smart_resolver", + "sphinx_changelog", ] # Add any paths that contain templates here, relative to this directory. From 7ddb16294faa4c18c66996657a2770e85c88e13c Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 14 Nov 2024 11:50:16 +0000 Subject: [PATCH 154/265] Adds sphinx changelog and min versions for sphinx documentatoin --- {{ cookiecutter.package_name }}/docs/index.rst | 2 ++ .../docs/whatsnew/index.rst | 17 +++++++++++++++++ {{ cookiecutter.package_name }}/pyproject.toml | 7 ++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 {{ cookiecutter.package_name }}/docs/whatsnew/index.rst diff --git a/{{ cookiecutter.package_name }}/docs/index.rst b/{{ cookiecutter.package_name }}/docs/index.rst index 894eea6..312a52f 100644 --- a/{{ cookiecutter.package_name }}/docs/index.rst +++ b/{{ cookiecutter.package_name }}/docs/index.rst @@ -8,6 +8,8 @@ This is the documentation for {{ cookiecutter.package_name }}. :maxdepth: 2 :caption: Contents: + whatsnew/index + Indices and tables ================== diff --git a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst new file mode 100644 index 0000000..5cdfdfc --- /dev/null +++ b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst @@ -0,0 +1,17 @@ +.. _whatsnew: + +*************** +Release History +*************** + +A new version of {{ cookiecutter.package_name }} is released twice a year, with target release months of May and November. + +- Versions x.0 are long term support (LTS) releases, supported for 12 months until the next LTS release. +- Versions x.1 are non-LTS releases, supported for 6 months until the next LTS release. + +Bugfix releases (versions x.y.1, x.y.2, etc.) are released monthly, with a target of the last Friday of each month. + +.. toctree:: + :maxdepth: 1 + + changelog diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index c01921c..c46b3e5 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -40,9 +40,10 @@ tests = [ "pytest-xdist", ] docs = [ - "sphinx", - "sphinx-automodapi", - "sunpy-sphinx-theme", + "sphinx>=5.0.0", + "sphinx-automodapi>=0.14.1", + "sphinx-changelog>=1.5.0", + "sunpy-sphinx-theme>=2.0.3", "packaging", ] From 1c43e10564a25cbd632fe19557f08510326ddf38 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Mon, 18 Nov 2024 16:56:43 +0000 Subject: [PATCH 155/265] Updates urls to wrap in with the package template --- {{ cookiecutter.package_name }}/docs/whatsnew/index.rst | 8 ++++---- {{ cookiecutter.package_name }}/pyproject.toml | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst index 5cdfdfc..bf42149 100644 --- a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst +++ b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst @@ -4,12 +4,12 @@ Release History *************** -A new version of {{ cookiecutter.package_name }} is released twice a year, with target release months of May and November. +This page documents the incremental releases for {{ cookiecutter.package_name }} -- Versions x.0 are long term support (LTS) releases, supported for 12 months until the next LTS release. -- Versions x.1 are non-LTS releases, supported for 6 months until the next LTS release. + * Versions x.0 are long term support (LTS) releases. + * Versions x.1 are non-LTS releases. -Bugfix releases (versions x.y.1, x.y.2, etc.) are released monthly, with a target of the last Friday of each month. +Bugfixes take the structure x.y.1 x.y.2, etc. .. toctree:: :maxdepth: 1 diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index c46b3e5..8490d7b 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -73,9 +73,6 @@ write_to = "{{ cookiecutter.module_name }}/version.py" {%- endif %} [tool.gilesbot] - [tool.gilesbot.circleci_artifacts] - enabled = true - [tool.gilesbot.pull_requests] enabled = true @@ -85,9 +82,9 @@ write_to = "{{ cookiecutter.module_name }}/version.py" changelog_skip_label = "No Changelog Entry Needed" help_url = "https://github.com/sunpy/sunpy/blob/main/changelog/README.rst" - changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/sunpy/blob/main/changelog/README.rst)." + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/{[ cookiecutter.package_name }/blob/main/changelog/README.rst)." - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/sunpy/sunpy/blob/main/changelog/README.rst)" + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/sunpy/{{ cookiecutter.package_name }}/blob/main/changelog/README.rst)" number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." @@ -97,7 +94,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} `__" + issue_format = "`#{issue} `__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From d9d5cc20e6d42e94e7284dd0f26395a2ed1b9d04 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 20 Nov 2024 07:05:52 +0000 Subject: [PATCH 156/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index d969f45..d09e43e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.3" + rev: "v0.7.4" hooks: - id: ruff args: ["--fix"] From 834b57827f5ca2c1289981540e0ab8e42284acd3 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 26 Nov 2024 09:32:29 +0000 Subject: [PATCH 157/265] TST: Dependabot --- .github/dependabot.yml | 3 +-- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0b1b060..3f3367a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,6 @@ updates: - package-ecosystem: "github-actions" directories: - "/" - # This doesn't work because of jinja templating. - # - "{{ cookiecutter.package_name }}/.github/workflows" + - "{{ cookiecutter.package_name }}/.github/workflows" schedule: interval: "weekly" diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 9a3d4e1..4c26677 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -{% set default_python = '3.12' %} +# Main CI Workflow {% set default_python = '3.12' %} name: CI on: From 1a52ab8ed50006e7bfe2960bf84aa69584ab18eb Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 26 Nov 2024 09:32:29 +0000 Subject: [PATCH 158/265] TST: Dependabot 2 --- .github/dependabot.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f3367a..01d39eb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,10 @@ updates: - package-ecosystem: "github-actions" directories: - "/" - - "{{ cookiecutter.package_name }}/.github/workflows" + - "{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml" schedule: interval: "weekly" + groups: + actions: + patterns: + - "*" From 44e8070f45c01647301d792e021005cc7f1b91d7 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 26 Nov 2024 09:50:40 +0000 Subject: [PATCH 159/265] Use hashes for parent workflows and versions for template --- .github/dependabot.yml | 1 - .github/workflows/oa_update.yml | 4 ++-- .github/workflows/pre-commit-update.yaml | 6 +++--- .github/workflows/tests.yml | 4 ++-- .../.github/workflows/ci.yml | 16 ++++++++-------- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 01d39eb..2767a3d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,6 @@ updates: - package-ecosystem: "github-actions" directories: - "/" - - "{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml" schedule: interval: "weekly" groups: diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 3f592c3..69859d0 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -21,7 +21,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 @@ -63,7 +63,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@v7 + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: token: ${{ secrets.GITHUB_TOKEN }} draft: ${{ steps.merge.outputs.has_conflicts == '1' }} diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 1c52cf6..a127332 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -21,11 +21,11 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - name: Install pre-commit run: pip install pre-commit @@ -35,7 +35,7 @@ jobs: run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' - name: Create pull request - uses: peter-evans/create-pull-request@v7 + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 605d890..1ab52f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 with: envs: | - macos: py310-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 with: artifact-path: | cookies diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 4c26677..60f6e14 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -1,10 +1,10 @@ -# Main CI Workflow {% set default_python = '3.12' %} +{% set default_python = '3.12' -%} name: CI on: push: branches: - - 'main' + - 'v1' - '*.*' - '!*backport*' tags: @@ -22,7 +22,7 @@ concurrency: jobs: core: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -46,7 +46,7 @@ jobs: test: needs: [core, sdist_verify] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -61,7 +61,7 @@ jobs: docs: needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '{{ default_python }}' submodules: false @@ -79,7 +79,7 @@ jobs: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run cron CI') ) - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '{{ default_python }}' submodules: false @@ -101,7 +101,7 @@ jobs: ) needs: [test, docs] {%- if cookiecutter.use_compiled_extensions == 'y' %} - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 with: sdist: true test_extras: 'tests' @@ -113,7 +113,7 @@ jobs: - cp3{9,10,11,12}-macosx_arm64 - cp3{9,10,11,12}-win_amd64 {%- else %} - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 with: python-version: '{{ default_python }}' test_extras: 'tests' From f8fa7556b4189b2b67680301d0af1f6e4666cb92 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 26 Nov 2024 10:26:05 +0000 Subject: [PATCH 160/265] Apply suggestions from code review --- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 60f6e14..4ecca32 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -1,10 +1,10 @@ -{% set default_python = '3.12' -%} +# Main CI Workflow {% set default_python = '3.12' -%} name: CI on: push: branches: - - 'v1' + - 'main' - '*.*' - '!*backport*' tags: From d964d67db6698f384a993e5a08149b52ad312d0a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 15 Nov 2024 14:58:30 +0000 Subject: [PATCH 161/265] Adds project url options to cookiecutter --- cookiecutter.json | 15 +++++++++- tox.ini | 2 +- .../pyproject.toml | 30 +++++++++++++++---- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 86e6a43..6634a89 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,6 +5,11 @@ "author_name": "", "author_email": "", "project_url": "", + "sourcecode_url": "", + "download_url": "", + "documentation_url": "", + "changelog_url": "", + "issue_tracker_url": "", "license": [ "BSD 3-Clause", "GNU GPL v3+", @@ -30,5 +35,13 @@ "docs/_templates", "docs/_static", ".github/workflows/sub_package_update.yml" - ] + ], + "__prompts__" : { + "project_url": "Primary website for the project, leave blank for Sunpy Homepage", + "sourcecode_url": "Version control link for the project", + "download_url": "Pypi address for the project, optional", + "documentation_url": "Documentation url, optional", + "changelog_url": "Url to the changelog, optional", + "issue_tracker_url": "Url to the issue tracker, optional" + } } diff --git a/tox.ini b/tox.ini index e433bf8..46dead5 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[testing] + tox[test] commands = !bake_cookies: pytest tests/ {posargs} diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index c743f14..7f88d87 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,11 +27,34 @@ dependencies = [ ] dynamic = ["version"] +# Okay strip the whitespace motherfucker! +[project.urls] +{% if cookiecutter.project_url -%} +Homepage = "{{ cookiecutter.project_url }}" +{% else -%} +Homepage = "https://sunpy.org" +{% endif -%} +{% if cookiecutter.sourcecode_url -%} +"Source Code" = "{{ cookiecutter.sourcecode_url }}" +{% endif -%} +{% if cookiecutter.download_url -%} +Download = "{{ cookiecutter.download_url }}" +{% endif -%} +{% if cookiecutter.documentation_url -%} +Documentation = "{{ cookiecutter.documentation_url }}" +{% endif -%} +{% if cookiecutter.changelog_url -%} +Changelog = "{{ cookiecutter.changelog_url }}" +{% endif -%} +{% if cookiecutter.issue_tracker_url -%} +"Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" +{% endif -%} + {% if cookiecutter.include_example_code == 'y' -%} [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif -%} +{% endif %} [project.optional-dependencies] tests = [ "pytest", @@ -46,11 +69,6 @@ docs = [ "packaging", ] -{%- if cookiecutter.project_url %} -[project.urls] -repository = "{{ cookiecutter.project_url }}" -{%- endif %} - [tool.setuptools] zip-safe = false include-package-data = true From 369d592fbb4d812546ad7da0b8d30687e9501842 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 26 Nov 2024 19:03:40 +0000 Subject: [PATCH 162/265] Adds projecturls baked cookies test --- tests/conftest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 395ad61..61482f1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -97,6 +97,22 @@ def bake_examples_compiled_dev_version(cookies): return _handle_cookiecutter_errors(result) +@pytest.fixture +def bake_examples_url_extensions(cookies): + """ + setting url parameters + """ + result = cookies.bake(extra_context={ + "project_url": "https://sunpy.org", + "sourcecode_url": "https://github.com/sunpy/sunpy", + "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", + "documentation_url": "https://sunpy.org/docs", + "changelog_url": "https://sunpy.org/changelog", + "issue_tracker_url": "https://github.com/sunpy/sunpy/issues" + }) + return _handle_cookiecutter_errors(result) + + def pytest_addoption(parser): # Add support for saving out rendered cookies to a specific location for inspection parser.addoption("--cookie-location", action="store", default=None) From 0c4213487c8f85bb99a7eea6e186263947b65eb1 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 26 Nov 2024 19:36:04 +0000 Subject: [PATCH 163/265] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 7f88d87..b7d11a1 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ ] dynamic = ["version"] -# Okay strip the whitespace motherfucker! [project.urls] {% if cookiecutter.project_url -%} Homepage = "{{ cookiecutter.project_url }}" From 7d8b2a29d3a0d6b7c6b7dfbb1f25b4b4e20f0b22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:35:43 +0000 Subject: [PATCH 164/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/924441154cf3053034c6513d5e06c69d262fb9a6...d68193b68216da64eafaa618f53c59f5d271c56e) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ab52f6..90dbc93 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: envs: | - macos: py310-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: artifact-path: | cookies From 6407d13deb56517a3ee6ab6c6bbdb45d7117dc20 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 10:13:15 +0000 Subject: [PATCH 165/265] Relocates the project.urls block in toml --- .../pyproject.toml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index b7d11a1..a3131ed 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,6 +27,25 @@ dependencies = [ ] dynamic = ["version"] +{% if cookiecutter.include_example_code == 'y' -%} +[project.scripts] +open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" + +{% endif %} +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-doctestplus", + "pytest-cov", + "pytest-xdist", +] +docs = [ + "sphinx", + "sphinx-automodapi", + "sunpy-sphinx-theme", + "packaging", +] + [project.urls] {% if cookiecutter.project_url -%} Homepage = "{{ cookiecutter.project_url }}" @@ -49,25 +68,6 @@ Changelog = "{{ cookiecutter.changelog_url }}" "Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" {% endif -%} -{% if cookiecutter.include_example_code == 'y' -%} -[project.scripts] -open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" - -{% endif %} -[project.optional-dependencies] -tests = [ - "pytest", - "pytest-doctestplus", - "pytest-cov", - "pytest-xdist", -] -docs = [ - "sphinx", - "sphinx-automodapi", - "sunpy-sphinx-theme", - "packaging", -] - [tool.setuptools] zip-safe = false include-package-data = true From 2126cd4b5c35b1adc58748e0bc3d7571bda41976 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 10:23:17 +0000 Subject: [PATCH 166/265] Adds sourcecode/github processing in cookiecutteR --- cookiecutter.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookiecutter.json b/cookiecutter.json index 6634a89..fea5b88 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,6 +6,7 @@ "author_email": "", "project_url": "", "sourcecode_url": "", + "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') }}", "download_url": "", "documentation_url": "", "changelog_url": "", @@ -39,6 +40,7 @@ "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", + "github_repo": "Leave blank to pull form sourcecode_url or if not github", "download_url": "Pypi address for the project, optional", "documentation_url": "Documentation url, optional", "changelog_url": "Url to the changelog, optional", From 3c05b142b200136463c839538fe1fa828064830e Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:23:00 +0000 Subject: [PATCH 167/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index fea5b88..4c7dbd2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -40,7 +40,7 @@ "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", - "github_repo": "Leave blank to pull form sourcecode_url or if not github", + "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "Pypi address for the project, optional", "documentation_url": "Documentation url, optional", "changelog_url": "Url to the changelog, optional", From 2166b211dda0d53302ba811a68ab6e8220b021b0 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:13 +0000 Subject: [PATCH 168/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 4c7dbd2..e408f24 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "author_email": "", "project_url": "", "sourcecode_url": "", - "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') }}", + "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') if 'https://github.com/' in cookiecutter.sourcecode_url else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", From f99616a87a137cfbf3b4787bfe90a7504082c92c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:23 +0000 Subject: [PATCH 169/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index e408f24..e594a73 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -42,7 +42,7 @@ "sourcecode_url": "Version control link for the project", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "Pypi address for the project, optional", - "documentation_url": "Documentation url, optional", + "documentation_url": "Documentation URL, optional", "changelog_url": "Url to the changelog, optional", "issue_tracker_url": "Url to the issue tracker, optional" } From 57980062dd3e4626a31e5e775f227b1a0686d85c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:35 +0000 Subject: [PATCH 170/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index e594a73..1c0f4ba 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -41,7 +41,7 @@ "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", - "download_url": "Pypi address for the project, optional", + "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "Url to the changelog, optional", "issue_tracker_url": "Url to the issue tracker, optional" From ed2ca4c7894cd72421efe5814988c3b1f0f65708 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:47 +0000 Subject: [PATCH 171/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 1c0f4ba..3361c89 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -43,7 +43,7 @@ "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", - "changelog_url": "Url to the changelog, optional", - "issue_tracker_url": "Url to the issue tracker, optional" + "changelog_url": "URL to the changelog, optional", + "issue_tracker_url": "URL to the issue tracker, optional" } } From 1ff00c7123f48e0950a996af015564d5c9bfb11b Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:53:05 +0000 Subject: [PATCH 172/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 3361c89..c35f433 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -39,7 +39,7 @@ ], "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", - "sourcecode_url": "Version control link for the project", + "sourcecode_url": "URL for source code, i.e. https://github.com/...", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", From 8bdd26a970c75662aa6b9126e75c0cfd83bbe47a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:18:21 +0000 Subject: [PATCH 173/265] Adds github slug option --- cookiecutter.json | 6 +++--- tests/conftest.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index c35f433..870e305 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,8 +5,8 @@ "author_name": "", "author_email": "", "project_url": "", - "sourcecode_url": "", - "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') if 'https://github.com/' in cookiecutter.sourcecode_url else '' }}", + "github_repo": "", + "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if github_repo else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", @@ -39,8 +39,8 @@ ], "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", - "sourcecode_url": "URL for source code, i.e. https://github.com/...", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", + "sourcecode_url": "URL for source code, i.e. https://github.com/...", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "URL to the changelog, optional", diff --git a/tests/conftest.py b/tests/conftest.py index 61482f1..9ad76af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -104,7 +104,8 @@ def bake_examples_url_extensions(cookies): """ result = cookies.bake(extra_context={ "project_url": "https://sunpy.org", - "sourcecode_url": "https://github.com/sunpy/sunpy", + "github_repo": "sunpy/sunpy", + "sourcecode_url": "", "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", "documentation_url": "https://sunpy.org/docs", "changelog_url": "https://sunpy.org/changelog", From ef5181e477fc6ffb17c548e51a3ee4369eb4ef0a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:28:08 +0000 Subject: [PATCH 174/265] Fixes stray `github_repo` --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 870e305..0a8c307 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "author_email": "", "project_url": "", "github_repo": "", - "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if github_repo else '' }}", + "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if cookiecutter.github_repo else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", From 45a8f51e237f4c7a719b365c1affb48e898c2272 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Sun, 1 Dec 2024 07:05:30 +0000 Subject: [PATCH 175/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index d09e43e..43ffc3e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.8.1" hooks: - id: ruff args: ["--fix"] From 0bb9b8090d1bd6e1ed17d023c89f937b16d29cd8 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:36:57 +0000 Subject: [PATCH 176/265] Adds new test to fixture list --- tests/conftest.py | 5 ++++- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ad76af..f42cd25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,8 @@ def cookiejar_no_examples(request): @pytest.fixture(params=["bake_examples_compiled", "bake_examples", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def cookiejar_examples(request): """ Templates rendered with the examples @@ -103,6 +104,8 @@ def bake_examples_url_extensions(cookies): setting url parameters """ result = cookies.bake(extra_context={ + "author_name": "test", + "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", "sourcecode_url": "", diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index a3131ed..744b779 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -31,7 +31,7 @@ dynamic = ["version"] [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif %} +{%- endif %} [project.optional-dependencies] tests = [ "pytest", From 052eeaaf9538a66f97742684cc865106504b13d8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 3 Dec 2024 10:07:53 +0000 Subject: [PATCH 177/265] Update .ruff.toml --- {{ cookiecutter.package_name }}/.ruff.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.ruff.toml b/{{ cookiecutter.package_name }}/.ruff.toml index 283c678..df0e2c8 100644 --- a/{{ cookiecutter.package_name }}/.ruff.toml +++ b/{{ cookiecutter.package_name }}/.ruff.toml @@ -40,7 +40,6 @@ extend-ignore = [ "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() - "PT004", # Fixtures which don't return anything should have leading _ "PT023", # Always use () on pytest decorators # flake8-pie (PIE) "PIE808", # Disallow passing 0 as the first argument to range From 81a2a7d259fefbb0900565ddf73caa00c7b04adb Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 3 Dec 2024 10:08:34 +0000 Subject: [PATCH 178/265] Update example_mod.py --- .../{{ cookiecutter.module_name }}/example_mod.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index c7e9bdc..9ea78d2 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -1,4 +1,4 @@ -__all__ = ['primes', 'do_primes'] +__all__ = ['do_primes', 'primes'] def primes(imax): From 065ebd1ace87a1bbda62ac38667f792de9bf3800 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:36:57 +0000 Subject: [PATCH 179/265] Adds new test to fixture list --- tests/conftest.py | 5 ++++- {{ cookiecutter.package_name }}/pyproject.toml | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ad76af..f42cd25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,8 @@ def cookiejar_no_examples(request): @pytest.fixture(params=["bake_examples_compiled", "bake_examples", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def cookiejar_examples(request): """ Templates rendered with the examples @@ -103,6 +104,8 @@ def bake_examples_url_extensions(cookies): setting url parameters """ result = cookies.bake(extra_context={ + "author_name": "test", + "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", "sourcecode_url": "", diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index a3131ed..4bb5405 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -31,7 +31,7 @@ dynamic = ["version"] [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif %} +{% endif -%} [project.optional-dependencies] tests = [ "pytest", @@ -52,8 +52,11 @@ Homepage = "{{ cookiecutter.project_url }}" {% else -%} Homepage = "https://sunpy.org" {% endif -%} +{% if cookiecutter.github_repo -%} +"GitHub Repo" = "{{ cookiecutter.github_repo }}" +{% endif -%} {% if cookiecutter.sourcecode_url -%} -"Source Code" = "{{ cookiecutter.sourcecode_url }}" +"Source Code" = "{{ https:/github.com/cookiecutter.github_repo | cookiecutter.sourcecode_url }}" {% endif -%} {% if cookiecutter.download_url -%} Download = "{{ cookiecutter.download_url }}" From e6ddd2280227d4197beeb53db8aa822e4f69736d Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 3 Dec 2024 13:42:34 +0000 Subject: [PATCH 180/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 0a8c307..2a2d3e3 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -41,7 +41,7 @@ "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "sourcecode_url": "URL for source code, i.e. https://github.com/...", - "download_url": "PyPi address for the project, optional", + "download_url": "PyPI address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "URL to the changelog, optional", "issue_tracker_url": "URL to the issue tracker, optional" From 43d31ac081876e3ccc00ed9c76067e853a405862 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 3 Dec 2024 13:42:54 +0000 Subject: [PATCH 181/265] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- tests/conftest.py | 5 +-- tests/test_build_artifacts.py | 3 +- .../pyproject.toml | 31 +++++++++---------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 2a2d3e3..54142bd 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,7 +7,7 @@ "project_url": "", "github_repo": "", "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if cookiecutter.github_repo else '' }}", - "download_url": "", + "download_url": "https://pypi.org/project/{{ cookiecutter.package_name }}", "documentation_url": "", "changelog_url": "", "issue_tracker_url": "", diff --git a/tests/conftest.py b/tests/conftest.py index f42cd25..42bfa9b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -94,7 +94,9 @@ def bake_examples_compiled_dev_version(cookies): "author_name": "test", "include_cruft_update_github_workflow": "y", "use_extended_ruff_linting": "y", - }) + "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", + "issue_tracker_url": "https://github.com/sunpy/sunpy/issues", + }) return _handle_cookiecutter_errors(result) @@ -108,7 +110,6 @@ def bake_examples_url_extensions(cookies): "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", - "sourcecode_url": "", "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", "documentation_url": "https://sunpy.org/docs", "changelog_url": "https://sunpy.org/changelog", diff --git a/tests/test_build_artifacts.py b/tests/test_build_artifacts.py index 0896594..7ebd631 100644 --- a/tests/test_build_artifacts.py +++ b/tests/test_build_artifacts.py @@ -12,7 +12,8 @@ ["bake_default", "bake_examples", "bake_examples_compiled", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def test_render_template(request, bake_name, pytestconfig): bake = request.getfixturevalue(bake_name) cached_dir = pytestconfig.getoption("--cookie-location") diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 4bb5405..e78f5d8 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -47,29 +47,26 @@ docs = [ ] [project.urls] -{% if cookiecutter.project_url -%} +{%- if cookiecutter.project_url %} Homepage = "{{ cookiecutter.project_url }}" -{% else -%} +{%- else %} Homepage = "https://sunpy.org" -{% endif -%} -{% if cookiecutter.github_repo -%} -"GitHub Repo" = "{{ cookiecutter.github_repo }}" -{% endif -%} -{% if cookiecutter.sourcecode_url -%} -"Source Code" = "{{ https:/github.com/cookiecutter.github_repo | cookiecutter.sourcecode_url }}" -{% endif -%} -{% if cookiecutter.download_url -%} +{%- endif %} +{%- if cookiecutter.sourcecode_url %} +"Source Code" = "{{ cookiecutter.sourcecode_url }}" +{%- endif %} +{%- if cookiecutter.download_url %} Download = "{{ cookiecutter.download_url }}" -{% endif -%} -{% if cookiecutter.documentation_url -%} +{%- endif %} +{%- if cookiecutter.documentation_url %} Documentation = "{{ cookiecutter.documentation_url }}" -{% endif -%} -{% if cookiecutter.changelog_url -%} +{%- endif %} +{%- if cookiecutter.changelog_url %} Changelog = "{{ cookiecutter.changelog_url }}" -{% endif -%} -{% if cookiecutter.issue_tracker_url -%} +{%- endif %} +{%- if cookiecutter.issue_tracker_url %} "Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" -{% endif -%} +{%- endif %} [tool.setuptools] zip-safe = false From 39e29a92d61986affd2ce7b1844e26b58ee75d86 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 4 Dec 2024 13:44:54 +0000 Subject: [PATCH 182/265] Update cookiecutter.json --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 54142bd..0a9a1d2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -10,7 +10,7 @@ "download_url": "https://pypi.org/project/{{ cookiecutter.package_name }}", "documentation_url": "", "changelog_url": "", - "issue_tracker_url": "", + "issue_tracker_url": "{{ 'https://github.com/' + cookiecutter.github_repo + '/issues/' if cookiecutter.github_repo else '' }}", "license": [ "BSD 3-Clause", "GNU GPL v3+", From c1c69353262db1d20550b459e64d758fab6e6f05 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 4 Dec 2024 15:11:02 +0000 Subject: [PATCH 183/265] Propogates cookiecutter.changelog_url in .toml --- {{ cookiecutter.package_name }}/pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 0882d8f..97e3e40 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -97,11 +97,11 @@ write_to = "{{ cookiecutter.module_name }}/version.py" enabled = true verify_pr_number = true changelog_skip_label = "No Changelog Entry Needed" - help_url = "https://github.com/sunpy/sunpy/blob/main/changelog/README.rst" + help_url = "{{cookiecutter.sourcecode_url}}/blob/main/changelog/README.rst" changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/{[ cookiecutter.package_name }/blob/main/changelog/README.rst)." - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/sunpy/{{ cookiecutter.package_name }}/blob/main/changelog/README.rst)" + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README]({{cookiecutter.changelog_url}}/README.rst)" number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." @@ -111,7 +111,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} `__" + issue_format = "`#{issue} {{ cookiecutter.changelog_url}}/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From 037ce9cb4ed954c318b65d60dbe16bedbb1b3a4f Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Wed, 4 Dec 2024 17:14:18 +0000 Subject: [PATCH 184/265] Applies github_repo to changelog link --- {{ cookiecutter.package_name }}/pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 97e3e40..4b576c6 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -97,11 +97,11 @@ write_to = "{{ cookiecutter.module_name }}/version.py" enabled = true verify_pr_number = true changelog_skip_label = "No Changelog Entry Needed" - help_url = "{{cookiecutter.sourcecode_url}}/blob/main/changelog/README.rst" + help_url = "https://github.com/{{cookiecutter.github_repo}}/blob/main/changelog/README.rst" - changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/sunpy/{[ cookiecutter.package_name }/blob/main/changelog/README.rst)." + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/{{ cookiecutter.github_repo}}/blob/main/changelog/README.rst)." - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README]({{cookiecutter.changelog_url}}/README.rst)" + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/{{cookiecutter.github_repo}}/blob/main/changelog/README.rst)" number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." @@ -111,7 +111,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} {{ cookiecutter.changelog_url}}/pull/{issue}>`__" + issue_format = "`#{issue} https:github.com/{{cookiecutter.github_repo}}/changelog/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From 02ebbfc86165bd355e5d8cd648d8410f58df6af3 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:36:36 +0000 Subject: [PATCH 185/265] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 4b576c6..66186b5 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -111,7 +111,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} https:github.com/{{cookiecutter.github_repo}}/changelog/pull/{issue}>`__" + issue_format = "`#{issue} https:github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/changelog/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From cde42da4033fda12e876ab05b1d53931e9da3f40 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:37:21 +0000 Subject: [PATCH 186/265] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 66186b5..eecaf84 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -101,7 +101,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/{{ cookiecutter.github_repo}}/blob/main/changelog/README.rst)." - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/{{cookiecutter.github_repo}}/blob/main/changelog/README.rst)" + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/blob/main/changelog/README.rst)" number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." From d42c74faddb5c5effae146b14e256d24ae9a4a26 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:37:34 +0000 Subject: [PATCH 187/265] Update {{ cookiecutter.package_name }}/docs/whatsnew/index.rst Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/docs/whatsnew/index.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst index bf42149..99573a5 100644 --- a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst +++ b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst @@ -6,11 +6,6 @@ Release History This page documents the incremental releases for {{ cookiecutter.package_name }} - * Versions x.0 are long term support (LTS) releases. - * Versions x.1 are non-LTS releases. - -Bugfixes take the structure x.y.1 x.y.2, etc. - .. toctree:: :maxdepth: 1 From faa27f632f865aaed05e6158a651063fca7181bb Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:37:44 +0000 Subject: [PATCH 188/265] Update {{ cookiecutter.package_name }}/docs/whatsnew/index.rst Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/docs/whatsnew/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst index 99573a5..019bcad 100644 --- a/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst +++ b/{{ cookiecutter.package_name }}/docs/whatsnew/index.rst @@ -4,7 +4,7 @@ Release History *************** -This page documents the incremental releases for {{ cookiecutter.package_name }} +This page documents the releases for {{ cookiecutter.package_name }} .. toctree:: :maxdepth: 1 From 2b46a9f330d226d0e601ffd21da62ca249b22a30 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:37:54 +0000 Subject: [PATCH 189/265] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index eecaf84..ccc3a01 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -97,7 +97,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" enabled = true verify_pr_number = true changelog_skip_label = "No Changelog Entry Needed" - help_url = "https://github.com/{{cookiecutter.github_repo}}/blob/main/changelog/README.rst" + help_url = "https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/blob/main/changelog/README.rst" changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/{{ cookiecutter.github_repo}}/blob/main/changelog/README.rst)." From 2463c5d16ff83e6c5c1673c03e42259ef83b4c00 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 5 Dec 2024 16:38:05 +0000 Subject: [PATCH 190/265] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index ccc3a01..fb253b9 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -99,7 +99,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" changelog_skip_label = "No Changelog Entry Needed" help_url = "https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/blob/main/changelog/README.rst" - changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/{{ cookiecutter.github_repo}}/blob/main/changelog/README.rst)." + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/blob/main/changelog/README.rst)." type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/blob/main/changelog/README.rst)" From d0c12e58eaac1784e169ac90224c607ce07acc9e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 6 Dec 2024 09:46:11 +0000 Subject: [PATCH 191/265] Update {{ cookiecutter.package_name }}/pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index fb253b9..2753a13 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -40,10 +40,10 @@ tests = [ "pytest-xdist", ] docs = [ - "sphinx>=5.0.0", - "sphinx-automodapi>=0.14.1", - "sphinx-changelog>=1.5.0", - "sunpy-sphinx-theme>=2.0.3", + "sphinx", + "sphinx-automodapi", + "sphinx-changelog", + "sunpy-sphinx-theme", "packaging", ] From 45ef2be1c2716088a93782f7833233f0779bc74f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 6 Dec 2024 16:46:52 +0000 Subject: [PATCH 192/265] Update the batchpr script some more --- tools/batchpr_manual_cruft_update.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/batchpr_manual_cruft_update.py b/tools/batchpr_manual_cruft_update.py index cdabd4e..2ece35c 100755 --- a/tools/batchpr_manual_cruft_update.py +++ b/tools/batchpr_manual_cruft_update.py @@ -3,7 +3,7 @@ # requires-python = ">=3.10" # dependencies = [ # "typer", -# "batchpr@git+https://github.com/astrofrog/batchpr", +# "batchpr@git+https://github.com/astrofrog/batchpr@main", # "cruft@git+https://github.com/Cadair/cruft@patch-p1", # ] # /// @@ -19,6 +19,7 @@ """ import os +import json from typing import Annotated, Optional from batchpr import Updater @@ -37,13 +38,26 @@ "sunpy/sunkit-pyvista", "sunpy/sunpy-soar", "sunpy/sunkit-instruments", + "sunpy/drms", + "sunpy/sunraster", + "sunpy/sunkit-spex", + "sunpy/radiospectra", ) class CruftUpdater(Updater): + def __init__(self, token, author_name=None, author_email=None, + dry_run=False, verbose=False, cleanup_remote_branch=False, extra_context=None): + super().__init__(token, author_name, author_email, dry_run, verbose) + self.cleanup_remote_branch = cleanup_remote_branch + self.extra_context = extra_context def process_repo(self): - ret = update(skip_apply_ask=True, refresh_private_variables=True) + if self.cleanup_remote_branch: + out = self.run_command(f"git ls-remote --heads origin {self.branch_name}") + if out: + self.run_command(f'git push https://{self.user.login}:{self.token}@github.com/{self.fork.full_name} :{self.branch_name}') + ret = update(skip_apply_ask=True, refresh_private_variables=True, extra_context=self.extra_context) if not ret: self.error(f"Cruft update failed for {self.repo}") return False @@ -70,6 +84,8 @@ def pull_request_body(self): def run_multi_updater( github_token: Annotated[str, typer.Option(envvar="GITHUB_TOKEN")], repos: Annotated[list[str], typer.Option()] = ALL_REPOS, + cleanup_remote_branch: bool = False, + extra_context: str = None, dry_run: bool = False, verbose: bool = False ): @@ -78,7 +94,7 @@ def run_multi_updater( The GITHUB_TOKEN should be a Personal Access Token (classic) with the workflow permission and public_repo permissions. """ - helper = CruftUpdater(token=os.environ["GITHUB_TOKEN"], dry_run=dry_run, verbose=verbose) + helper = CruftUpdater(token=os.environ["GITHUB_TOKEN"], dry_run=dry_run, verbose=verbose, cleanup_remote_branch=cleanup_remote_branch, extra_context=json.loads(extra_context)) for repo in repos: helper.run(repo) From cd586dc5566d4ff345aa0a9e1a0b97869775392c Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 6 Dec 2024 17:16:45 +0000 Subject: [PATCH 193/265] Adds further documentation on cruft --- docs/conf.py | 6 +++--- docs/index.rst | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2ad477a..8c37317 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,13 +44,13 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sunpy' html_theme_options = { "description": "A generic Python packaging guide and template.", "code_font_family": "'Fira Code', monospace", - "github_user": "OpenAstronomy", - "github_repo": "packaging-guide", + "github_user": "SunPy", + "github_repo": "packaging-template", "sidebar_width": "300px" } diff --git a/docs/index.rst b/docs/index.rst index 1c93b13..5ca1317 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,3 +54,28 @@ The template currently implements the following optional flags, all of which def * ``include_example_code``: This option will fill your new package with some example functions to allow you to test it. * ``use_compiled_extensions``: This turns on the features needed to support compiled extensions as described in :ref:`extensions`. * ``enable_dynamic_dev_versions``: This enables a feature which ensures that ``my_package.__version__`` always returns the current git version as calculated by ``setuptools_scm`` when the package is installed as an editable install. See :ref:`dev-versions` for more details. +* ``include_cruft_update_github_repo``: This option adds a github workflow with pulls in the latest changes from the template every Monday morning and creates a PR against the repo which can then be accepted or closed. +* ``use_extended_ruff_linting``: This option flag enables the stricter ruff rules. Recommend `Y` on creation of a new project. + +========== +Pre-commit +========== +Pre-commit is configured through `.ruff`, and can be installed locally as normal using `pre-commit run --all-files`. +However it is also run through tox, and is integrated into the CI, therefore it needs to be run though tox when you're checking it before PR. +As mentioned above, we have a strictly defined `.ruff.toml` and we strongly recommend using the full set of rules using the Y option in the setup wizard. + +===================================================== +Updating a Package with a new version of the template +===================================================== + +Updating the package can be performed either automatically though the GitHub workflow or automatically using crufts CLI tool. +Doing so thought the workflow is a case of reviewing a merging the PR through the GitHub interface. +Updating through the Cruft CLI is sometimes necessary, this is done using initially checking the status of the repo using `cruft check`. +This will let you know whether the repo is upto date or not. +If not, `cruft update` will update the repo, it is then a case of resolving any conflicts and clearing out any `.rej` files. +`.rej` files are artifacts of the cruft process. + +If you need up explicitly update one of the variables in the package `.cruft.json` e.g. changing a `n` to a `y` this can be done using `variables_to_update`. +`cruft update --variables-to-update '{"use_extended_ruff_linting": "y"}`. +This will work through the repo and include the desired functionality without any further action. +Commit and push the resulting changes and you're done! From d023b08257ae1a88180b6c8058bf30ad99141999 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:50:18 +0000 Subject: [PATCH 194/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 1.14.0 to 1.15.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/d68193b68216da64eafaa618f53c59f5d271c56e...9f1f43251dde69da8613ea8e11144f05cdea41d5) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 90dbc93..cf539cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 with: envs: | - macos: py310-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 with: artifact-path: | cookies From d4cc8d5be9ee519d9081aee0131743387c3ff89f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 9 Dec 2024 13:21:02 +0000 Subject: [PATCH 195/265] Fix issue_url --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 2753a13..c3c03bd 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -111,7 +111,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} https:github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/changelog/pull/{issue}>`__" + issue_format = "`#{issue} https:github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From 5446d70263fff597b33ca7b0833aaeb5f3c3ac59 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 9 Dec 2024 13:23:46 +0000 Subject: [PATCH 196/265] Fix issue_url again --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index c3c03bd..bdae04a 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -111,7 +111,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" package = "{{ cookiecutter.package_name }}" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} https:github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/pull/{issue}>`__" + issue_format = "`#{issue} `__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] From 136004b8373842638c5953549b157f250b99f9dd Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 11 Dec 2024 07:06:23 +0000 Subject: [PATCH 197/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 43ffc3e..c09b89e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.1" + rev: "v0.8.2" hooks: - id: ruff args: ["--fix"] From 1b3a9080b3847cbc537aa741bf922f6106bd6ce6 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 16 Dec 2024 09:46:23 +0000 Subject: [PATCH 198/265] Add no changelog label to update PRs --- .../.github/workflows/sub_package_update.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 0b657f2..523cca3 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -86,6 +86,8 @@ jobs: delete-branch: true draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }} title: "Updates from the package template" + labels: | + No Changelog Entry Needed body: | This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template). If this pull request has been opened as a draft there are conflicts which need fixing. From a0de03cdbfc85d142dfadd95b28be3e0386ef6c6 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 18 Dec 2024 07:05:59 +0000 Subject: [PATCH 199/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index c09b89e..9f5530b 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.2" + rev: "v0.8.3" hooks: - id: ruff args: ["--fix"] From 10f72582a6865c650011bafe2fb3d95067eb75bd Mon Sep 17 00:00:00 2001 From: Shane Maloney Date: Fri, 13 Dec 2024 12:47:12 +0000 Subject: [PATCH 200/265] Fix package name in towncrier configuration --- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index bdae04a..8c1d04a 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -108,7 +108,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py" # TODO: This should be in towncrier.toml but Giles currently only works looks in # pyproject.toml we should move this back when it's fixed. [tool.towncrier] - package = "{{ cookiecutter.package_name }}" + package = "{{ cookiecutter.module_name }}" filename = "CHANGELOG.rst" directory = "changelog/" issue_format = "`#{issue} `__" From 9d9cdcf43322601160ad2655333a9a961b2008ae Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 18 Dec 2024 10:26:07 +0000 Subject: [PATCH 201/265] Add a tests for different package / module name --- tests/conftest.py | 4 +++- tests/test_hooks.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 42bfa9b..6d3f32d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -65,7 +65,9 @@ def bake_examples(cookies): """ Examples on. """ - result = cookies.bake(extra_context={"include_example_code": "y", + result = cookies.bake(extra_context={"package_name": "example-package", + "module_name": "example_package", + "include_example_code": "y", "author_name": "test", "use_extended_ruff_linting": "y"}) return _handle_cookiecutter_errors(result) diff --git a/tests/test_hooks.py b/tests/test_hooks.py index f5b1950..a1f4267 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -37,7 +37,7 @@ def test_examples_present(cookiejar_examples): example_files.append("example_c.pyx") for afile in example_files: - assert (cj.project_path / ctx['package_name'] / afile).exists() + assert (cj.project_path / ctx['module_name'] / afile).exists() @pytest.mark.parametrize("license, lfile", [ From c11ab1d032cefe8c4dccf886d69a86bd913dac7a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 18 Dec 2024 10:55:49 +0000 Subject: [PATCH 202/265] Even more batchpr --- tools/batchpr_manual_cruft_update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/batchpr_manual_cruft_update.py b/tools/batchpr_manual_cruft_update.py index 2ece35c..825c421 100755 --- a/tools/batchpr_manual_cruft_update.py +++ b/tools/batchpr_manual_cruft_update.py @@ -94,7 +94,8 @@ def run_multi_updater( The GITHUB_TOKEN should be a Personal Access Token (classic) with the workflow permission and public_repo permissions. """ - helper = CruftUpdater(token=os.environ["GITHUB_TOKEN"], dry_run=dry_run, verbose=verbose, cleanup_remote_branch=cleanup_remote_branch, extra_context=json.loads(extra_context)) + extra_context = json.loads(extra_context) if extra_context else extra_context + helper = CruftUpdater(token=os.environ["GITHUB_TOKEN"], dry_run=dry_run, verbose=verbose, cleanup_remote_branch=cleanup_remote_branch, extra_context=extra_context) for repo in repos: helper.run(repo) From a193655cd16e3b17cdcd5446e804a62aaec7bf16 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 20 Dec 2024 11:54:25 +0000 Subject: [PATCH 203/265] remove html theme options --- docs/conf.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8c37317..3f0987d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,14 +46,6 @@ # html_theme = 'sunpy' -html_theme_options = { - "description": "A generic Python packaging guide and template.", - "code_font_family": "'Fira Code', monospace", - "github_user": "SunPy", - "github_repo": "packaging-template", - "sidebar_width": "300px" -} - # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". From a0fe07d69e5066cdbc509450b651741caf5295d1 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 25 Dec 2024 07:05:31 +0000 Subject: [PATCH 204/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 9f5530b..51f4cb2 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.3" + rev: "v0.8.4" hooks: - id: ruff args: ["--fix"] From 8b25d687296d7ce96c0d3db6f4e77e42ca746a2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:59:27 +0000 Subject: [PATCH 205/265] Bump peter-evans/create-pull-request Bumps the actions group with 1 update in the / directory: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request). Updates `peter-evans/create-pull-request` from 7.0.5 to 7.0.6 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/5e914681df9dc83aa4e4905692ca88beb2f9e91f...67ccf781d68cd99b580ae25a5c18a1cc84ffff1f) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 69859d0..58ca39d 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -63,7 +63,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 with: token: ${{ secrets.GITHUB_TOKEN }} draft: ${{ steps.merge.outputs.has_conflicts == '1' }} diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index a127332..75ca20f 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -35,7 +35,7 @@ jobs: run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' - name: Create pull request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 with: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true From 9bb5c19fbff4e164ca574fb90e73d81e8721f33d Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 8 Jan 2025 07:05:41 +0000 Subject: [PATCH 206/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 51f4cb2..d6b8318 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.4" + rev: "v0.8.6" hooks: - id: ruff args: ["--fix"] From 978957b30e8e74d86c9b80d4f593e458d1a2277d Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:05:29 +0000 Subject: [PATCH 207/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index d6b8318..005b295 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.6" + rev: "v0.9.1" hooks: - id: ruff args: ["--fix"] From 333bf62abefb36df3496c785c8b11d2027319430 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 22 Jan 2025 07:05:36 +0000 Subject: [PATCH 208/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 005b295..8e8c80e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.1" + rev: "v0.9.2" hooks: - id: ruff args: ["--fix"] @@ -26,7 +26,7 @@ repos: - id: mixed-line-ending exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.0 hooks: - id: codespell args: [ "--write-changes" ] From 1f8ae7fd1399690cfd59ff012994ec230ea500fa Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 29 Jan 2025 07:05:34 +0000 Subject: [PATCH 209/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 8e8c80e..c6c16ca 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.2" + rev: "v0.9.3" hooks: - id: ruff args: ["--fix"] - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" @@ -26,7 +26,7 @@ repos: - id: mixed-line-ending exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell args: [ "--write-changes" ] From fde23822b495abd36745248a260a9571da98b32b Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Tue, 28 Jan 2025 23:51:27 -0800 Subject: [PATCH 210/265] Update .readthedocs.yaml --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0af9847..07db93e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,5 +1,8 @@ version: 2 +sphinx: + configuration: docs/conf.py + build: os: ubuntu-22.04 tools: From 2d7ac7076b824ffa82908d0b3599639523be0638 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 29 Jan 2025 09:09:01 +0000 Subject: [PATCH 211/265] Whoops --- .readthedocs.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ce597dc..b679dad 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,8 +1,5 @@ version: 2 -sphinx: - configuration: docs/conf.py - build: os: ubuntu-lts-latest tools: From 965497845efff8ac6c74124466f974caebaa904d Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Sat, 1 Feb 2025 07:05:10 +0000 Subject: [PATCH 212/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index c6c16ca..5ba9bc2 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.3" + rev: "v0.9.4" hooks: - id: ruff args: ["--fix"] From 539bcaef1448c4fcb190a6bbe282b8dccc6e9e15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:09:30 +0000 Subject: [PATCH 213/265] Bump the actions group across 1 directory with 2 updates Bumps the actions group with 2 updates in the / directory: [actions/setup-python](https://github.com/actions/setup-python) and [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `actions/setup-python` from 5.3.0 to 5.4.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/0b93645e9fea7318ecaed2b359559ac225c90a2b...42375524e23c412d93fb67b49958b491fce71c38) Updates `OpenAstronomy/github-actions-workflows` from 1.15.0 to 1.16.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/9f1f43251dde69da8613ea8e11144f05cdea41d5...8c0fde6f7e926df6ed7057255d29afa9c1ad5320) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: OpenAstronomy/github-actions-workflows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-update.yaml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 75ca20f..3321439 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -25,7 +25,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 - name: Install pre-commit run: pip install pre-commit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d07413c..4f33ff9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 with: envs: | - macos: py311-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 with: artifact-path: | cookies From 415b289da764219525d89f6f984a79fb57cf6700 Mon Sep 17 00:00:00 2001 From: Jan Gieseler Date: Thu, 6 Feb 2025 17:32:39 +0200 Subject: [PATCH 214/265] change code examples from openastronomy to sunpy --- docs/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 1c93b13..de57aca 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,7 +27,7 @@ To create a new package based on the template run: .. code-block:: console $ pip install cookiecutter cruft - $ cruft create https://github.com/OpenAstronomy/packaging-guide + $ cruft create https://github.com/sunpy/package-template and go through the steps offered in the cli naming your package and filling in your details. Cruft is built on cookiecutter, and enables the updating of the template from the source. @@ -42,7 +42,7 @@ If you would like to stick to simply the cookiecutter approach, the template sti .. code-block:: console $ pip install cookiecutter - $ cookiecutter gh:OpenAstronomy/packaging-guide -o ./output_directory + $ cookiecutter gh:sunpy/package-template -o ./output_directory This will create a new directory in your current directory named the same as the value of "packagename" you supplied. Change into this directory and run ``git init`` to make it into a git repository, and make an initial commit. From d7fa4e2e631cefea3833744915ed188cffb7c8b1 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 6 Feb 2025 08:39:53 -0800 Subject: [PATCH 215/265] Update pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 9e42ce4..173e2a1 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -75,11 +75,7 @@ include-package-data = true [tool.setuptools.packages.find] include = ["{{ cookiecutter.module_name }}*"] -<<<<<<< HEAD -{%- if cookiecutter.enable_dynamic_dev_versions == 'y' %} -======= {% if cookiecutter.enable_dynamic_dev_versions == 'y' -%} ->>>>>>> openastronomy/main exclude = ["{{ cookiecutter.module_name }}._dev*"] {%- endif %} {% if cookiecutter.use_compiled_extensions == 'y' %} From 5748596a912e8b93fc81169ce8e481c8b2594716 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 7 Feb 2025 13:46:59 -0800 Subject: [PATCH 216/265] Add line breaks to long signatures in API docs --- {{ cookiecutter.package_name }}/docs/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 60625ff..ee50eeb 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -30,6 +30,9 @@ # -- General configuration --------------------------------------------------- +# Wrap large function/method signatures +maximum_signature_line_length = 80 + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named "sphinx.ext.*") or your custom # ones. From 3411c10870cce4a6ed6744cf862694fadd3a08c0 Mon Sep 17 00:00:00 2001 From: ankitkhushwaha <124484362+ankitkhushwaha@users.noreply.github.com> Date: Sat, 8 Feb 2025 17:54:03 +0530 Subject: [PATCH 217/265] Add AI-Note --- {{ cookiecutter.package_name }}/README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/{{ cookiecutter.package_name }}/README.rst b/{{ cookiecutter.package_name }}/README.rst index 534e27e..feda3e6 100644 --- a/{{ cookiecutter.package_name }}/README.rst +++ b/{{ cookiecutter.package_name }}/README.rst @@ -1,6 +1,13 @@ {{ cookiecutter.short_description }} {{ '-' * cookiecutter.short_description|length }} +Usage of Generative AI +====================== + +We expect authentic engagement in our community. +Be wary of posting output from Large Language Models or similar generative AI as comments on GitHub or any other platform, as such comments tend to be formulaic and low quality content. +If you use generative AI tools as an aid in developing code or documentation changes, ensure that you fully understand the proposed changes and can explain why they are the correct approach and an improvement to the current state. + License ------- From 9749d8ec4089c22db6275c34f8305cae4b3772a8 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 10 Feb 2025 10:56:32 +0000 Subject: [PATCH 218/265] Update README.rst --- {{ cookiecutter.package_name }}/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/README.rst b/{{ cookiecutter.package_name }}/README.rst index feda3e6..b718bdb 100644 --- a/{{ cookiecutter.package_name }}/README.rst +++ b/{{ cookiecutter.package_name }}/README.rst @@ -2,7 +2,7 @@ {{ '-' * cookiecutter.short_description|length }} Usage of Generative AI -====================== +---------------------- We expect authentic engagement in our community. Be wary of posting output from Large Language Models or similar generative AI as comments on GitHub or any other platform, as such comments tend to be formulaic and low quality content. From 5ff78f233a66c3e1aa28b38e5ed7f57e3e0b9bd5 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:09:52 -0800 Subject: [PATCH 219/265] Apply suggestions from code review --- docs/index.rst | 58 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index d0be418..adecb21 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,25 +57,43 @@ The template currently implements the following optional flags, all of which def * ``include_cruft_update_github_repo``: This option adds a github workflow with pulls in the latest changes from the template every Monday morning and creates a PR against the repo which can then be accepted or closed. * ``use_extended_ruff_linting``: This option flag enables the stricter ruff rules. Recommend `Y` on creation of a new project. -========== Pre-commit ========== -Pre-commit is configured through `.ruff`, and can be installed locally as normal using `pre-commit run --all-files`. -However it is also run through tox, and is integrated into the CI, therefore it needs to be run though tox when you're checking it before PR. -As mentioned above, we have a strictly defined `.ruff.toml` and we strongly recommend using the full set of rules using the Y option in the setup wizard. - -===================================================== -Updating a Package with a new version of the template -===================================================== - -Updating the package can be performed either automatically though the GitHub workflow or automatically using crufts CLI tool. -Doing so thought the workflow is a case of reviewing a merging the PR through the GitHub interface. -Updating through the Cruft CLI is sometimes necessary, this is done using initially checking the status of the repo using `cruft check`. -This will let you know whether the repo is upto date or not. -If not, `cruft update` will update the repo, it is then a case of resolving any conflicts and clearing out any `.rej` files. -`.rej` files are artifacts of the cruft process. - -If you need up explicitly update one of the variables in the package `.cruft.json` e.g. changing a `n` to a `y` this can be done using `variables_to_update`. -`cruft update --variables-to-update '{"use_extended_ruff_linting": "y"}`. -This will work through the repo and include the desired functionality without any further action. -Commit and push the resulting changes and you're done! + +Pre-commit is configured through ``.pre-commit-config.yaml`` and can be installed locally and ran: + +.. code-block:: bash + + $ pre-commit run --all-files + +It also possible to use the tox environment to run it and and is integrated into the CI. + +Within ``.pre-commit-config.yaml``, there are several tools and each one is configured either within the ``.pre-commit-config.yaml`` or for larger tools like ruff, it is has a dedicated config file ``.ruff.toml`` and we strongly recommend using the full set of rules when you setup your package. + +Updating to a new version of the template +========================================= + +It will be simplest to updating a package to a newer template by waiting for the GitHub workflow to trigger. +This will trigger a pull request one can review and merge via GitHub's UI. + +If you do not want to wait, or want to do it manually, you will have to use cruft's CLI. +For this you will need to install cruft locally and then you can check the status of the package by running: + +.. code-block:: bash + $ cruft check + +This will let you know whether the repository is up to date or not. +From there, you can run: + +.. code-block:: bash + $ cruft update + +To update the repo and if there is a case conflicting files, ``.rej`` files will be created and you will have to manually deal with them and merge changes. + +If you need up update one of the variables in the package ``.cruft.json`` for example, changing a ``n`` to a ``` this can be done using: + +.. code-block:: bash + $ cruft update --variables-to-update '{"use_extended_ruff_linting": "y"}' + +This will work through the codebase and include the desired functionality without any further action. +Then you can commit and push the resulting changes. From 1ab5193a532ce8bc64e1e3154649cfa0ecf77e79 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 06:10:30 +0000 Subject: [PATCH 220/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index adecb21..587bbf5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,7 +81,7 @@ For this you will need to install cruft locally and then you can check the statu .. code-block:: bash $ cruft check - + This will let you know whether the repository is up to date or not. From there, you can run: From 1ee481688e844bc4306f6d391949a9cf8b791e1f Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:15:43 -0800 Subject: [PATCH 221/265] Update rtd_environment.yaml --- docs/rtd_environment.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml index f0fee16..1aefaea 100644 --- a/docs/rtd_environment.yaml +++ b/docs/rtd_environment.yaml @@ -1,8 +1,10 @@ -name: rtd311 +name: rtd313 channels: - conda-forge - defaults dependencies: - - python=3.11 + - python=3.13 - pip - graphviz + - pip: + - sunpy-sphinx-theme From 2743b191a3fb15dfa5ba77039931844bd7192ca9 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:16:49 -0800 Subject: [PATCH 222/265] Update index.rst --- docs/index.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 587bbf5..6ba5b6e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -79,20 +79,23 @@ This will trigger a pull request one can review and merge via GitHub's UI. If you do not want to wait, or want to do it manually, you will have to use cruft's CLI. For this you will need to install cruft locally and then you can check the status of the package by running: -.. code-block:: bash +.. code-block:: console + $ cruft check This will let you know whether the repository is up to date or not. From there, you can run: -.. code-block:: bash +.. code-block:: console + $ cruft update To update the repo and if there is a case conflicting files, ``.rej`` files will be created and you will have to manually deal with them and merge changes. If you need up update one of the variables in the package ``.cruft.json`` for example, changing a ``n`` to a ``` this can be done using: -.. code-block:: bash +.. code-block:: console + $ cruft update --variables-to-update '{"use_extended_ruff_linting": "y"}' This will work through the codebase and include the desired functionality without any further action. From 3e64521efd284534794cefc5ac265df56835bf1d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:17:29 -0800 Subject: [PATCH 223/265] Update rtd_environment.yaml --- docs/rtd_environment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml index 1aefaea..723ae26 100644 --- a/docs/rtd_environment.yaml +++ b/docs/rtd_environment.yaml @@ -6,5 +6,5 @@ dependencies: - python=3.13 - pip - graphviz - - pip: - - sunpy-sphinx-theme + - pip: + - sphinx-bootstrap-theme From 49960ff92987c1c7e272976e2d4080cf02dfa7a7 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:20:00 -0800 Subject: [PATCH 224/265] Update docs/index.rst --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 6ba5b6e..70ae5eb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -92,7 +92,7 @@ From there, you can run: To update the repo and if there is a case conflicting files, ``.rej`` files will be created and you will have to manually deal with them and merge changes. -If you need up update one of the variables in the package ``.cruft.json`` for example, changing a ``n`` to a ``` this can be done using: +If you need up update one of the variables in the package ``.cruft.json`` for example, changing a ``n`` to a ``y`` this can be done using: .. code-block:: console From 1c9970ce95387006b62eaeb2291bf818300d575d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 10 Feb 2025 22:20:48 -0800 Subject: [PATCH 225/265] Update docs/rtd_environment.yaml --- docs/rtd_environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml index 723ae26..a3b2a37 100644 --- a/docs/rtd_environment.yaml +++ b/docs/rtd_environment.yaml @@ -7,4 +7,4 @@ dependencies: - pip - graphviz - pip: - - sphinx-bootstrap-theme + - sunpy-sphinx-theme From 3a1e779b9ed692090e3f97b78613c549610afce7 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 12 Feb 2025 07:05:33 +0000 Subject: [PATCH 226/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 5ba9bc2..ea6b742 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.4" + rev: "v0.9.6" hooks: - id: ruff args: ["--fix"] From 81778d5cf991dae890b8c356f3c33873ed5b3e99 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Wed, 19 Feb 2025 17:39:08 +0000 Subject: [PATCH 227/265] Update ci.yml --- .../.github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index b62ac0c..a7261d9 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -73,23 +73,6 @@ jobs: envs: | - linux: build_docs - cron: - if: | - github.event_name == 'workflow_dispatch' || ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'Run cron CI') - ) - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - with: - default_python: '{{ default_python }}' - submodules: false - coverage: codecov - toxdeps: tox-pypi-filter - envs: | - - linux: py311-devdeps - secrets: - CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} - publish: # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi From f1d92f95b8aa0776719af77bc5d0d381d7e57c3c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Wed, 19 Feb 2025 17:47:51 +0000 Subject: [PATCH 228/265] Add devdeeps to test --- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index a7261d9..160388d 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -56,6 +56,7 @@ jobs: - windows: py311 - macos: py310 - linux: py310-oldestdeps + - linux: py311-devdeps secrets: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} From 91b3627089fe5fbe3f9f777ac4a6a723a3ba2e3a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 20 Feb 2025 08:44:54 +0000 Subject: [PATCH 229/265] Update ci.yml --- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 160388d..1b19e5b 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -15,7 +15,14 @@ on: pull_request: # Allow manual runs through the web UI workflow_dispatch: - + schedule: + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: '0 7 * * 3' # Every Wed at 07:00 UTC + concurrency: group: {{ '${{ github.workflow }}-${{ github.ref }}' }} cancel-in-progress: true From 45a54a28f7b8372acaa619448239d057f249b155 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 08:49:08 +0000 Subject: [PATCH 230/265] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- {{ cookiecutter.package_name }}/.github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 1b19e5b..6b32253 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -22,7 +22,7 @@ on: # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - cron: '0 7 * * 3' # Every Wed at 07:00 UTC - + concurrency: group: {{ '${{ github.workflow }}-${{ github.ref }}' }} cancel-in-progress: true From 634b247ea3d462cce359db3f304abf3fd2544fc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:31:27 +0000 Subject: [PATCH 231/265] Bump peter-evans/create-pull-request Bumps the actions group with 1 update in the / directory: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request). Updates `peter-evans/create-pull-request` from 7.0.6 to 7.0.7 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/67ccf781d68cd99b580ae25a5c18a1cc84ffff1f...dd2324fc52d5d43c699a5636bcf19fceaa70c284) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 58ca39d..0226e1e 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -63,7 +63,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 + uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7 with: token: ${{ secrets.GITHUB_TOKEN }} draft: ${{ steps.merge.outputs.has_conflicts == '1' }} diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 3321439..b39f3cf 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -35,7 +35,7 @@ jobs: run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' - name: Create pull request - uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 + uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7 with: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true From a8aeef9a45e4e24de8028d815c923bc7f8ba2c9f Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 26 Feb 2025 07:05:57 +0000 Subject: [PATCH 232/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index ea6b742..327ba50 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.6" + rev: "v0.9.7" hooks: - id: ruff args: ["--fix"] From fa8743746311cd89c8e51f325ec55b5929567455 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Sat, 1 Mar 2025 07:05:12 +0000 Subject: [PATCH 233/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 327ba50..349448d 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.7" + rev: "v0.9.9" hooks: - id: ruff args: ["--fix"] - repo: https://github.com/PyCQA/isort - rev: 6.0.0 + rev: 6.0.1 hooks: - id: isort exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" From 03655544477c050113a3eed358ea76aba30e9a25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 11:54:25 +0000 Subject: [PATCH 234/265] Bump peter-evans/create-pull-request Bumps the actions group with 1 update in the / directory: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request). Updates `peter-evans/create-pull-request` from 7.0.7 to 7.0.8 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/dd2324fc52d5d43c699a5636bcf19fceaa70c284...271a8d0340265f705b14b6d32b9829c1cb33d45e) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 0226e1e..159785c 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -63,7 +63,7 @@ jobs: - name: Create pull request if: steps.check.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7 + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 with: token: ${{ secrets.GITHUB_TOKEN }} draft: ${{ steps.merge.outputs.has_conflicts == '1' }} diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index b39f3cf..8d94eb6 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -35,7 +35,7 @@ jobs: run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml' - name: Create pull request - uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7 + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 with: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true From d13f0223522c070e9c2c5e146fb5634ec944af4b Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 12 Mar 2025 07:06:00 +0000 Subject: [PATCH 235/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 349448d..e21a4fb 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.9" + rev: "v0.9.10" hooks: - id: ruff args: ["--fix"] From 75d7aa024648b1d66ae10a21d396fb4e98559389 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 26 Mar 2025 07:06:07 +0000 Subject: [PATCH 236/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index e21a4fb..ffab904 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.10" + rev: "v0.11.2" hooks: - id: ruff args: ["--fix"] From 310f9383fc4433679190f82d0e23c3681e81f083 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:15:52 +0000 Subject: [PATCH 237/265] Bump actions/setup-python in the actions group across 1 directory Bumps the actions group with 1 update in the / directory: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 5.4.0 to 5.5.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/42375524e23c412d93fb67b49958b491fce71c38...8d9ed9ac5c53483de85588cdf95a591a75ab9f55) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 8d94eb6..a80e64c 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -25,7 +25,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 - name: Install pre-commit run: pip install pre-commit From 5a4f4afeddc0a3b2051176943722e7249743e128 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Wed, 9 Apr 2025 07:06:19 +0000 Subject: [PATCH 238/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index ffab904..086b16b 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.2" + rev: "v0.11.4" hooks: - id: ruff args: ["--fix"] From 46452cd77ef435ca776acef1a19e3641f4bf3a98 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 15 Apr 2025 09:50:29 +0100 Subject: [PATCH 239/265] Update pre-commit-update.yaml --- .github/workflows/pre-commit-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index a80e64c..33d1777 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -12,7 +12,7 @@ on: # │ │ ┌───────── day of the month (1 - 31) # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - - cron: '0 7 1 * 3' # First Wednesday of the month at 7am UTC (so it can be merged before the monday package updates) + - cron: '0 7 1 * *' # First day of the month at 7am UTC jobs: update: From 3b422100b005a7ec7c11b3e11a9cad8a3f9005bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:31:08 +0000 Subject: [PATCH 240/265] Bump actions/setup-python in the actions group across 1 directory Bumps the actions group with 1 update in the / directory: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 5.5.0 to 5.6.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/8d9ed9ac5c53483de85588cdf95a591a75ab9f55...a26af69be951a213d495a4c3e4e4022e16d87065) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 5.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-update.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 33d1777..3c5f58e 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -25,7 +25,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - name: Install pre-commit run: pip install pre-commit From 78ec72a0d98c88fc7d56de1e2ed1e8e303c1dbee Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Thu, 1 May 2025 07:00:45 +0000 Subject: [PATCH 241/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 086b16b..9a9948e 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.4" + rev: "v0.11.7" hooks: - id: ruff args: ["--fix"] From aecee0f44de7729c60e19c6995fb68046ecc60f2 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 6 May 2025 09:52:13 +0100 Subject: [PATCH 242/265] Update pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 46dae0c..5b856e3 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -89,21 +89,9 @@ version_file = "{{ cookiecutter.module_name }}/_version.py" version_file = "{{ cookiecutter.module_name }}/version.py" {%- endif %} -<<<<<<< HEAD [tool.gilesbot] [tool.gilesbot.pull_requests] enabled = true -======= -[tool.pytest.ini_options] -testpaths = [ - "{{ cookiecutter.module_name }}", - "docs", -] -doctest_plus = "enabled" -text_file_format = "rst" -addopts = "--doctest-rst" -norecursedirs = ["{{ cookiecutter.module_name }}[\\/]_dev"] ->>>>>>> openastronomy/main [tool.gilesbot.towncrier_changelog] enabled = true From 76194c68de236f0a81da15f9781e940decd30055 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Sun, 1 Jun 2025 07:00:52 +0000 Subject: [PATCH 243/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 9a9948e..491e554 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.7" + rev: "v0.11.12" hooks: - id: ruff args: ["--fix"] From 9dfda8228d3163cce1219f8b4ff4a789a34449d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:20:46 +0000 Subject: [PATCH 244/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 1.16.0 to 1.17.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/8c0fde6f7e926df6ed7057255d29afa9c1ad5320...a2e0af7c20b84890b3a72de89c24c3382d6847fb) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-version: 1.17.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f33ff9..29c4193 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@a2e0af7c20b84890b3a72de89c24c3382d6847fb # v1.17.0 with: envs: | - macos: py311-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@a2e0af7c20b84890b3a72de89c24c3382d6847fb # v1.17.0 with: artifact-path: | cookies From 21e1b2b54f368d0c80924b67fbb2a76e71c8fc6a Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Jun 2025 16:25:26 +0100 Subject: [PATCH 245/265] Update OpenAstronomy Workflows to v2 --- .../.github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 6b32253..07fffe1 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -29,7 +29,7 @@ concurrency: jobs: core: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 with: submodules: false coverage: codecov @@ -53,7 +53,7 @@ jobs: test: needs: [core, sdist_verify] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 with: submodules: false coverage: codecov @@ -69,7 +69,7 @@ jobs: docs: needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 with: default_python: '{{ default_python }}' submodules: false @@ -92,7 +92,7 @@ jobs: ) needs: [test, docs] {%- if cookiecutter.use_compiled_extensions == 'y' %} - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v2 with: sdist: true test_extras: 'tests' @@ -104,7 +104,7 @@ jobs: - cp3{9,10,11,12}-macosx_arm64 - cp3{9,10,11,12}-win_amd64 {%- else %} - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 with: python-version: '{{ default_python }}' test_extras: 'tests' From c91869d2459467247d6bafb00b8c9c444a73ae1f Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 11 Jun 2025 16:27:36 +0100 Subject: [PATCH 246/265] Python version bumps --- .../.github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 07fffe1..56cd667 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: coverage: codecov toxdeps: tox-pypi-filter envs: | - - linux: py312 + - linux: py313 secrets: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} @@ -61,9 +61,9 @@ jobs: posargs: -n auto envs: | - windows: py311 - - macos: py310 + - macos: py312 - linux: py310-oldestdeps - - linux: py311-devdeps + - linux: py313-devdeps secrets: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} @@ -99,10 +99,10 @@ jobs: test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' submodules: false targets: | - - cp3{9,10,11,12}-manylinux*_x86_64 - - cp3{9,10,11,12}-macosx_x86_64 - - cp3{9,10,11,12}-macosx_arm64 - - cp3{9,10,11,12}-win_amd64 + - cp3{10,11,12,13}-manylinux*_x86_64 + - cp3{10,11,12,13}-macosx_x86_64 + - cp3{10,11,12,13}-macosx_arm64 + - cp3{10,11,12,13}-win_amd64 {%- else %} uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 with: From 405404eafd9b28113b9703082be15e7d69d4ae19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:37:59 +0000 Subject: [PATCH 247/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 1.17.0 to 2.0.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/a2e0af7c20b84890b3a72de89c24c3382d6847fb...d83bb11581e517f1e786ae76f146781fdd21cd2f) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-version: 2.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 29c4193..4ce62f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@a2e0af7c20b84890b3a72de89c24c3382d6847fb # v1.17.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d83bb11581e517f1e786ae76f146781fdd21cd2f # v2.0.0 with: envs: | - macos: py311-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@a2e0af7c20b84890b3a72de89c24c3382d6847fb # v1.17.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d83bb11581e517f1e786ae76f146781fdd21cd2f # v2.0.0 with: artifact-path: | cookies From 2be5f3700ba6e93cacf115d66a787e63b4e88566 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:26:48 +0000 Subject: [PATCH 248/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 2.0.0 to 2.1.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/d83bb11581e517f1e786ae76f146781fdd21cd2f...86823142467dd2afcd1bbac57d3a664cf468eb3b) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-version: 2.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ce62f7..f612a83 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d83bb11581e517f1e786ae76f146781fdd21cd2f # v2.0.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@86823142467dd2afcd1bbac57d3a664cf468eb3b # v2.1.0 with: envs: | - macos: py311-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d83bb11581e517f1e786ae76f146781fdd21cd2f # v2.0.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@86823142467dd2afcd1bbac57d3a664cf468eb3b # v2.1.0 with: artifact-path: | cookies From e5e5e0221ef076bc22560a4c37bf16a1074849a2 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Tue, 1 Jul 2025 07:01:32 +0000 Subject: [PATCH 249/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 491e554..1ce1d34 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.12" + rev: "v0.12.1" hooks: - id: ruff args: ["--fix"] From d1437ea8a23479aca7214a49cc5a299c65fb36aa Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 7 Jul 2025 08:59:50 +0100 Subject: [PATCH 250/265] PLC0415 --- .../{{ cookiecutter.module_name }}/example_mod.py | 6 +++--- .../{{ cookiecutter.module_name }}/tests/test_example.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index 9ea78d2..643e725 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -43,7 +43,7 @@ def do_primes(n, usecython=False): {% if cookiecutter.use_compiled_extensions != 'y' %} raise Exception("This template does not have the example C code included.") {% else %} - from .example_c import primes as cprimes + from .example_c import primes as cprimes # noqa: PLC0415 print('Using cython-based primes') # noqa: T201 return cprimes(n) {% endif %} @@ -53,9 +53,9 @@ def do_primes(n, usecython=False): def main(args=None): - from time import time + from time import time # noqa: PLC0415 - from astropy.utils.compat import argparse + from astropy.utils.compat import argparse # noqa: PLC0415 parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('-c', '--use-cython', dest='cy', action='store_true', diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py index 9d766e5..5349f11 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/tests/test_example.py @@ -1,9 +1,9 @@ {% if cookiecutter.use_compiled_extensions == 'y' %} def test_primes_c(): - from {{ cookiecutter.module_name }}.example_c import primes as primes_c + from {{ cookiecutter.module_name }}.example_c import primes as primes_c # noqa: PLC0415 assert primes_c(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] {% endif %} def test_primes(): - from {{ cookiecutter.module_name }}.example_mod import primes + from {{ cookiecutter.module_name }}.example_mod import primes # noqa: PLC0415 assert primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] From 69ae2b1307be75c200537c880b4cd82e8078a218 Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Fri, 1 Aug 2025 07:04:22 +0000 Subject: [PATCH 251/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 1ce1d34..3605172 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.1" + rev: "v0.12.7" hooks: - id: ruff args: ["--fix"] From 28de72a015352f1c078a1dbf85f83e513d7079bb Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Aug 2025 10:27:59 -0700 Subject: [PATCH 252/265] Update tox.ini --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 46dead5..ef7bb59 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,8 @@ deps = pytest-cookies pytest-venv tox[test] - + # Test + devpi-process commands = !bake_cookies: pytest tests/ {posargs} bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies From 07c9efbc0934b8f53e00c571c8412148d057828d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Aug 2025 10:31:51 -0700 Subject: [PATCH 253/265] Update tox.ini --- tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index ef7bb59..79eb667 100644 --- a/tox.ini +++ b/tox.ini @@ -18,9 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[test] - # Test - devpi-process + "tox[test]" commands = !bake_cookies: pytest tests/ {posargs} bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies From f8ad787d9db83765efabec5446a7284e2cd11b5d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Aug 2025 10:37:09 -0700 Subject: [PATCH 254/265] Update tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 79eb667..994d77c 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - "tox[test]" + tox[test] commands = !bake_cookies: pytest tests/ {posargs} bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies From d97a71e257c4d0f49dae3bd225585f06257dfc13 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Aug 2025 10:49:52 -0700 Subject: [PATCH 255/265] Update tox.ini --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 994d77c..f34fc97 100644 --- a/tox.ini +++ b/tox.ini @@ -19,6 +19,8 @@ deps = pytest-cookies pytest-venv tox[test] + devpi-process + pytest-mock commands = !bake_cookies: pytest tests/ {posargs} bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies From c8632ac2122716ce306f8646d76f9f0605732382 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:14:18 +0000 Subject: [PATCH 256/265] Bump OpenAstronomy/github-actions-workflows Bumps the actions group with 1 update in the / directory: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 2.1.0 to 2.2.1 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/86823142467dd2afcd1bbac57d3a664cf468eb3b...28e947497bed4d6ec3fa1d66d198e95a1d17bc63) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-version: 2.2.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f612a83..23e4ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ concurrency: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@86823142467dd2afcd1bbac57d3a664cf468eb3b # v2.1.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@28e947497bed4d6ec3fa1d66d198e95a1d17bc63 # v2.2.1 with: envs: | - macos: py311-test @@ -21,7 +21,7 @@ jobs: - linux: build_docs bake_cookies: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@86823142467dd2afcd1bbac57d3a664cf468eb3b # v2.1.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@28e947497bed4d6ec3fa1d66d198e95a1d17bc63 # v2.2.1 with: artifact-path: | cookies From d2de57af7f976fc9a4cab5354f641c05f903cf0d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Mon, 4 Aug 2025 10:04:36 -0700 Subject: [PATCH 257/265] doc config update --- {{ cookiecutter.package_name }}/docs/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index ee50eeb..9736433 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -60,8 +60,7 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = ".rst" +source_suffix = {".rst": "restructuredtext"} # The master toctree document. master_doc = "index" From 4672eef0622de896d801ef5a3c7a09b247e110d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:27:13 +0000 Subject: [PATCH 258/265] Bump actions/checkout in the actions group across 1 directory Bumps the actions group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.2.2 to 4.3.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...08eba0b27e820071cde6df949e0beb9ba4906955) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 4.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 159785c..18cc8e5 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -21,7 +21,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index 3c5f58e..c451ad6 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -21,7 +21,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 From 21d5b01adc398400ca7ba60e36c4b7c505176fd4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:53:44 +0000 Subject: [PATCH 259/265] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30b0079..ef1df75 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-case-conflict - id: trailing-whitespace From 247d21b9bd0bd3ad70d9c22acd9eaae4119a420d Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 19 Aug 2025 16:11:49 +0100 Subject: [PATCH 260/265] Update tox.ini --- tox.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/tox.ini b/tox.ini index a08a1e8..275d11f 100644 --- a/tox.ini +++ b/tox.ini @@ -21,10 +21,7 @@ deps = tox[test] devpi-process pytest-mock -<<<<<<< HEAD -======= ->>>>>>> openastronomy/main commands = !bake_cookies: pytest tests/ {posargs} bake_cookies: pytest tests/test_build_artifacts.py --cookie-location cookies From fe6814943ec99935ad021e7ac08f26fd87c94124 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 19 Aug 2025 16:12:18 +0100 Subject: [PATCH 261/265] Update pyproject.toml --- {{ cookiecutter.package_name }}/pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index efcdda2..5b856e3 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -33,18 +33,11 @@ open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.exampl {% endif -%} [project.optional-dependencies] -<<<<<<< HEAD tests = [ "pytest", "pytest-doctestplus", "pytest-cov", "pytest-xdist", -======= -test = [ - "pytest", - "pytest-doctestplus", - "pytest-cov", ->>>>>>> openastronomy/main ] docs = [ "sphinx", From 351c5e826cf4f04a241629f0c15345617847a682 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 23:54:51 +0000 Subject: [PATCH 262/265] Bump actions/checkout in the actions group across 1 directory Bumps the actions group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.3.0 to 5.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/08eba0b27e820071cde6df949e0beb9ba4906955...08c6903cd8c0fde910a37f88322edcfb5dd907a8) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/oa_update.yml | 2 +- .github/workflows/pre-commit-update.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oa_update.yml b/.github/workflows/oa_update.yml index 18cc8e5..246f2e2 100644 --- a/.github/workflows/oa_update.yml +++ b/.github/workflows/oa_update.yml @@ -21,7 +21,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/pre-commit-update.yaml b/.github/workflows/pre-commit-update.yaml index c451ad6..f76a0ed 100644 --- a/.github/workflows/pre-commit-update.yaml +++ b/.github/workflows/pre-commit-update.yaml @@ -21,7 +21,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 From e704335c0fa1aee328dfc11853f8ad8830b2b22f Mon Sep 17 00:00:00 2001 From: Cadair <1391051+Cadair@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:00:55 +0000 Subject: [PATCH 263/265] [create-pull-request] automated change --- {{ cookiecutter.package_name }}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml index 3605172..bc75e3d 100644 --- a/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +++ b/{{ cookiecutter.package_name }}/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.7" + rev: "v0.12.11" hooks: - id: ruff args: ["--fix"] @@ -11,7 +11,7 @@ repos: - id: isort exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-ast - id: check-case-conflict From 8937a626d4b276b7f7262b3b4cae08ac916046b2 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Tue, 2 Sep 2025 10:04:33 +0100 Subject: [PATCH 264/265] Bump checkout action --- .../.github/workflows/sub_package_update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 523cca3..3d34eac 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-python@v5 with: From 8968ca643ef98a916060caa0706fdf3e59bc50c4 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 2 Sep 2025 16:15:58 +0100 Subject: [PATCH 265/265] Update python versioning Removes python3.9 Adds python3.13 and 3.14 --- tox.ini | 2 +- .../.github/workflows/ci.yml | 10 +++++----- {{ cookiecutter.package_name }}/tox.ini | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index 275d11f..6cb36d4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{310,311,312}-test + py{310,311,312,313,314}-test bake_cookies build-docs diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 56cd667..bfa6c9d 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: - windows: py311 - macos: py312 - linux: py310-oldestdeps - - linux: py313-devdeps + - linux: py314-devdeps secrets: CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} @@ -99,10 +99,10 @@ jobs: test_command: 'pytest -p no:warnings --doctest-rst --pyargs {{ cookiecutter.module_name }}' submodules: false targets: | - - cp3{10,11,12,13}-manylinux*_x86_64 - - cp3{10,11,12,13}-macosx_x86_64 - - cp3{10,11,12,13}-macosx_arm64 - - cp3{10,11,12,13}-win_amd64 + - cp3{10,11,12,13,14}-manylinux*_x86_64 + - cp3{10,11,12,13,14}-macosx_x86_64 + - cp3{10,11,12,13,14}-macosx_arm64 + - cp3{10,11,12,13,14}-win_amd64 {%- else %} uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 with: diff --git a/{{ cookiecutter.package_name }}/tox.ini b/{{ cookiecutter.package_name }}/tox.ini index c1e2bc1..7a4ac72 100644 --- a/{{ cookiecutter.package_name }}/tox.ini +++ b/{{ cookiecutter.package_name }}/tox.ini @@ -3,7 +3,7 @@ min_version = 4.0 requires = tox-pypi-filter>=0.14 envlist = - py{310,311,312} + py{310,311,312,313,314} py312-devdeps py310-oldestdeps codestyle