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

Fix tox with C-extension #310

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ testpaths = "synphot" "docs"
norecursedirs = build docs/_build synphot/src
astropy_header = true
doctest_plus = enabled
doctest_rst = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, why this addition, is addopts = --doctest-rst not enough?

text_file_format = rst
addopts = --doctest-rst --doctest-ignore-import-errors
addopts = --import-mode append
xfail_strict = true
filterwarnings =
ignore:can't resolve package from __spec__
Expand Down
14 changes: 6 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ isolated_build = true
# Pass through the following environemnt variables which are needed for the CI
passenv = HOME WINDIR CC CI

# FIXME: Cannot do this, need to force C-ext to build below.
# Run the tests in a temporary directory to make sure that we don't import
# package from the source tree
#changedir = .tmp/{envname}
changedir = .tmp/{envname}

# tox environments are constructued with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
Expand Down Expand Up @@ -53,13 +52,12 @@ extras =
alldeps: all

commands =
# FIXME: Not sure why need this for tox to see the C-ext
python setup.py build_ext --inplace
# End of FIXME
pip freeze
!cov: pytest --pyargs synphot {toxinidir}/docs {posargs}
cov: pytest --pyargs synphot {toxinidir}/docs --cov synphot --cov-config={toxinidir}/setup.cfg {posargs}
cov: coverage xml -o {toxinidir}/coverage.xml
# FIXME: Seems like using -c option with multiline Pytest is broken: see
# https://github.com/tox-dev/tox-travis/issues/146
# at the very least on CI - it runs fine locally on MacOSX.
!cov: pytest -c {toxinidir}/setup.cfg --pyargs synphot --rootdir={toxinidir} {posargs}
cov: pytest -c {toxinidir}/setup.cfg --pyargs synphot --rootdir={toxinidir} {posargs} --cov={envsitepackagesdir}/synphot --cov-config={toxinidir}/setup.cfg --cov-report xml:{toxinidir}/coverage.xml

[testenv:codestyle]
skip_install = true
Expand Down