Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 34ab622

Browse files
author
Release Manager
committed
Trac #33151: sage-conf_pypi does not build wheelhouse
Contrary to what is claimed in the README in https://pypi.org/project /sage-conf/9.5rc0/, after `pip install sage_conf==9.5rc0`, there is no wheelhouse available: `ls $(sage-config SAGE_SPKG_WHEELS)` gives "No such file or directory". We fix this by changing `make build-local` to `make build` in the install script (and fixing a bug that caused `make build` to fail). Distribution using the branch of this ticket uploaded as https://pypi.org/project/sage-conf/9.5rc0.post1/ URL: https://trac.sagemath.org/33151 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Dima Pasechnik
2 parents fb599d0 + 04066ab commit 34ab622

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ AS_IF([test "x$enable_download_from_upstream_url" = "xyes"], [
446446
])
447447
AC_SUBST([SAGE_SPKG_OPTIONS])
448448

449+
AC_ARG_ENABLE([sagelib],
450+
AS_HELP_STRING([--disable-sage_conf],
451+
[disable build of the sage_conf package]), [
452+
for pkg in sage_conf; do
453+
AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval])
454+
done
455+
])
456+
449457
AC_ARG_ENABLE([cvxopt],
450458
AS_HELP_STRING([--disable-cvxopt],
451459
[disable build of the cvxopt package and its prerequisite suitesparse]), [
@@ -490,7 +498,7 @@ AC_ARG_ENABLE([doc],
490498
AC_ARG_ENABLE([sagelib],
491499
AS_HELP_STRING([--disable-sagelib],
492500
[disable build of the Sage library and packages depending on it]), [
493-
for pkg in sagelib sage_docbuild; do
501+
for pkg in sagelib sage_docbuild sage_setup; do
494502
AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval])
495503
done
496504
])

pkgs/sage-conf/README.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ sage_conf sdist on PyPI
2222
-----------------------
2323

2424
This implementation of the ``sage_conf`` distribution package comes from
25-
https://trac.sagemath.org/ticket/29039, which adds the directory
26-
``pkgs/sage-conf_pypi/``.
25+
https://trac.sagemath.org/ticket/29039, which added the directory
26+
`pkgs/sage-conf_pypi <https://github.com/sagemath/sage/tree/develop/pkgs/sage-conf_pypi/>`_.
2727

2828
To install, use ``pip install -v sage_conf``. Using ``-v`` ensures that diagnostic
2929
messages are displayed.
@@ -77,8 +77,9 @@ sage_conf in the SageMath distribution
7777

7878
The original version of the distribution package ``sage_conf`` is used
7979
internally in the SageMath distribution. It is provided in the directory
80-
``pkgs/sage-conf/``. This version of the package is generated
81-
by the Sage distribution's ``configure`` script.
80+
`pkgs/sage-conf <https://github.com/sagemath/sage/tree/develop/pkgs/sage-conf/>`_.
81+
This version of the package is generated by the Sage distribution's ``configure``
82+
script.
8283

8384

8485
sage_conf in downstream distributions
@@ -100,4 +101,4 @@ Upstream Contact
100101
https://www.sagemath.org
101102

102103
This package is included in the source code of the Sage distribution,
103-
in ``pkgs/sage-conf*``.
104+
in `pkgs/sage-conf* <https://github.com/sagemath/sage/tree/develop/pkgs/>`_.

pkgs/sage-conf_pypi/setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run(self):
3737
shutil.copytree('sage_root', SAGE_ROOT) # will fail if already exists
3838
except Exception:
3939
raise DistutilsSetupError(f"the directory SAGE_ROOT={SAGE_ROOT} already exists but it is not configured. Please remove it and try again.")
40-
cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --enable-download-from-upstream-url --with-system-python3=force --with-sage-venv --disable-notebook --disable-sagelib"
40+
cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --enable-download-from-upstream-url --with-system-python3=force --with-sage-venv --disable-notebook --disable-sagelib --disable-sage_conf --disable-doc"
4141
print(f"Running {cmd}")
4242
sys.stdout.flush()
4343
if os.system(cmd) != 0:
@@ -55,9 +55,11 @@ def run(self):
5555
# TODO: A target to only build wheels of tricky packages
5656
# (that use native libraries shared with other packages).
5757
SETMAKE = 'if [ -z "$MAKE" ]; then export MAKE="make -j$(PATH=build/bin:$PATH build/bin/sage-build-num-threads | cut -d" " -f 2)"; fi'
58-
cmd = f'cd {SAGE_ROOT} && {SETENV} && {SETMAKE} && $MAKE V=0 build-local'
58+
TARGETS = 'build'
59+
cmd = f'cd {SAGE_ROOT} && {SETENV} && {SETMAKE} && $MAKE V=0 {TARGETS}'
60+
print(f"Running {cmd}", flush=True)
5961
if os.system(cmd) != 0:
60-
raise DistutilsSetupError("make build-local failed")
62+
raise DistutilsSetupError(f"make {TARGETS} failed")
6163

6264
# Install configuration
6365
shutil.copyfile(os.path.join(SAGE_ROOT, 'pkgs', 'sage-conf', 'sage_conf.py'),

0 commit comments

Comments
 (0)