forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sagemath#303 from passagemath/sagemath-gfan
pkgs/sagemath-gfan: New
- Loading branch information
Showing
30 changed files
with
329 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/README.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sagelib/bootstrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(SAGE_ROOT)/pkgs/sagemath-gfan/pyproject.toml $(SAGE_ROOT)/pkgs/sagemath-gfan/MANIFEST.in gfan cysignals | $(PYTHON_TOOLCHAIN) sage_setup sage_conf sagemath_environment cython pkgconfig $(PYTHON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tox sagemath_modules sagemath_repl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/VERSION.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sagemath_objects/spkg-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cd src | ||
|
||
export PIP_NO_INDEX=true | ||
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" | ||
|
||
# Modularized install via wheels | ||
# --no-build-isolation so that declared build dependencies, | ||
# in particular sagemath-environment do not have to be present as wheels. | ||
sdh_pip_install --no-build-isolation . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Script to prepare an sdist tarball for sagemath-gfan | ||
# This script is not used during build. | ||
# | ||
# HOW TO MAKE THE TARBALL: | ||
# ./sage --sh build/pkgs/sagemath_gfan/spkg-src | ||
|
||
if [ -z "$SAGE_ROOT" ] ; then | ||
echo >&2 "Error - SAGE_ROOT undefined ... exiting" | ||
echo >&2 "Maybe run 'sage -sh'?" | ||
exit 1 | ||
fi | ||
|
||
# Exit on failure | ||
set -e | ||
|
||
cd build/pkgs/sagemath_gfan | ||
|
||
cd src | ||
# Get rid of old *.egg-info/SOURCES.txt | ||
rm -Rf *.egg-info | ||
|
||
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../pkgs/sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file is updated on every release by the sage-update-version script | ||
passagemath-gfan ~= 10.4.44.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
prune sage | ||
|
||
include VERSION.txt | ||
|
||
include sage/libs/gfan.p* | ||
include sage/rings/polynomial/groebner_fan.p* | ||
|
||
global-exclude *.c | ||
global-exclude *.cpp | ||
|
||
global-exclude all__sagemath_*.py | ||
global-include all__sagemath_gfan.py | ||
|
||
global-exclude __pycache__ | ||
global-exclude *.py[co] | ||
global-exclude *.bak | ||
global-exclude *.so | ||
global-exclude *~ | ||
prune .tox | ||
prune build | ||
prune dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
=========================================================== | ||
passagemath: Groebner fans and tropical varieties with gfan | ||
=========================================================== | ||
|
||
About SageMath | ||
-------------- | ||
|
||
"Creating a Viable Open Source Alternative to | ||
Magma, Maple, Mathematica, and MATLAB" | ||
|
||
Copyright (C) 2005-2024 The Sage Development Team | ||
|
||
https://www.sagemath.org | ||
|
||
SageMath fully supports all major Linux distributions, recent versions of | ||
macOS, and Windows (Windows Subsystem for Linux). | ||
|
||
See https://doc.sagemath.org/html/en/installation/index.html | ||
for general installation instructions. | ||
|
||
|
||
About this pip-installable distribution package | ||
----------------------------------------------- | ||
|
||
This pip-installable source distribution ``passagemath-gfan`` provides an interface to gfan. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../src/VERSION.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- | ||
[build-system] | ||
# Minimum requirements for the build system to execute. | ||
requires = [ | ||
SPKG_INSTALL_REQUIRES_setuptools | ||
SPKG_INSTALL_REQUIRES_pkgconfig | ||
SPKG_INSTALL_REQUIRES_sage_setup | ||
SPKG_INSTALL_REQUIRES_sagemath_environment | ||
SPKG_INSTALL_REQUIRES_cython | ||
SPKG_INSTALL_REQUIRES_cysignals | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "passagemath-gfan" | ||
description = "passagemath: Groebner fans and tropical varieties with gfan" | ||
dependencies = [ | ||
SPKG_INSTALL_REQUIRES_cysignals | ||
] | ||
dynamic = ["version"] | ||
include(`pyproject_toml_metadata.m4')dnl' | ||
|
||
[project.readme] | ||
file = "README.rst" | ||
content-type = "text/x-rst" | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
SPKG_INSTALL_REQUIRES_sagemath_modules | ||
SPKG_INSTALL_REQUIRES_sagemath_repl | ||
] | ||
|
||
[tool.cibuildwheel.linux] | ||
# Unfortunately CIBW_REPAIR_WHEEL_COMMAND does not expand {project} (and other placeholders), | ||
# so there is no clean way to refer to the repair_wheel.py script | ||
# https://github.com/pypa/cibuildwheel/issues/1931 | ||
repair-wheel-command = [ | ||
'python3 -m pip install passagemath-conf', | ||
'python3 pkgs/sagemath-gfan/repair_wheel.py {wheel}', | ||
'auditwheel repair -w {dest_dir} {wheel}', | ||
] | ||
[tool.cibuildwheel.macos] | ||
repair-wheel-command = [ | ||
'python3 -m pip install passagemath-conf', | ||
'python3 pkgs/sagemath-gfan/repair_wheel.py {wheel}', | ||
'delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}', | ||
] | ||
|
||
[tool.setuptools] | ||
include-package-data = false | ||
|
||
[tool.setuptools.dynamic] | ||
version = {file = ["VERSION.txt"]} | ||
|
||
[external] | ||
# External dependencies in the format proposed by https://peps.python.org/pep-0725 | ||
build-requires = [ | ||
"virtual:compiler/c", | ||
"virtual:compiler/cpp", | ||
"pkg:generic/pkg-config", | ||
] | ||
|
||
host-requires = [ | ||
"pkg:generic/gfan", | ||
"pkg:generic/gmp", | ||
"pkg:generic/mpc", | ||
"pkg:generic/mpfr", | ||
] | ||
|
||
dependencies = [ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add Maxima data to the wheel | ||
|
||
import os | ||
import shlex | ||
import sys | ||
|
||
from pathlib import Path | ||
|
||
from sage_conf import SAGE_LOCAL | ||
|
||
wheel = sys.argv[1] | ||
|
||
# SAGE_LOCAL/bin/gfan* --> sage_wheels/bin/gfan* | ||
command = f'ln -sf {shlex.quote(SAGE_LOCAL)} sage_wheels && zip -r {shlex.quote(wheel)} sage_wheels/bin/gfan*' | ||
print(f'Running {command}') | ||
sys.stdout.flush() | ||
os.system(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include(`sage_spkg_versions.m4')dnl | ||
dnl Same as setup.cfg.m4 install_requires; FIXME: should pin to built wheels. | ||
SPKG_INSTALL_REQUIRES_gmpy2 | ||
SPKG_INSTALL_REQUIRES_cysignals | ||
-e ../sagemath-objects | ||
-e ../sagemath-categories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cython==esyscmd(`printf $(sed "s/[.]p.*//;" ../cython/package-version.txt)') | ||
sagemath-standard==esyscmd(`printf $(sed "s/[.]p.*//;" ../sagelib/package-version.txt)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../src/sage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python | ||
|
||
# PEP 517 builds do not have . in sys.path | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.dirname(__file__)) | ||
|
||
from sage_setup import sage_setup | ||
|
||
sage_setup(['sagemath-gfan'], | ||
spkgs=['gfan']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# To build and test in the tox environment: | ||
# | ||
# ./sage -sh -c '(cd pkgs/sagemath-gfan && tox -v -v -v -e sagepython)' | ||
# | ||
# To test interactively: | ||
# | ||
# pkgs/sagemath-gfan/.tox/sagepython/bin/python | ||
# | ||
[tox] | ||
envlist = | ||
sagepython-sagewheels-nopypi-norequirements | ||
|
||
requires = | ||
# Auto-provision a modern tox. | ||
# [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance | ||
# Because of https://github.com/tox-dev/tox/issues/3238, need <4.14.1 | ||
tox>=4.2 | ||
tox<4.14.1 | ||
|
||
[pkgenv] | ||
# Environment in which to build the sdist. | ||
# https://tox.wiki/en/latest/upgrading.html#packaging-environments | ||
passenv = | ||
# Variables set by .homebrew-build-env | ||
CPATH | ||
LIBRARY_PATH | ||
PKG_CONFIG_PATH | ||
# Parallel build | ||
SAGE_NUM_THREADS | ||
SAGE_NUM_THREADS_PARALLEL | ||
MAKEFLAGS | ||
# SAGE_VENV only for referring to the basepython or finding the wheels | ||
sagepython, sagewheels: SAGE_VENV | ||
# Location of the wheels | ||
sagewheels: SAGE_SPKG_WHEELS | ||
|
||
setenv = | ||
# We supply pip options by environment variables so that they | ||
# apply both to the installation of the dependencies and of the package | ||
sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} | ||
nopypi: PIP_NO_INDEX=true | ||
|
||
[testenv] | ||
deps = | ||
!norequirements: -rrequirements.txt | ||
|
||
extras = test | ||
|
||
passenv = {[pkgenv]passenv} | ||
|
||
setenv = {[pkgenv]setenv} | ||
# Sage scripts such as sage-runtests like to use $HOME/.sage | ||
HOME={envdir} | ||
# Stop 'sage -t --installed' from picking up doc installed in SAGE_LOCAL | ||
SAGE_DOC=/doesnotexist | ||
KNOWN_TEST_FAILURES={toxinidir}/known-test-failures.json | ||
# See src/bin/sage-env | ||
PYDEVD_DISABLE_FILE_VALIDATION=1 | ||
|
||
allowlist_externals = | ||
bash | ||
|
||
commands = | ||
# Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. | ||
{envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all__sagemath_gfan; import sage.rings.polynomial.gfan' | ||
|
||
bash -c 'cd $(python -c "import sys; \"\" in sys.path and sys.path.remove(\"\"); from sage.env import SAGE_LIB; print(SAGE_LIB)") \ | ||
&& sage-runtests -p --force-lib --initial --environment=sage.all__sagemath_gfan --probe all --baseline-stats-path=$KNOWN_TEST_FAILURES --optional=sage sage/rings/polynomial/groebner_fan.py sage/interfaces/gfan.py' | ||
|
||
[testenv:.tox] | ||
# Allow access to PyPI for auto-provisioning a suitable tox version | ||
passenv = | ||
setenv = PIP_NO_INDEX=false | ||
|
||
[testenv:.pkg-sagepython] | ||
# Environment in which to build the sdist. | ||
# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
|
||
[testenv:.pkg-sagepython-sagewheels-nopypi] | ||
passenv = {[pkgenv]passenv} | ||
SAGE_VENV | ||
SAGE_SPKG_WHEELS | ||
|
||
setenv = {[pkgenv]setenv} | ||
PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} | ||
PIP_NO_INDEX=true | ||
|
||
basepython = {env:SAGE_VENV}/bin/python3 | ||
|
||
[testenv:.pkg-sagepython-sagewheels-nopypi-editable] | ||
config_settings_build_editable = | ||
editable_mode = strict | ||
|
||
|
||
[testenv:sagepython] | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
package_env = .pkg-sagepython | ||
|
||
[testenv:sagepython-sagewheels-nopypi] | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
package_env = .pkg-sagepython-sagewheels-nopypi | ||
|
||
[testenv:sagepython-sagewheels] | ||
basepython = {env:SAGE_VENV}/bin/python | ||
package_env = .pkg-sagepython | ||
|
||
[testenv:sagepython-norequirements] | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
package_env = .pkg-sagepython | ||
|
||
|
||
[testenv:sagepython-sagewheels-nopypi-norequirements] | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
package_env = .pkg-sagepython-sagewheels-nopypi | ||
|
||
[testenv:sagepython-sagewheels-nopypi-editable] | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
package_env = .pkg-sagepython-sagewheels-nopypi-editable | ||
package = editable | ||
deps = -r requirements-editable.txt | ||
config_settings_build_editable = | ||
editable_mode = strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sage_setup: distribution = sagemath-gfan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# sage_setup: distribution = sagemath-polyhedra | ||
# sage_setup: distribution = sagemath-gfan | ||
r""" | ||
Groebner Fans | ||
|