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

Commit

Permalink
WIP: Add sage_tdlib package, use symlinks for sagelib package
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 10, 2020
1 parent a315ba6 commit 4a30688
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sagelib tdlib | $(PYTHON_TOOLCHAIN)
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/package-version.txt
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/spkg-install
21 changes: 21 additions & 0 deletions build/pkgs/sage_tdlib/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 sage_tdlib.
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# 1) ./sage --sh build/pkgs/sage_tdlib/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/sage_tdlib

cd src
sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
3 changes: 3 additions & 0 deletions build/pkgs/sage_tdlib/src/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
prune sage
include sage/graphs/graph_decompositions/tdlib*
graft sage/graphs/graph_decompositions/tdlib
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/src/sage
2 changes: 2 additions & 0 deletions build/pkgs/sage_tdlib/src/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
name = sage-tdlib
30 changes: 30 additions & 0 deletions build/pkgs/sage_tdlib/src/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python

from distutils import log
from setuptools import setup

from sage_setup.command.sage_build import sage_build
from sage_setup.command.sage_build_cython import sage_build_cython
from sage_setup.command.sage_build_ext import sage_build_ext

from sage_setup.find import find_python_sources, is_package_or_namespace_package_dir
python_packages, python_modules, cython_modules = find_python_sources(
'.', ['sage'], distributions=['sage-tdlib'])

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

import Cython.Build.Dependencies
import Cython.Build.Cythonize
import Cython.Utils
Cython.Utils.is_package_dir = Cython.Build.Cythonize.is_package_dir = Cython.Build.Dependencies.is_package_dir = is_package_or_namespace_package_dir

from sage_setup.command.sage_install import sage_install

setup(
cmdclass = dict(build_cython=sage_build_cython,
build_ext=sage_build_ext,
install=sage_install), # need this, or "setup.py install" will install an egg
ext_modules = cython_modules
)
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/setup.cfg
7 changes: 6 additions & 1 deletion src/sage_setup/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def is_package_or_namespace_package_dir(dirpath):
return True
return os.path.exists(os.path.join(dirpath, 'namespace'))

def find_extra_files(src_dir, modules, cythonized_dir, special_filenames=[]):
def find_extra_files(src_dir, modules, cythonized_dir, special_filenames=[],
distributions=None):
"""
Find all extra files which should be installed.
Expand Down Expand Up @@ -270,6 +271,10 @@ def find_extra_files(src_dir, modules, cythonized_dir, special_filenames=[]):
"""
from Cython.Utils import is_package_dir

if not (distributions is None or '' in distributions):
# FIXME: This is only a 0th order approximation of what we need
return []

data_files = {}
cy_exts = ('.pxd', '.pxi', '.pyx')

Expand Down
4 changes: 3 additions & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@

from sage_setup.optional_extension import is_package_installed_and_updated

optional_packages_with_extensions = ['mcqd', 'bliss', 'tdlib', 'primecount',
optional_packages_with_extensions = ['mcqd', 'bliss',
#'tdlib', ## handled by sage_tdlib
'primecount',
'coxeter3', 'fes', 'sirocco', 'meataxe']

distributions += ['sage-{}'.format(pkg)
Expand Down

0 comments on commit 4a30688

Please sign in to comment.