Skip to content

Commit

Permalink
tox.ini: New, replace 'setup.py test'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Nov 4, 2024
1 parent b771c06 commit 6dec513
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Mathematics",
]
dynamic = ['version']

[project.optional-dependencies]
doc = [
"sage-package",
"sphinx",
"sphinxcontrib-bibtex",
]
passagemath = [
"passagemath-polyhedra",
"passagemath-plot",
"passagemath-repl",
"passagemath-flint",
]

[project.readme]
file = "README.rst"
Expand Down
8 changes: 0 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ def readfile(filename):
with open(filename, encoding='utf-8') as f:
return f.read()

# For the tests
class SageTest(TestCommand):
def run_tests(self):
errno = os.system("make check")
if errno != 0:
sys.exit(1)

setup(
packages = ['cutgeneratingfunctionology', 'cutgeneratingfunctionology.igp', 'cutgeneratingfunctionology.multirow', 'cutgeneratingfunctionology.dff', 'cutgeneratingfunctionology.spam', 'cutgeneratingfunctionology.igp.subadditivity_slack_diagrams', 'cutgeneratingfunctionology.igp.procedures'],
include_package_data=True, # to install the .sage files too
cmdclass = {'test': SageTest}, # adding a special setup command for tests
)
30 changes: 30 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tox]
envlist = passagemath, docs

[testenv:passagemath]
usedevelop = True
extras = passagemath

allowlist_externals =
bash

passenv =
HOME
GITHUB_ACTIONS

# We test with the top level sage.all__sagemath_modules (not ...polyhedra)
# to enforce use of 'from sage_numerical_interactive_mip import *' in all doctests.
commands =
bash -c "make check"

[testenv:docs]
allowlist_externals =
bash
sage
passenv =
SAGE_ROOT
SAGE_LOCAL
HOME
extras = doc
commands=
sage -sh -c 'sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html'

0 comments on commit 6dec513

Please sign in to comment.