Skip to content

Commit

Permalink
Merge pull request #33 from Cadair/template_update
Browse files Browse the repository at this point in the history
Template update
  • Loading branch information
Cadair committed Apr 30, 2024
2 parents 8630ffb + e988e05 commit 8dba6ba
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 30 deletions.
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": "3a8054de27a4af460d7cb737b2b1ec2621456e5f",
"commit": "7ba209cccc9fd84d78d5b4c3c4f8f19f39ff5e8c",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

publish_pure:
needs: [test, docs]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main
with:
python-version: '3.10'
test_extras: 'tests'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_magex'
submodules: false
secrets:
pypi_token: ${{ secrets.pypi_token }}
needs: [test, docs]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main
with:
python-version: '3.10'
test_extras: 'tests'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_magex'
submodules: false
secrets:
pypi_token: ${{ secrets.pypi_token }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ docs/_build/
docs/generated/
# automodapi
docs/api
docs/sg_execution_times.rst

# PyBuilder
.pybuilder/
Expand Down
4 changes: 2 additions & 2 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.1"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -11,7 +11,7 @@ repos:
- id: isort
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|sunkit_magex/extern)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand Down
4 changes: 3 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ extend-ignore = [
# Part of configuration, not a package.
"setup.py" = ["INP001"]
"conftest.py" = ["INP001"]
"docs/conf.py" = [
"E402" # Module imports not at top of file
]
"docs/*.py" = [
"INP001", # Implicit-namespace-package. The examples are not a package.
"E402", # Module imports not at top of file
]
"__init__.py" = ["E402", "F401", "F403"]
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tests = [
"pytest",
"pytest-doctestplus",
"pytest-cov",
"pytest-xdist",
"parfive",
"reproject",
"streamtracer",
Expand Down Expand Up @@ -66,6 +67,7 @@ zip-safe = false
include-package-data = true

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

[tool.setuptools_scm]
write_to = "sunkit_magex/_version.py"
10 changes: 8 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ norecursedirs =
.history
sunkit_magex/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
addopts =
--doctest-rst
-p no:unraisableexception
-p no:threadexception
filterwarnings =
# Turn all warnings into errors so they do not pass silently.
error
Expand Down
27 changes: 12 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ description =
run tests
oldestdeps: with the oldest supported version of key dependencies
devdeps: with the latest developer version of key dependencies

pass_env =
# A variable to tell tests we are on a CI system
CI
Expand All @@ -29,37 +28,35 @@ pass_env =
LOCALE_ARCHIVE
# If the user has set a LC override we should follow it
LC_ALL

set_env =
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

deps =
# For packages which publish nightly wheels this will pull the latest nightly
devdeps: numpy>=0.0.dev0
# Packages without nightly wheels will be built from source like this
# devdeps: git+https://github.com/ndcube/ndcube
oldestdeps: minimum_dependencies
pytest-xdist

# The following indicates which extras_require will be installed
extras =
tests

commands_pre =
oldestdeps: minimum_dependencies sunkit_magex --filename requirements-min.txt
oldestdeps: pip install -r requirements-min.txt
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}
# 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:
{env:PYTEST_COMMAND} {posargs}
pytest \
-vvv \
-r fEs \
--pyargs sunkit_magex \
--cov-report=xml \
--cov=sunkit_magex \
--cov-config={toxinidir}/.coveragerc \
{toxinidir}/docs \
{posargs}

[testenv:codestyle]
pypi_filter =
Expand All @@ -78,4 +75,4 @@ change_dir =
extras =
docs
commands =
sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
sphinx-build --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}

0 comments on commit 8dba6ba

Please sign in to comment.