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

Commit

Permalink
Working sdist and install
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 1, 2020
1 parent a6373b7 commit 441cb6e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ global-exclude *.bak
graft sage_bootstrap/sage_root
# These sources are not needed because individual distributions of these are made.
prune sage_bootstrap/sage_root/build/pkgs/*/src
# except for this one
graft sage_bootstrap/sage_root/build/pkgs/sage_conf/src
1 change: 1 addition & 0 deletions build/sage_bootstrap/sage_root/build/bin
1 change: 1 addition & 0 deletions build/sage_bootstrap/sage_root/src/Makefile.in
1 change: 1 addition & 0 deletions build/sage_bootstrap/sage_root/src/bin
23 changes: 23 additions & 0 deletions build/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#!/usr/bin/env sage-system-python

from distutils.core import setup
from distutils.cmd import Command
from distutils.command.install import install as distutils_install
from distutils.errors import (DistutilsSetupError, DistutilsModuleError,
DistutilsOptionError)

class install(distutils_install):

def run(self):
import os
import sys
import shutil
distutils_install.run(self)

DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'), '.sage'))
SAGE_ROOT = os.path.join(DOT_SAGE, 'sage-{}'.format(self.distribution.version))
shutil.copytree('sage_bootstrap/sage_root', SAGE_ROOT) # will fail if already exists
SAGE_LOCAL = os.path.join(SAGE_ROOT, 'local')
# config.status and other configure output has to be writable.
cmd = "cd {} && ./configure --prefix={} PYTHON3={}".format(SAGE_ROOT, SAGE_LOCAL, sys.executable)
print("Running {}".format(cmd))
if os.system(cmd) != 0:
raise DistutilsSetupError("configure failed")

setup(
name='sage_bootstrap',
Expand All @@ -18,4 +40,5 @@
},
version='1.0',
url='https://www.sagemath.org',
cmdclass=dict(install=install)
)
1 change: 1 addition & 0 deletions build/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ skip_missing_interpreters=true

[testenv]
setenv =
HOME={envdir}
# We make it harder to get the encoding right by using the dumbest default
LC_ALL = C
SAGE_ROOT = {toxinidir}/..
Expand Down

0 comments on commit 441cb6e

Please sign in to comment.