Skip to content

Commit

Permalink
Merge pull request #18 from sunpy/cruft/update-1710140757
Browse files Browse the repository at this point in the history
Updates from the package template
  • Loading branch information
Cadair committed Mar 19, 2024
2 parents 91f8297 + 0f1520a commit 0d823ba
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 70 deletions.
11 changes: 11 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment: off
coverage:
status:
project:
default:
threshold: 0.2%

codecov:
require_ci_to_pass: false
notify:
wait_for_ci: true
30 changes: 30 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[run]
omit =
sunkit_magex/conftest.py
sunkit_magex/*setup_package*
sunkit_magex/extern/*
sunkit_magex/version*
*/sunkit_magex/conftest.py
*/sunkit_magex/*setup_package*
*/sunkit_magex/extern/*
*/sunkit_magex/version*

[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
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": "49aadf8c3ce076e4c42edf6e8079855dd8a42aa4",
"commit": "8d590fba25722f382d4fb5554fa52dfec65952c9",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
13 changes: 11 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# http://www.sphinx-doc.org/en/master/config

import os

import datetime
# -- Project information -----------------------------------------------------

# The full version, including alpha/beta/rc tags
from sunkit_magex import __version__

release = __version__
project = "sunkit-magex"
copyright = "2024, The SunPy Community"
copyright = str(datetime.datetime.now().year) + " , The SunPy Community" # noqa: A001
author = "The SunPy Community"

# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -70,6 +70,15 @@

html_theme = "sunpy"

# By default, when rendering docstrings for classes, sphinx.ext.autodoc will
# make docs with the class-level docstring and the class-method docstrings,
# but not the __init__ docstring, which often contains the parameters to
# class constructors across the scientific Python ecosystem. The option below
# will append the __init__ docstring to the class-level docstring when rendering
# the docs. For more options, see:
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
autoclass_content = "both"

# -- Sphinx Gallery ----------------------------------------------------------

from sunpy_sphinx_theme import PNG_ICON # noqa
Expand Down
65 changes: 0 additions & 65 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,68 +69,3 @@ include-package-data = true

[tool.setuptools_scm]
write_to = "sunkit_magex/_version.py"

[tool.pytest.ini_options]
testpaths = [
"sunkit_magex",
"docs",
]
doctest_plus = "enabled"
text_file_format = "rst"
addopts = "--doctest-rst -p no:unraisableexception -p no:threadexception"
filterwarnings = [
"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
# Ignore harmless numpy verison warning
"ignore:numpy.ndarray size changed, may indicate binary incompatibility:RuntimeWarning",
# This seems to be a transitive faliure we should investigate
"ignore:unclosed event loop:ResourceWarning",
# https://github.com/pytest-dev/pytest-cov/issues/557
# It was fixed and released but it does not seem to be fixed
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning",
# https://github.com/pandas-dev/pandas/issues/54466
# Should stop when pandas 3.0.0 is released
"ignore:(?s).*Pyarrow will become a required dependency of pandas:DeprecationWarning",
# Can be removed when https://github.com/dateutil/dateutil/issues/1314 is resolved
# deprecated in Python 3.12, needs a release of dateutil 2.8.3 or higher
"ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning",
]

[tool.coverage.run]
omit = [
"sunkit_magex/__init*",
"sunkit_magex/conftest.py",
"sunkit_magex/*setup_package*",
"sunkit_magex/tests/*",
"sunkit_magex/*/tests/*",
"sunkit_magex/extern/*",
"sunkit_magex/version*",
"*/sunkit_magex/__init*",
"*/sunkit_magex/conftest.py",
"*/sunkit_magex/*setup_package*",
"*/sunkit_magex/tests/*",
"*/sunkit_magex/*/tests/*",
"*/sunkit_magex/extern/*",
"*/sunkit_magex/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_",
]
39 changes: 39 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[pytest]
minversion = 7.0
testpaths =
sunkit_magex
docs
norecursedirs =
.tox
build
docs/_build
docs/generated
*.egg-info
examples
sunkit_magex/_dev
.history
sunkit_magex/extern
doctest_plus = enabled
doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS
text_file_format = rst
addopts = --doctest-rst -p no:unraisableexception -p no:threadexception
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
ignore:numpy.ndarray size changed, may indicate binary incompatibility:RuntimeWarning
# This seems to be a transitive faliure we should investigate
ignore:unclosed event loop:ResourceWarning
# https://github.com/pytest-dev/pytest-cov/issues/557
# It was fixed and released but it does not seem to be fixed
ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning
# https://github.com/pandas-dev/pandas/issues/54466
# Should stop when pandas 3.0.0 is released
ignore:(?s).*Pyarrow will become a required dependency of pandas:DeprecationWarning
# Can be removed when https://github.com/dateutil/dateutil/issues/1314 is resolved
# deprecated in Python 3.12, needs a release of dateutil 2.8.3 or higher
ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning
1 change: 0 additions & 1 deletion sunkit_magex/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains package tests.
"""
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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}
Expand All @@ -20,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)
Expand All @@ -28,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 sunkit_magex --cov-report=xml --cov=sunkit_magex --cov-config={toxinidir}/pyproject.toml {toxinidir}/docs
Expand Down

0 comments on commit 0d823ba

Please sign in to comment.