Skip to content

Commit 6dec513

Browse files
committed
tox.ini: New, replace 'setup.py test'
1 parent b771c06 commit 6dec513

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ classifiers = [
3131
"Programming Language :: Python :: 3.12",
3232
"Topic :: Scientific/Engineering :: Mathematics",
3333
]
34+
dynamic = ['version']
3435

3536
[project.optional-dependencies]
3637
doc = [
3738
"sage-package",
3839
"sphinx",
3940
"sphinxcontrib-bibtex",
4041
]
42+
passagemath = [
43+
"passagemath-polyhedra",
44+
"passagemath-plot",
45+
"passagemath-repl",
46+
"passagemath-flint",
47+
]
4148

4249
[project.readme]
4350
file = "README.rst"

setup.py

-8
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ def readfile(filename):
1111
with open(filename, encoding='utf-8') as f:
1212
return f.read()
1313

14-
# For the tests
15-
class SageTest(TestCommand):
16-
def run_tests(self):
17-
errno = os.system("make check")
18-
if errno != 0:
19-
sys.exit(1)
20-
2114
setup(
2215
packages = ['cutgeneratingfunctionology', 'cutgeneratingfunctionology.igp', 'cutgeneratingfunctionology.multirow', 'cutgeneratingfunctionology.dff', 'cutgeneratingfunctionology.spam', 'cutgeneratingfunctionology.igp.subadditivity_slack_diagrams', 'cutgeneratingfunctionology.igp.procedures'],
2316
include_package_data=True, # to install the .sage files too
24-
cmdclass = {'test': SageTest}, # adding a special setup command for tests
2517
)

tox.ini

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[tox]
2+
envlist = passagemath, docs
3+
4+
[testenv:passagemath]
5+
usedevelop = True
6+
extras = passagemath
7+
8+
allowlist_externals =
9+
bash
10+
11+
passenv =
12+
HOME
13+
GITHUB_ACTIONS
14+
15+
# We test with the top level sage.all__sagemath_modules (not ...polyhedra)
16+
# to enforce use of 'from sage_numerical_interactive_mip import *' in all doctests.
17+
commands =
18+
bash -c "make check"
19+
20+
[testenv:docs]
21+
allowlist_externals =
22+
bash
23+
sage
24+
passenv =
25+
SAGE_ROOT
26+
SAGE_LOCAL
27+
HOME
28+
extras = doc
29+
commands=
30+
sage -sh -c 'sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html'

0 commit comments

Comments
 (0)