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 Sep 10, 2020
1 parent 4a30688 commit 16a9b2e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
22 changes: 21 additions & 1 deletion build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,27 @@ export SAGE_SHARE=/doesnotexist
# uses this variable.
# export SAGE_LOCAL=/doesnotexist

time "$PYTHON" -u setup.py --no-user-cfg build install || exit 1
# --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

# 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
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):

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

0 comments on commit 16a9b2e

Please sign in to comment.