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

update with the sunpy template #397

Merged
merged 5 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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": "6d6729b22066ef890e70c37438da70cac33e03b4",
"commit": "c79fc5bff74958e24c9a925a330b8d3aa138f4ce",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +37,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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ instance/
docs/_build/
# automodapi
docs/api
docs/sg_execution_times.rst

# PyBuilder
.pybuilder/
Expand Down
6 changes: 3 additions & 3 deletions .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.3.5"
rev: "v0.4.8"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -26,10 +26,10 @@ repos:
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.asdf|.json|.hdr)$"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: [ "--write-changes", "-D", "-", "-D", ".codespell-dict.txt"]
ci:
autofix_prs: false
autoupdate_schedule: "weekly"
autoupdate_schedule: "quarterly"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ tests = [
"pytest-doctestplus",
"pytest-cov",
"pytest-remotedata",
"pytest-cov",
"pytest-mock",
"pytest-mpl",
"pytest-httpserver",
Expand Down Expand Up @@ -85,6 +84,7 @@ zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
exclude = ["dkist._dev*"]

[tool.setuptools_scm]
write_to = "dkist/_version.py"
Expand Down
18 changes: 12 additions & 6 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ norecursedirs =
.history
dkist/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
markers =
online: marks this test function as needing online connectivity.
figure: marks this test function as using hash-based Matplotlib figure verification. This mark is not meant to be directly applied, but is instead automatically applied when a test function uses the @sunpy.tests.helpers.figure_test decorator.
benchmark: marks this test as a benchmark
# Disable internet access for tests not marked remote_data
remote_data_strict = True
asdf_schema_root = dkist/io/asdf/resources/
asdf_schema_tests_enabled = true
markers =
online: marks this test function as needing online connectivity.
figure: marks this test function as using hash-based Matplotlib figure verification. This mark is not meant to be directly applied, but is instead automatically applied when a test function uses the @sunpy.tests.helpers.figure_test decorator.
benchmark: marks this test as a benchmark
addopts =
--doctest-rst
-p no:unraisableexception
-p no:threadexception
filterwarnings =
# Turn all warnings into errors so they do not pass silently.
error
Expand Down
45 changes: 27 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ envlist =
py{310,311,312}
py312-devdeps
py310-oldestdeps
py312-benchmarks
build_docs{,-notebooks}
codestyle
benchmarks

[testenv]
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt
Expand All @@ -34,8 +34,6 @@ set_env =
MPLBACKEND = agg
COLUMNS = 180
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 dkist --cov-report=xml --cov=dkist --cov-config={toxinidir}/.coveragerc {toxinidir}/docs --benchmark-skip
deps =
# For packages which publish nightly wheels this will pull the latest nightly
devdeps: astropy>=0.0.dev0
Expand All @@ -57,15 +55,22 @@ commands_pre =
oldestdeps: pip install -r requirements-min.txt cryptography<42 jsonschema==4.0.1
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}
{env:PYTEST_COMMAND} \
# 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:
pytest \
-vvv \
-r fEs \
--pyargs dkist \
--cov-report=xml \
--cov=dkist \
--cov-config={toxinidir}/.coveragerc \
{toxinidir}/docs \
online: --remote-data=any \
# It's not possible to test the new schemas with the oldest dependencies
# as the new schemas require new dependent schemas
oldestdeps: -o asdf_schema_tests_enabled=false
!benchmarks: --benchmark-skip \
benchmarks: -m benchmark \
benchmarks: --benchmark-autosave \
oldestdeps: -o asdf_schema_tests_enabled=false \
{posargs}

[testenv:codestyle]
Expand All @@ -87,11 +92,15 @@ extras =
commands =
pip freeze --all --no-input
# Disable parallel here due to https://github.com/astropy/astropy/issues/14916
!notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html -D nb_execution_mode=off {posargs}
notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
sphinx-build \
-j 1 \
--color \
-W \
--keep-going \
-b html \
-d _build/.doctrees \
. \
_build/html \
!notebooks: -D nb_execution_mode=off \
{posargs} \
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'

[testenv:benchmarks]
description = Run benchmarks on PR and compare against main to ensure there are no performance regressions
allowlist_externals=git
commands = {env:PYTEST_COMMAND} -m benchmark --benchmark-autosave
Loading