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 Jun 11, 2020
1 parent a7de6c0 commit 7dd469f
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ gitlab-build-docker.log
/src/bin/sage-env-config
/build/bin/sage-build-env-config

/build/pkgs/*/src/build

#######################
# tox generated files #
#######################
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tdlib
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/spkg-install
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/src/sage
1 change: 1 addition & 0 deletions build/pkgs/sage_tdlib/src/sage_setup
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
2 changes: 1 addition & 1 deletion build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
cd "$SAGE_SRC"
cd src
## All sagelib-building is done by setup.py.
## This is so that sagelib can be installed by standard Python procedures,
## such as "./setup.py install" or "pip install ."
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/sage
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/sage_setup
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/setup.cfg
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/setup.py
7 changes: 6 additions & 1 deletion src/sage_setup/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,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 @@ -266,6 +267,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 @@ -58,7 +58,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 7dd469f

Please sign in to comment.