Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
pkgs/sagemath-gap, build/pkgs/sagemath_gap: New
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Nov 17, 2022
1 parent 3181bb0 commit 52b208b
Show file tree
Hide file tree
Showing 21 changed files with 277 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/SPKG.rst
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/bootstrap
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(PYTHON) sagelib gap | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sagemath-gap
2 changes: 2 additions & 0 deletions build/pkgs/sagemath_gap/install-requires.txt
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
sagemath-gap
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/package-version.txt
29 changes: 29 additions & 0 deletions build/pkgs/sagemath_gap/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# From sage-spkg.
# For type=script packages, the build rule in build/make/Makefile sources
# sage-env but not sage-dist-helpers.
lib="$SAGE_ROOT/build/bin/sage-dist-helpers"
source "$lib"
if [ $? -ne 0 ]; then
echo >&2 "Error: failed to source $lib"
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
exit 1
fi
cd src

export PIP_NO_INDEX=true
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"

if [ "$SAGE_EDITABLE" = yes ]; then
# SAGE_ROOT/src/setup.py installs everything, nothing to do...
if [ "$SAGE_WHEELS" = yes ]; then
# ... except we build the wheel if requested
sdh_setup_bdist_wheel && sdh_store_wheel .
fi
else
if [ "$SAGE_WHEELS" = yes ]; then
# Modularized install via wheels
sdh_pip_install .
# else nothing to do in legacy direct installation.
fi
fi
21 changes: 21 additions & 0 deletions build/pkgs/sagemath_gap/spkg-src
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Script to prepare an sdist tarball for sagemath-gap
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# ./sage --sh build/pkgs/sagemath_gap/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_gap

cd src
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/src
1 change: 1 addition & 0 deletions build/pkgs/sagemath_gap/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
11 changes: 11 additions & 0 deletions pkgs/sagemath-gap/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
global-exclude *.c
global-exclude *.cpp

global-exclude __pycache__
global-exclude *.py[co]
global-exclude *.bak
global-exclude *.so
global-exclude *~
prune .tox
prune build
prune dist
32 changes: 32 additions & 0 deletions pkgs/sagemath-gap/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
==============================================================================
Sage: Open Source Mathematics Software: Graph (iso/auto)morphisms with gap
==============================================================================

About SageMath
--------------

"Creating a Viable Open Source Alternative to
Magma, Maple, Mathematica, and MATLAB"

Copyright (C) 2005-2022 The Sage Development Team

https://www.sagemath.org

SageMath fully supports all major Linux distributions, recent versions of
macOS, and Windows (using Cygwin or Windows Subsystem for Linux).

