Skip to content

Commit

Permalink
More comments from the ndcube work (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Apr 30, 2024
2 parents 1eff2ed + 4acdefb commit 0201d30
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions {{ cookiecutter.package_name }}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ instance/
docs/_build/
# automodapi
docs/api
docs/sg_execution_times.rst

# PyBuilder
.pybuilder/
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.package_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
{% if cookiecutter.enable_dynamic_dev_versions == 'y' -%}
{%- if cookiecutter.enable_dynamic_dev_versions == 'y' %}
exclude = ["{{ cookiecutter.module_name }}._dev*"]
{%- endif %}

Expand Down
10 changes: 8 additions & 2 deletions {{ cookiecutter.package_name }}/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ norecursedirs =
.history
{{ cookiecutter.module_name }}/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
26 changes: 11 additions & 15 deletions {{ cookiecutter.package_name }}/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ 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}
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 @@ -30,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 {{ cookiecutter.module_name }} --cov-report=xml --cov={{ cookiecutter.module_name }} --cov-config={toxinidir}/.coveragerc {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-cov

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

commands_pre =
oldestdeps: minimum_dependencies {{ cookiecutter.module_name }} --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 {{ cookiecutter.module_name }} \
--cov-report=xml \
--cov={{ cookiecutter.module_name }} \
--cov-config={toxinidir}/.coveragerc \
{toxinidir}/docs \
{posargs}

[testenv:codestyle]
pypi_filter =
Expand Down

0 comments on commit 0201d30

Please sign in to comment.