Skip to content

Commit

Permalink
pkgs/sagemath-planarity: New
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Nov 11, 2024
1 parent 09e6b2f commit 82b6ae1
Show file tree
Hide file tree
Showing 24 changed files with 164 additions and 3 deletions.
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/SPKG.rst
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/bootstrap
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(SAGE_ROOT)/pkgs/sagemath-planarity/pyproject.toml $(SAGE_ROOT)/pkgs/sagemath-planarity/MANIFEST.in planarity cysignals boost_cropped | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/dependencies_check
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox sagemath_repl sagemath_graphs
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/package-version.txt
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/spkg-check
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/spkg-install.in
24 changes: 24 additions & 0 deletions build/pkgs/sagemath_planarity/spkg-src
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-planarity
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# ./sage --sh build/pkgs/sagemath_planarity/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_planarity

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"
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/src
1 change: 1 addition & 0 deletions build/pkgs/sagemath_planarity/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
2 changes: 2 additions & 0 deletions build/pkgs/sagemath_planarity/version_requirements.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
passagemath-planarity ~= 10.4.58.0
1 change: 1 addition & 0 deletions pkgs/sagemath-graphs/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ exclude sage/graphs/bliss.p*
prune sage/graphs/bliss_cpp
exclude sage/graphs/mcqd.p*
exclude sage/graphs/graph_decompositions/*tdlib*.*
exclude sage/graphs/planarity.p*

exclude sage/graphs/chrompoly.p* # needs flint
exclude sage/graphs/matchpoly.p* # needs flint
Expand Down
4 changes: 2 additions & 2 deletions pkgs/sagemath-graphs/pyproject.toml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ mcqd = ["passagemath-mcqd"]
nauty = ["passagemath-nauty"]
networkx = [SPKG_INSTALL_REQUIRES_networkx]
pari = ["passagemath-pari"]
planarity = ["passagemath-planarity"]
tdlib = ["passagemath-tdlib"]

# features
Expand All @@ -54,7 +55,7 @@ polyhedra = ["passagemath-polyhedra"]
repl = ["passagemath-repl"]
sat = ["passagemath-combinat"]

standard = ["passagemath-graphs[combinat,databases,mip,modules,plot,polyhedra,repl]"]
standard = ["passagemath-graphs[combinat,databases,mip,modules,planarity,plot,polyhedra,repl]"]

[tool.setuptools]
include-package-data = false
Expand All @@ -75,7 +76,6 @@ host-requires = [
"pkg:generic/gmp",
"pkg:generic/mpc",
"pkg:generic/mpfr",
"pkg:generic/planarity",
"pkg:generic/rw",
]

Expand Down
20 changes: 20 additions & 0 deletions pkgs/sagemath-planarity/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prune sage

include VERSION.txt

global-exclude *.c
global-exclude *.cpp

include sage/graphs/planarity.p*

global-exclude all__sagemath_*.*
global-include all__sagemath_planarity.py

global-exclude __pycache__
global-exclude *.py[co]
global-exclude *.bak
global-exclude *.so
global-exclude *~
prune .tox
prune build
prune dist
36 changes: 36 additions & 0 deletions pkgs/sagemath-planarity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
========================================================================
passagemath: Graph planarity with the edge addition planarity suite
========================================================================

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

This pip-installable distribution ``passagemath-planarity`` is a small
optional distribution for use with ``passagemath-graphs``.

It provides a Cython interface to the
`Edge Addition Planarity Suite <https://github.com/graph-algorithms/edge-addition-planarity-suite/>`_
by John Boyer.


What is included
----------------

- `Cython interface to Boyer's planarity algorithm <https://doc.sagemath.org/html/en/reference/graphs/sage/graphs/planarity.html>`_
1 change: 1 addition & 0 deletions pkgs/sagemath-planarity/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.4.58
49 changes: 49 additions & 0 deletions pkgs/sagemath-planarity/pyproject.toml.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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_sage_setup
SPKG_INSTALL_REQUIRES_sagemath_environment
SPKG_INSTALL_REQUIRES_cython
SPKG_INSTALL_REQUIRES_cysignals
SPKG_INSTALL_REQUIRES_pkgconfig
]
build-backend = "setuptools.build_meta"

[project]
name = "passagemath-planarity"
description = "passagemath: Graph planarity with the edge addition planarity suite"
dependencies = [
'passagemath-graphs',
]
dynamic = ["version"]
include(`pyproject_toml_metadata.m4')dnl'

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.optional-dependencies]
test = ["passagemath-repl"]

[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/planarity",
]

dependencies = [
]
3 changes: 3 additions & 0 deletions pkgs/sagemath-planarity/requirements-editable.txt.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include(`sage_spkg_versions.m4')dnl
dnl Same as setup.cfg.m4 install_requires; FIXME: should pin to built wheels.
SPKG_INSTALL_REQUIRES_cysignals
2 changes: 2 additions & 0 deletions pkgs/sagemath-planarity/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-planarity/sage
11 changes: 11 additions & 0 deletions pkgs/sagemath-planarity/setup.py
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-planarity'],
spkgs=['planarity'])
1 change: 1 addition & 0 deletions src/sage/all__sagemath_planarity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# sage_setup: distribution = sagemath-planarity
1 change: 1 addition & 0 deletions src/sage/graphs/all__sagemath_planarity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# sage_setup: distribution = sagemath-planarity
2 changes: 1 addition & 1 deletion src/sage/graphs/planarity.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage_setup: distribution = sagemath-graphs
# sage_setup: distribution = sagemath-planarity
# distutils: libraries = planarity
"""
Wrapper for Boyer's (C) planarity algorithm
Expand Down

0 comments on commit 82b6ae1

Please sign in to comment.