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

Commit

Permalink
Install sagelib, sage_tdlib via sdist defined by MANIFEST.in
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 15, 2020
1 parent 7042564 commit 90b33d8
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ gitlab-build-docker.log
/build/pkgs/*/src/build
/build/pkgs/*/src/dist
/build/pkgs/*/src/*.egg-info
/build/pkgs/*/src/MANIFEST
/src/MANIFEST

#######################
# tox generated files #
Expand Down
21 changes: 20 additions & 1 deletion build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,26 @@ export SAGE_SHARE=/doesnotexist
# export SAGE_LOCAL=/doesnotexist

# --single-version-externally-managed prevents setuptools from installing an egg
time "$PYTHON" -u setup.py --no-user-cfg build install --single-version-externally-managed --root / || exit 1
#time "$PYTHON" -u setup.py --no-user-cfg build install --single-version-externally-managed --root / || exit 1

# However, setuptools.command.install_lib installs too much (via copy_tree).
# FIXME: This should be fixed by a custom install command provided by sage_setup that uses find_extra_files
# and respects sage_setup

# Until this is ready, we just build an sdist (driven by MANIFEST.in):
# - build/pkgs/sage_tdlib/src/MANIFEST.in includes/grafts some files/directories,
# - build/pkgs/sagelib/src/MANIFEST.in excludes/prunes the same files/directories.
# Then we pip-install the sdist.

# (This duplicates the information encoded in the sage_setup directives in the files,
# and is therefore not a good long-term solution.)

dist_dir="$SAGE_DISTFILES"
sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$dist_dir" || exit 1
archive="$dist_dir"/$(sage-python23 -u setup.py --no-user-cfg --fullname | tail -1 2>/dev/null).tar.gz || exit 1
# TODO: Go through sage-pip-install
sage-python23 -m pip install --ignore-installed --verbose --no-deps --no-index --isolated --no-build-isolation "$archive" || exit 1

if [ "$UNAME" = "CYGWIN" ]; then
sage-rebase.sh "$SAGE_LOCAL" 2>/dev/null;
fi
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/MANIFEST.in
4 changes: 4 additions & 0 deletions src/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ graft doc/en/prep/media
prune doc/en/reference/*/sage
prune doc/en/reference/*/sagenb
prune doc/output

# sage-tdlib
exclude sage/graphs/graph_decompositions/tdlib*
prune sage/graphs/graph_decompositions/tdlib
2 changes: 1 addition & 1 deletion src/sage_setup/command/sage_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import time
from distutils import log
from distutils.command.install import install
from setuptools.command.install import install

class sage_install(install):
def run(self):
Expand Down
12 changes: 12 additions & 0 deletions src/sage_setup/command/sage_install_lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from setuptools.command.install_lib import install_lib

class sage_install_lib(install_lib):

def get_exclusions(self):

exclusions = install_lib.get_exclusions(self)
print("EXCLUSIONS: ", exclusions)
# FIXME: Exclude files outside of the current distribution
return exclusions

pass
2 changes: 2 additions & 0 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
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_lib import sage_install_lib
from sage_setup.command.sage_install import sage_install

#########################################################
Expand Down Expand Up @@ -128,5 +129,6 @@
cmdclass = dict(build=sage_build,
build_cython=sage_build_cython,
build_ext=sage_build_ext,
install_lib=sage_install_lib,
install=sage_install),
ext_modules = cython_modules)

0 comments on commit 90b33d8

Please sign in to comment.