The traditional and recommended way to install SageMath is from source via
Sage-the-distribution (https://www.sagemath.org/download-source.html).
Sage-the-distribution first builds a large number of open source packages from
source (unless it finds suitable versions installed in the system) and then
installs the Sage Library (sagelib, implemented in Python and Cython).


About this pip-installable source distribution
----------------------------------------------

This pip-installable source distribution ``sagemath-gap`` is a small
optional distribution for use with ``sagemath-standard``.

It provides a Cython interface to the ``gap`` library for the purpose
of computing graph (iso/auto)morphisms.
1 change: 1 addition & 0 deletions pkgs/sagemath-gap/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9.8.beta1
15 changes: 15 additions & 0 deletions pkgs/sagemath-gap/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = [
'setuptools >=49.6.0',
'wheel >=0.36.2',
'sage-setup ~= 9.8b3',
'sagemath-environment ~= 9.8b3',
'sagemath-categories ~= 9.8b3',
'cython >=0.29.21, <1.0',
'gmpy2 >=2.1.0',
'cysignals >=1.10.2',
'cypari2 >=2.1.1',
'memory_allocator',
]
build-backend = "setuptools.build_meta"
16 changes: 16 additions & 0 deletions pkgs/sagemath-gap/pyproject.toml.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = [
esyscmd(`sage-get-system-packages install-requires-toml \
setuptools \
wheel \
sage_setup \
sagemath_environment \
sagemath_categories \
cython \
gmpy2 \
cysignals \
cypari \
memory_allocator \
')]
build-backend = "setuptools.build_meta"
2 changes: 2 additions & 0 deletions pkgs/sagemath-gap/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cython==0.29.32
sagemath-standard==9.8.beta3
2 changes: 2 additions & 0 deletions pkgs/sagemath-gap/requirements.txt.m4
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)')
1 change: 1 addition & 0 deletions pkgs/sagemath-gap/sage
33 changes: 33 additions & 0 deletions pkgs/sagemath-gap/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- conf-unix -*-
[metadata]
name = sagemath-gap
version = file: VERSION.txt
description = Sage: Open Source Mathematics Software: Graph (iso/auto)morphisms with gap
long_description = file: README.rst
long_description_content_type = text/x-rst
license = GNU General Public License (GPL) v2 or later
author = The Sage Developers
author_email = sage-support@googlegroups.com
url = https://www.sagemath.org

classifiers =
Development Status :: 6 - Mature
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.8, <3.12
install_requires =
memory_allocator
sagemath-environment ~= 9.8b3
sagemath-categories ~= 9.8b3
37 changes: 37 additions & 0 deletions pkgs/sagemath-gap/setup.cfg.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- conf-unix -*-
[metadata]
name = sagemath-gap
version = file: VERSION.txt
description = Sage: Open Source Mathematics Software: Graph (iso/auto)morphisms with gap
long_description = file: README.rst
long_description_content_type = text/x-rst
license = GNU General Public License (GPL) v2 or later
author = The Sage Developers
author_email = sage-support@googlegroups.com
url = https://www.sagemath.org

classifiers =
Development Status :: 6 - Mature
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.8, <3.12
install_requires =
esyscmd(`sage-get-system-packages install-requires \
cypari \
cysignals \
memory_allocator \
sagemath_environment \
sagemath_categories \
| sed "2,\$s/^/ /;"')dnl
68 changes: 68 additions & 0 deletions pkgs/sagemath-gap/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env python

from distutils import log
from setuptools import setup

# Work around a Cython problem in Python 3.8.x on macOS
# https://github.com/cython/cython/issues/3262
import os
if os.uname().sysname == 'Darwin':
import multiprocessing
multiprocessing.set_start_method('fork', force=True)

# If build isolation is not in use and setuptools_scm is installed,
# then its file_finders entry point is invoked, which we don't need.
# Workaround from ​https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286
try:
import setuptools_scm.integration
setuptools_scm.integration.find_files = lambda _: []
except ImportError:
pass

# PEP 517 builds do not have . in sys.path
import sys
sys.path.insert(0, os.path.dirname(__file__))

if len(sys.argv) > 1 and (sys.argv[1] == "sdist" or sys.argv[1] == "egg_info"):
sdist = True
else:
sdist = False

if sdist:
cmdclass = {}
else:
from sage_setup.excepthook import excepthook
sys.excepthook = excepthook

from sage_setup.setenv import setenv
setenv()

import sage.env
sage.env.default_required_modules = sage.env.default_optional_modules = ()

from sage_setup.command.sage_build_cython import sage_build_cython
from sage_setup.command.sage_build_ext import sage_build_ext
sage_build_cython.built_distributions = ['sagemath-gap']

cmdclass = dict(build_cython=sage_build_cython,
build_ext=sage_build_ext)

if sdist:
python_packages = []
python_modules = []
cython_modules = []
else:
from sage_setup.find import find_python_sources
python_packages, python_modules, cython_modules = find_python_sources(
'.', ['sage'], distributions=['sagemath-gap'])

log.warn('python_packages = {0}'.format(python_packages))
log.warn('python_modules = {0}'.format(python_modules))
log.warn('cython_modules = {0}'.format(cython_modules))

setup(
cmdclass = cmdclass,
packages = python_packages,
py_modules = python_modules,
ext_modules = cython_modules,
)

0 comments on commit 52b208b

Please sign in to comment.