Skip to content

Commit

Permalink
Updates from package template (#164)
Browse files Browse the repository at this point in the history
Co-authored-by: Nabil Freij <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 7, 2024
1 parent bb510d4 commit b5c8d10
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 66 deletions.
8 changes: 7 additions & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sunpy/package-template",
"commit": "4ca8e60aac805d5f736de80c45ae0aba96b4cb85",
"commit": "3737aa309d2a695ada046c7868c5683213003f3d",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -10,6 +10,12 @@
"author_name": "The SunPy Community",
"author_email": "[email protected]",
"project_url": "https://sunpy.org",
"github_repo": "",
"sourcecode_url": "",
"download_url": "https://pypi.org/project/sunpy-soar",
"documentation_url": "",
"changelog_url": "",
"issue_tracker_url": "",
"license": "BSD 2-Clause",
"minimum_python_version": "3.10",
"use_compiled_extensions": "n",
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Main CI Workflow
name: CI

on:
Expand All @@ -21,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
Expand All @@ -46,7 +47,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
Expand All @@ -61,7 +62,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: '3.12'
submodules: false
Expand All @@ -84,7 +85,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: '3.12'
submodules: false
Expand All @@ -105,7 +106,7 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'Run publish')
)
needs: [test, docs]
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: '3.12'
test_extras: 'tests'
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/label_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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

# Give permissions to write issue labels
permissions:
issues: write

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/main/labels.yml
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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.8.1"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
extensions = [
"sphinx_gallery.gen_gallery",
"matplotlib.sphinxext.plot_directive",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
"sphinx_changelog",
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.inheritance_diagram",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx.ext.mathjax",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
"sphinx_changelog",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ This will walk you through getting set up for contributing.
generated/gallery/index
how_to/index
api
changelog
whatsnew/index
coc
6 changes: 4 additions & 2 deletions docs/changelog.rst → docs/whatsnew/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.. _changelog:

**************
Full Changelog
**************

.. changelog::
:towncrier: ../
:towncrier: ../../
:towncrier-skip-if-empty:
:changelog_file: ../CHANGELOG.rst
:changelog_file: ../../CHANGELOG.rst
12 changes: 12 additions & 0 deletions docs/whatsnew/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _whatsnew:

***************
Release History
***************

This page documents the releases for sunpy-soar

.. toctree::
:maxdepth: 1

changelog
112 changes: 63 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ dependencies = [
]
dynamic = ["version"]

[project.urls]
Homepage = "https://sunpy.org"
Download = "https://pypi.org/project/sunpy-soar/"
"Source Code" = "https://github.com/sunpy/sunpy-soar/"
Documentation = "https://docs.sunpy.org/projects/soar/"
Changelog = "https://docs.sunpy.org/projects/soar/changelog.html"
"Issue Tracker" = "https://github.com/sunpy/sunpy-soar/issues"

[project.optional-dependencies]
tests = [
"pytest-cov",
Expand All @@ -36,7 +44,6 @@ tests = [
docs = [
"sphinx",
"sphinx-automodapi",
"packaging",
"matplotlib",
"sphinx-changelog",
"sphinx-copybutton",
Expand All @@ -45,14 +52,6 @@ docs = [
"sunpy-sphinx-theme",
]

[project.urls]
Homepage = "https://sunpy.org"
Download = "https://pypi.org/project/sunpy-soar/"
"Source Code" = "https://github.com/sunpy/sunpy-soar/"
Documentation = "https://docs.sunpy.org/projects/soar/"
Changelog = "https://docs.sunpy.org/projects/soar/changelog.html"
"Issue Tracker" = "https://github.com/sunpy/sunpy-soar/issues"

[tool.setuptools]
zip-safe = false
include-package-data = true
Expand All @@ -64,44 +63,59 @@ exclude = ["sunpy_soar._dev*"]
[tool.setuptools_scm]
write_to = "sunpy_soar/_version.py"

[tool.gilesbot]
[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-soar/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//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//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 = "sunpy_soar"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/sunpy/sunpy-soar/pull/{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
package = "sunpy_soar"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/sunpy/sunpy-soar/pull/{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
2 changes: 1 addition & 1 deletion sunpy_soar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

from .version import version as __version__

__all__ = ["__version__", "SOARClient"]
__all__ = ["SOARClient", "__version__"]
2 changes: 1 addition & 1 deletion sunpy_soar/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SimpleAttr)
from sunpy.util.exceptions import SunpyUserWarning

__all__ = ["Product", "SOOP", "Distance"]
__all__ = ["SOOP", "Distance", "Product"]


class Product(SimpleAttr):
Expand Down

0 comments on commit b5c8d10

Please sign in to comment.