Skip to content
Open
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
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ dev = [
"sphinx>=7,<8",
]

[project.optional-dependencies]
passagemath = [
"passagemath-graphs",
"passagemath-polyhedra",
"passagemath-singular",
"passagemath-symbolics",
"passagemath-repl",
]
macaulay2 = [
"passagemath-macaulay2",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
8 changes: 5 additions & 3 deletions sage_acsv/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from enum import Enum

from sage.interfaces.macaulay2 import Macaulay2

from sage_acsv.debug import acsv_logger


Expand Down Expand Up @@ -100,7 +98,7 @@ class ACSVSettings:
_default_output_format = DEFAULT_OUTPUT_FORMAT
_default_kronecker_backend = DEFAULT_KRONECKER_BACKEND
_default_groebner_backend = DEFAULT_GROEBNER_BACKEND
_m2 = Macaulay2()
_m2 = None

MAX_MIN_CRIT_RETRIES = 5 # Maximum number of retries for critical point detection

Expand Down Expand Up @@ -212,9 +210,13 @@ def set_macaulay2_path(cls, path: str | None) -> None:

* ``path`` -- a filepath string or `None` to run from anywhere
"""
from sage.interfaces.macaulay2 import Macaulay2
cls._m2 = Macaulay2(command=path)

@classmethod
def get_macaulay2(cls) -> KroneckerBackend:
"""Get the Macaulay2 installation path."""
if cls._m2 is None:
from sage.interfaces.macaulay2 import Macaulay2
_m2 = Macaulay2()
return cls._m2
17 changes: 17 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tox]
envlist = passagemath

[testenv:passagemath]
usedevelop = True

extras = passagemath

allowlist_externals =
bash

passenv =
HOME
GITHUB_ACTIONS

commands =
bash -c "PYTHONPATH={toxinidir} sage -t -p --force-lib $([ -n \"$GITHUB_ACTIONS\" ] && echo \"--format github\") --environment=sage.all__sagemath_symbolics --optional=sage sage_acsv/"