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

Commit

Permalink
pkgs/sagemath-homfly, build/pkgs/sagemath_homfly: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 3, 2022
1 parent 8c46aab commit 6db9b01
Show file tree
Hide file tree
Showing 18 changed files with 221 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/SPKG.rst
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/bootstrap
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(PYTHON) sagelib libhomfly | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sagemath-homfly
2 changes: 2 additions & 0 deletions build/pkgs/sagemath_homfly/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-homfly
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/package-version.txt
29 changes: 29 additions & 0 deletions build/pkgs/sagemath_homfly/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_homfly/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-homfly
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# ./sage --sh build/pkgs/sagemath_homfly/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_homfly

cd src
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/src
1 change: 1 addition & 0 deletions build/pkgs/sagemath_homfly/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
11 changes: 11 additions & 0 deletions pkgs/sagemath-homfly/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-homfly/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 homfly
==============================================================================

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-homfly`` is a small
optional distribution for use with ``sagemath-standard``.

It provides a Cython interface to the ``homfly`` library for the purpose
of computing graph (iso/auto)morphisms.
1 change: 1 addition & 0 deletions pkgs/sagemath-homfly/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9.8.beta1
14 changes: 14 additions & 0 deletions pkgs/sagemath-homfly/pyproject.toml.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[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_standard \
cython \
gmpy2 \
cysignals \
')]
build-backend = "setuptools.build_meta"
2 changes: 2 additions & 0 deletions pkgs/sagemath-homfly/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-homfly/sage
33 changes: 33 additions & 0 deletions pkgs/sagemath-homfly/setup.cfg.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- conf-unix -*-
[metadata]
name = sagemath-homfly
version = file: VERSION.txt
description = Sage: Open Source Mathematics Software: Graph (iso/auto)morphisms with homfly
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 \
sagelib \
| sed "2,\$s/^/ /;"')dnl
68 changes: 68 additions & 0 deletions pkgs/sagemath-homfly/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-homfly']

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-homfly'])

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 6db9b01

Please sign in to comment.