Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from the package template #237

Merged
merged 6 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 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": "dd830771f0bb01d5313912e0082f3434715e474a",
"commit": "7b0225e0a206b7b6249752991334dea7e9ffcfd4",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
27 changes: 6 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
repos:
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: ["--in-place", "--pre-summary-newline", "--make-summary-multi"]
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
[
"--in-place",
"--remove-all-unused-imports",
"--remove-unused-variable",
]
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.9"
hooks:
Expand All @@ -31,11 +15,7 @@ repos:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
exclude: ".*(.fits|.fts|.fit|.txt|.header|.csv)$"
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
- id: end-of-file-fixer
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
exclude: ".*(.fits|.fts|.fit|.header|.txt)$"
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
Expand All @@ -45,6 +25,11 @@ repos:
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.3.0
hooks:
- id: codespell
args: [ "--write-changes" ]
- repo: https://github.com/crate-ci/typos
rev: v1.23.1
hooks:
Expand Down
114 changes: 56 additions & 58 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,8 @@
author = "The SunPy Community"
copyright = f"{datetime.datetime.now(datetime.UTC).year}, {author}" # NOQA: A001

# We want to make sure all the following warnings fail the build
warnings.filterwarnings("error", category=SunpyDeprecationWarning)
warnings.filterwarnings("error", category=SunpyPendingDeprecationWarning)
warnings.filterwarnings("error", category=MatplotlibDeprecationWarning)
warnings.filterwarnings("error", category=AstropyDeprecationWarning)

# For the linkcheck
linkcheck_ignore = [
r"https://doi.org/\d+",
r"https://element.io/\d+",
r"https://github.com/\d+",
r"https://docs.sunpy.org/\d+",
]
linkcheck_anchors = False

# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
rst_epilog = """
.. SunPy
.. _SunPy: https://sunpy.org
.. _`SunPy mailing list`: https://groups.google.com/group/sunpy
.. _`SunPy dev mailing list`: https://groups.google.com/group/sunpy-dev
"""

# -- General configuration -----------------------------------------------------
suppress_warnings = [
"app.add_directive",
]

extensions = [
"matplotlib.sphinxext.plot_directive",
"sphinx_automodapi.automodapi",
Expand Down Expand Up @@ -109,25 +83,6 @@
# Treat everything in single ` as a Python reference.
default_role = "py:obj"

html_extra_path = ["robots.txt"]

napoleon_use_rtype = False

napoleon_google_docstring = False

# Enable nitpicky mode, which forces links to be non-broken
nitpicky = True

# This is not used. See docs/nitpick-exceptions file for the actual listing.
nitpick_ignore = []
with Path("nitpick-exceptions").open() as f:
for line in f.readlines():
if line.strip() == "" or line.startswith("#"):
continue
dtype, target = line.split(None, 1)
target = target.strip()
nitpick_ignore.append((dtype, target))

# -- Options for intersphinx extension ---------------------------------------

intersphinx_mapping = {
Expand Down Expand Up @@ -157,6 +112,18 @@
# a list of builtin themes.
html_theme = "sunpy"

# 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".
Expand All @@ -171,19 +138,52 @@
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
autoclass_content = "both"

# -- Graphviz Output ------------------------------------------------------------
# -- Other options ----------------------------------------------------------

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",
html_extra_path = ["robots.txt"]

napoleon_use_rtype = False

napoleon_google_docstring = False

# Enable nitpicky mode, which forces links to be non-broken
nitpicky = True

# This is not used. See docs/nitpick-exceptions file for the actual listing.
nitpick_ignore = []
with Path("nitpick-exceptions").open() as f:
for line in f.readlines():
if line.strip() == "" or line.startswith("#"):
continue
dtype, target = line.split(None, 1)
target = target.strip()
nitpick_ignore.append((dtype, target))

# We want to make sure all the following warnings fail the build
warnings.filterwarnings("error", category=SunpyDeprecationWarning)
warnings.filterwarnings("error", category=SunpyPendingDeprecationWarning)
warnings.filterwarnings("error", category=MatplotlibDeprecationWarning)
warnings.filterwarnings("error", category=AstropyDeprecationWarning)

# For the linkcheck
linkcheck_ignore = [
r"https://doi.org/\d+",
r"https://element.io/\d+",
r"https://github.com/\d+",
r"https://docs.sunpy.org/\d+",
]
linkcheck_anchors = False

# -- Options for the Sphinx gallery -------------------------------------------
# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
rst_epilog = """
.. SunPy
.. _SunPy: https://sunpy.org
.. _`SunPy mailing list`: https://groups.google.com/group/sunpy
.. _`SunPy dev mailing list`: https://groups.google.com/group/sunpy-dev
"""

# -- Options for the Sphinx gallery -----------------------------------------

path = pathlib.Path.cwd()
example_dir = path.parent.joinpath("examples")
Expand All @@ -198,5 +198,3 @@
"remove_config_comments": True,
"only_warn_on_example_error": True,
}

# -- Other options ----------------------------------------------------------
5 changes: 2 additions & 3 deletions sunkit_image/_dev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
This package contains utilities that are only used when developing sunkit-image
in a copy of the source repository.

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.
"""
Loading