-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #29847: Install sage_setup with setuptools as a prerequisite for…
… building/installing sagelib sage_setup will be used by the build system of various distribution packages (#29705). So we make it a regular distribution package itself, with sources in `pkgs/sage-setup/` (#31577) and install it with `pip`. The actual Python source files are not moved because `sage_setup` takes part in Sage doctesting (see #31577). `sagelib`'s `setup.py` will no longer install `sage_setup`. `sage-setup` will become a `build-system requires` of `sagemath- standard` (declared in `pyproject.toml`) Follow-up: - #29924: Do not fail if `sage.env`, `sage.*` are not available ------ References: python - pip ignores dependency_links in setup.py - Stack Overflow https://stackoverflow.com/questions/12518499/pip-ignores-dependency- links-in-setup-py dependency_links flag ignored when package exists on PyPI · Issue #987 · pypa/setuptools pypa/setuptools#987 Suggest alternatives for --process-dependency-links · Issue #6162 · pypa/pip pypa/pip#6162 PEP 508 -- Dependency specification for Python Software Packages | Python.org https://www.python.org/dev/peps/pep-0508/#pep440 PEP 440 -- Version Identification and Dependency Specification | Python.org https://www.python.org/dev/peps/pep-0440/#local-version-segments URL: https://trac.sagemath.org/29847 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
31 changed files
with
143 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sage-conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/README.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$(PYTHON) cython pkgconfig | $(PYTHON_TOOLCHAIN) | ||
|
||
---------- | ||
All lines of this file are ignored except the first. | ||
It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sage-setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sagelib/package-version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# From sage-spkg. | ||
# For type=script packages, the build rule in build/make/Makefile sources | ||
# sage-env but not sage-dist-helpers. | ||
lib="$SAGE_ROOT/build/bin/sage-dist-helpers" | ||
source "$lib" | ||
if [ $? -ne 0 ]; then | ||
echo >&2 "Error: failed to source $lib" | ||
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" | ||
exit 1 | ||
fi | ||
cd src && sdh_pip_install . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Script to prepare an sdist tarball for sage_setup | ||
# This script is not used during build. | ||
# | ||
# HOW TO MAKE THE TARBALL: | ||
# ./sage --sh build/pkgs/sage_setup/spkg-src | ||
|
||
if [ -z "$SAGE_ROOT" ] ; then | ||
echo >&2 "Error - SAGE_ROOT undefined ... exiting" | ||
echo >&2 "Maybe run 'sage -sh'?" | ||
exit 1 | ||
fi | ||
|
||
# Exit on failure | ||
set -e | ||
|
||
cd build/pkgs/sage_setup | ||
|
||
cd src | ||
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../pkgs/sage-setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This directory contains source trees of independent Python distribution packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sage-setup: Build system of the SageMath library | ||
================================================ | ||
|
||
This is the build system of the Sage library, based on setuptools. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../src/VERSION.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Cython | ||
pkgconfig |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[metadata] | ||
name = sage-setup | ||
version = file: VERSION.txt | ||
description = Sage: Open Source Mathematics Software: Build system of the Sage library | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
license = GNU General Public License (GPL) v2 or later | ||
author = The Sage Developers | ||
author_email = sage-support@googlegroups.com | ||
url = https://www.sagemath.org | ||
|
||
classifiers = | ||
Development Status :: 6 - Mature | ||
Intended Audience :: Education | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) | ||
Operating System :: POSIX | ||
Operating System :: MacOS :: MacOS X | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Topic :: Scientific/Engineering :: Mathematics | ||
|
||
[options] | ||
packages = | ||
sage_setup | ||
sage_setup.autogen | ||
sage_setup.autogen.interpreters | ||
sage_setup.autogen.interpreters.specs | ||
sage_setup.command | ||
|
||
python_requires = >=3.7, <3.10 | ||
|
||
install_requires = | ||
pkgconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup | ||
|
||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# First pip-install tox: | ||
# | ||
# ./sage -pip install tox | ||
# | ||
# To build and test in the tox environment: | ||
# | ||
# ./sage -sh -c '(cd pkgs/sage-setup && tox)' | ||
# | ||
# To test interactively: | ||
# | ||
# pkgs/sage-setup/.tox/python/bin/python | ||
# | ||
[tox] | ||
|
||
[testenv] | ||
deps = -rrequirements.txt | ||
|
||
setenv = | ||
# Sage scripts such as sage-runtests like to use $HOME/.sage | ||
HOME={envdir} | ||
|
||
whitelist_externals = | ||
bash | ||
|
||
commands = | ||
# Beware of the treacherous non-src layout. | ||
python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage_setup; import sage_setup.find' | ||
|
||
# TODO: Test importing sage_setup.library_order -- when that can handle missing pkgconfig libraries... | ||
# TODO: Test more modules -- when the dependency on sage.env has been removed... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters