Skip to content

Commit 17f7979

Browse files
github-actions[bot]nabobalisCadairpre-commit-ci[bot]
authored
Updates from the package template (#160)
Co-authored-by: nabobalis <[email protected]> Co-authored-by: Stuart Mumford <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b985048 commit 17f7979

File tree

4 files changed

+75
-59
lines changed

4 files changed

+75
-59
lines changed

.cruft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sunpy/package-template",
3-
"commit": "dd830771f0bb01d5313912e0082f3434715e474a",
3+
"commit": "7b0225e0a206b7b6249752991334dea7e9ffcfd4",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {

.ruff.toml

Lines changed: 27 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,38 @@
1-
# Allow unused variables when underscore-prefixed.
2-
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
31
target-version = "py310"
4-
line-length = 120
5-
extend-exclude=[
6-
"__pycache__",
7-
"build",
8-
"tools/**",
2+
line-length = 110
3+
exclude = [
4+
".git,",
5+
"__pycache__",
6+
"build",
7+
"sunpy_soar/version.py",
8+
"tools/**",
99
]
10-
lint.select = [
11-
"ALL",
12-
]
13-
lint.extend-ignore = [
14-
"ANN001", # Missing type annotation for function argument
15-
"ANN002", # Missing type annotation for variable
16-
"ANN003", # Missing type annotation for keyword
17-
"ANN201", # Missing return type annotation for public function
18-
"ANN202", # Missing return type annotation for private function
19-
"ANN205", # Missing return type annotation for staticmethod
20-
"ANN206", # Missing return type annotation for classmethod
21-
"COM812", # May cause conflicts when used with the formatter
22-
"C901", # Function exceeds acceptable complexity limits
23-
"D200", # One-line docstring should fit on one line
24-
"D205", # 1 blank line required between summary line and description
25-
"D400", # First line should end with a period
26-
"D401", # First line should be in imperative mood
27-
"D404", # First word of the docstring should not be "This"
28-
"ISC001", # May cause conflicts when used with the formatter
10+
11+
[lint]
12+
select = ["E", "F", "W", "UP", "PT"]
13+
extend-ignore = [
14+
# pycodestyle (E, W)
15+
"E501", # LineTooLong # TODO! fix
16+
# pytest (PT)
17+
"PT001", # Always use pytest.fixture()
18+
"PT004", # Fixtures which don't return anything should have leading _
19+
"PT007", # Parametrize should be lists of tuples # TODO! fix
20+
"PT011", # Too broad exception assert # TODO! fix
21+
"PT023", # Always use () on pytest decorators
2922
]
3023

3124
[lint.per-file-ignores]
32-
"examples/*.py" = [
33-
"B018", # Not print but display
34-
"D400", # First line should end with a period, question mark, or exclamation point
35-
"ERA001", # Commented out code
36-
"INP001", # Implicit namespace package
37-
"T201", # Use print
38-
]
25+
# Part of configuration, not a package.
26+
"setup.py" = ["INP001"]
27+
"conftest.py" = ["INP001"]
3928
"docs/conf.py" = [
40-
"D100", # Missing docstring in public module
41-
"INP001", # conf.py is part of an implicit namespace package
42-
]
43-
"setup.py" = [
44-
"D100", # Missing docstring in public module
45-
]
46-
"test_*.py" = [
47-
"D100", # Missing docstring in public module
48-
"D103", # Missing docstring in public function
49-
"N806", # in function should be lowercase
50-
"PLR2004", # Magic value used in comparison
51-
"S101", # Use of `assert` detected
52-
]
53-
"sunpy_soar/version.py" = [
54-
"D100", # Missing docstring in public module
29+
"E402" # Module imports not at top of file
5530
]
56-
"sunpy_soar/conftest.py" = [
57-
"D100", # Missing docstring in public module
31+
"docs/*.py" = [
32+
"INP001", # Implicit-namespace-package. The examples are not a package.
5833
]
34+
"__init__.py" = ["E402", "F401", "F403"]
35+
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]
5936

6037
[lint.pydocstyle]
6138
convention = "numpy"

docs/conf.py

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# full list see the documentation:
55
# http://www.sphinx-doc.org/en/master/config
66

7-
# -- Project information -----------------------------------------------------
87
import datetime
98
from pathlib import Path
109

@@ -31,6 +30,7 @@
3130
author = "The SunPy Community"
3231

3332
# -- General configuration ---------------------------------------------------
33+
3434
extensions = [
3535
"sphinx_gallery.gen_gallery",
3636
"matplotlib.sphinxext.plot_directive",
@@ -48,16 +48,27 @@
4848
"sphinx.ext.viewcode",
4949
"sphinx_copybutton",
5050
]
51+
52+
# Add any paths that contain templates here, relative to this directory.
53+
# templates_path = ["_templates"] # NOQA: ERA001
54+
55+
# List of patterns, relative to source directory, that match files and
56+
# directories to ignore when looking for source files.
57+
# This pattern also affects html_static_path and html_extra_path.
5158
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
59+
60+
# The suffix(es) of source filenames.
61+
# You can specify multiple suffix as a list of string:
5262
source_suffix = ".rst"
63+
64+
# The master toctree document.
5365
master_doc = "index"
54-
napoleon_use_rtype = False
55-
napoleon_google_docstring = False
5666

5767
# Treat everything in single ` as a Python reference.
5868
default_role = "py:obj"
5969

6070
# -- Options for intersphinx extension ---------------------------------------
71+
6172
intersphinx_mapping = {
6273
"python": (
6374
"https://docs.python.org/3/",
@@ -81,8 +92,14 @@
8192
}
8293

8394
# -- Options for HTML output -------------------------------------------------
95+
96+
# The theme to use for HTML and HTML Help pages. See the documentation for
97+
# a list of builtin themes.
8498
html_theme = "sunpy"
99+
100+
# Render inheritance diagrams in SVG
85101
graphviz_output_format = "svg"
102+
86103
graphviz_dot_args = [
87104
"-Nfontsize=10",
88105
"-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
@@ -92,10 +109,25 @@
92109
"-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
93110
]
94111

95-
# -- Options for sphinx-copybutton ---------------------------------------------
96-
# Python Repl + continuation, Bash, ipython and qtconsole + continuation, jupyter-console + continuation
97-
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
98-
copybutton_prompt_is_regexp = True
112+
# Add any paths that contain custom static files (such as style sheets) here,
113+
# relative to this directory. They are copied after the builtin static files,
114+
# so a file named "default.css" will overwrite the builtin "default.css".
115+
# html_static_path = ["_static"] # NOQA: ERA001
116+
117+
# By default, when rendering docstrings for classes, sphinx.ext.autodoc will
118+
# make docs with the class-level docstring and the class-method docstrings,
119+
# but not the __init__ docstring, which often contains the parameters to
120+
# class constructors across the scientific Python ecosystem. The option below
121+
# will append the __init__ docstring to the class-level docstring when rendering
122+
# the docs. For more options, see:
123+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
124+
autoclass_content = "both"
125+
126+
# -- Other options ----------------------------------------------------------
127+
128+
napoleon_use_rtype = False
129+
130+
napoleon_google_docstring = False
99131

100132
# Enable nitpicky mode, which forces links to be non-broken
101133
nitpicky = True
@@ -109,7 +141,14 @@
109141
target = target.strip()
110142
nitpick_ignore.append((dtype, target))
111143

144+
# -- Options for sphinx-copybutton ---------------------------------------------
145+
146+
# Python Repl + continuation, Bash, ipython and qtconsole + continuation, jupyter-console + continuation
147+
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
148+
copybutton_prompt_is_regexp = True
149+
112150
# -- Options for the Sphinx gallery -------------------------------------------
151+
113152
sphinx_gallery_conf = {
114153
"backreferences_dir": Path("generated") / "modules",
115154
"filename_pattern": "^((?!skip_).)*$",

sunpy_soar/_dev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
This subpackage contains utilities that are only used when developing muse in a
2+
This package contains utilities that are only used when developing in a
33
copy of the source repository.
44
55
These files are not installed, and should not be assumed to exist at

0 commit comments

Comments
 (0)