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

Commit 4344f89

Browse files
author
Matthias Koeppe
committed
Merge branch 't/21559/change-src-bin-installation' into t/29950/build_sagelib_using_installed_sage_setup
2 parents 7244371 + 19d7f67 commit 4344f89

File tree

211 files changed

+5405
-2019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+5405
-2019
lines changed

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Force LF normalization
2+
* text=auto eol=lf
3+
# except for Windows batch files
4+
*.{cmd,[cC][mM][dD]} text eol=crlf
5+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/workflows/ci-cygwin-minimal.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
MAKE: make -j8
1212
SAGE_NUM_THREADS: 3
1313
SAGE_CHECK: warn
14-
SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
14+
SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
1515
CYGWIN: winsymlinks:native
1616
CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url
1717
SAGE_FAT_BINARY: yes

.github/workflows/ci-cygwin-standard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
MAKE: make -j8
1212
SAGE_NUM_THREADS: 3
1313
SAGE_CHECK: warn
14-
SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
14+
SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
1515
CYGWIN: winsymlinks:native
1616
CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url
1717
SAGE_FAT_BINARY: yes

README.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Guide](https://doc.sagemath.org/html/en/installation).
173173

174174
- [Git] Alternatively, clone the Sage git repository:
175175

176-
$ git clone --branch master git://trac.sagemath.org/sage.git
176+
$ git clone -c core.symlinks=true --branch master git://trac.sagemath.org/sage.git
177177

178178
This will create the subdirectory `sage`.
179179

@@ -183,12 +183,9 @@ Guide](https://doc.sagemath.org/html/en/installation).
183183

184184
Therefore it is crucial that you unpack the source tree from the
185185
Cygwin (or WSL) `bash` using the Cygwin (or WSL) `tar` utility
186-
and not using other Windows tools (including mingw). Likewise,
187-
when using `git`, it is crucial that you use the Cygwin (or WSL)
188-
version of `git`, and that you configure it as follows first:
189-
190-
$ git config --global core.autocrlf false
191-
$ git config --global core.symlinks true
186+
and not using other Windows tools (including mingw). Likewise,
187+
when using `git`, it is recommended (but not necessary) to use the Cygwin (or WSL)
188+
version of `git`.
192189

193190
3. `cd` into the source/build directory:
194191

@@ -271,8 +268,8 @@ Guide](https://doc.sagemath.org/html/en/installation).
271268
guide](https://doc.sagemath.org/html/en/installation/source.html#environment-variables).
272269

273270
11. Type `./configure`, followed by any options that you wish to use.
274-
For example, to build a Python2-based Sage (which was the default
275-
before Sage 9.0), use `./configure --with-python=2`.
271+
For example, to build Sage with `gf2x` package supplied by Sage,
272+
use `./configure --with-system-gf2x=no`.
276273

277274
At the end of a successful `./configure` run, you may see messages
278275
recommending to install extra system packages using your package
@@ -422,7 +419,7 @@ through to another Makefile under `build/make/Makefile`.
422419
The latter `build/make/Makefile` *is* generated by an autoconf-generated
423420
`configure` script, using the template in `build/make/Makefile.in`. This
424421
includes rules for building the Sage library itself (`make sagelib`), and for
425-
building and installing each of Sage's dependencies (e.g. `make python2`).
422+
building and installing each of Sage's dependencies (e.g. `make gf2x`).
426423

427424
The `configure` script itself, if it is not already built, can be generated by
428425
running the `bootstrap` script (the latter requires _GNU autotools_ being installed).

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SageMath version 9.2.beta3, Release Date: 2020-07-04
1+
SageMath version 9.2.beta4, Release Date: 2020-07-08

build/bin/sage-site

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then
158158
# tends to ask interactive questions if something goes wrong. These
159159
# cause the build to hang. If stdin is /dev/null, TeX just aborts.
160160
shift
161+
export LANG=C # to ensure it is possible to scrape out non-EN locale warnings
161162
exec sage-python -m sage_setup.docbuild "$@" </dev/null
162163
fi
163164

build/bin/write-dockerfile.sh

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./
161161
ADD src/doc/bootstrap src/doc/bootstrap
162162
ADD m4 ./m4
163163
ADD build ./build
164-
ADD src/bin/sage-version.sh src/bin/sage-version.sh
165164
$RUN ./bootstrap
166165
167166
FROM bootstrapped as configured

build/make/install

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export SAGE_SHARE="$SAGE_LOCAL/share"
1919
export SAGE_PKGCONFIG="$SAGE_LOCAL/lib/pkgconfig"
2020
export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
2121
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
22-
. "$SAGE_SRC"/bin/sage-version.sh
23-
export SAGE_VERSION
2422

2523
if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
2624
SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH

build/pkgs/configure/checksums.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=f4040175ebc1ebcae8eb41eaab02f84e5840692a
3-
md5=8b89552d880b19af9d7830e068084ae9
4-
cksum=582947775
2+
sha1=1130babcd6d704914c96e5e9b686d04cffaaf86a
3+
md5=37ec521d87e3c4c46ea05a04cc57ff0e
4+
cksum=2049642027
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
73f0829779110ea1262fafbceecdd56e108f1b7b
1+
3e65aa67cc253468cee514c6ee448b0b7a78da01

build/pkgs/database_stein_watkins_mini/spkg-install.in

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../database_stein_watkins/spkg-install.in

build/pkgs/fplll/checksums.ini

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tarball=fplll-VERSION.tar.gz
2-
sha1=67b70f4dcbb835025abce879b9acb4500e2f1d2c
3-
md5=e72082af9084c5b2d427977c9b79a602
4-
cksum=65319984
2+
sha1=3ab5e269fdf73b6f933b24db656e5c55d83aa690
3+
md5=31f0f5d2045802d0beb8945dd0fa07f0
4+
cksum=2692708834
5+
upstream_url=https://github.com/fplll/fplll/releases/download/VERSION/fplll-VERSION.tar.gz

build/pkgs/fplll/package-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.3.2
1+
5.3.3

build/pkgs/freetype/spkg-configure.m4

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
SAGE_SPKG_CONFIGURE([freetype], [
2-
AC_REQUIRE([SAGE_SPKG_CONFIGURE_LIBPNG])
3-
AC_MSG_CHECKING([Installing libpng? ])
4-
if test x$sage_spkg_install_libpng = xyes; then
5-
AC_MSG_RESULT([yes; install freetype as well])
6-
sage_spkg_install_freetype=yes
7-
else
8-
AC_MSG_RESULT([no])
9-
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4], [], [sage_spkg_install_freetype=yes])
10-
fi
2+
SAGE_SPKG_DEPCHECK([libpng], [
3+
dnl freetype versions are libtool's ones, cf trac #30014
4+
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 16.1], [], [sage_spkg_install_freetype=yes])
5+
])
6+
], [], [], [
117
if test x$sage_spkg_install_freetype = xyes; then
128
AC_SUBST(SAGE_FREETYPE_PREFIX, ['$SAGE_LOCAL'])
139
else
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.2.beta3
1+
9.2.beta4

build/pkgs/tox/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox

build/pkgs/tox/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
optional

build/sage_bootstrap/app.py

+59-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# https://www.gnu.org/licenses/
1515
# ****************************************************************************
1616

17+
1718
import os
1819
import logging
1920
log = logging.getLogger()
@@ -22,6 +23,9 @@
2223
from sage_bootstrap.tarball import Tarball
2324
from sage_bootstrap.updater import ChecksumUpdater, PackageUpdater
2425
from sage_bootstrap.creator import PackageCreator
26+
from sage_bootstrap.pypi import PyPiVersion, PyPiNotFound
27+
from sage_bootstrap.fileserver import FileServer
28+
from sage_bootstrap.expand_class import PackageClass
2529

2630

2731
class Application(object):
@@ -39,7 +43,7 @@ def config(self):
3943
from sage_bootstrap.config import Configuration
4044
print(Configuration())
4145

42-
def list(self):
46+
def list_cls(self, package_class):
4347
"""
4448
Print a list of all available packages
4549
@@ -52,8 +56,9 @@ def list(self):
5256
zn_poly
5357
"""
5458
log.debug('Listing packages')
55-
for pkg in Package.all():
56-
print(pkg.name)
59+
pc = PackageClass(package_class)
60+
for pkg_name in pc.names:
61+
print(pkg_name)
5762

5863
def name(self, tarball_filename):
5964
"""
@@ -113,6 +118,32 @@ def update(self, package_name, new_version, url=None):
113118
update.download_upstream(url)
114119
update.fix_checksum()
115120

121+
def update_latest(self, package_name):
122+
"""
123+
Update a package to the latest version. This modifies the Sage sources.
124+
"""
125+
try:
126+
pypi = PyPiVersion(package_name)
127+
except PyPiNotFound:
128+
log.debug('%s is not a pypi package', package_name)
129+
return
130+
else:
131+
pypi.update()
132+
133+
def update_latest_all(self):
134+
log.debug('Attempting to update all packages')
135+
exclude = [
136+
'atlas', 'flint', 'bzip2', 'ecm', 'freetype', 'gap', 'glpk', 'graphs',
137+
'iconv', 'patch', 'r', 'configure', 'bliss', 'readline', 'decorator',
138+
'igraph', 'rw', 'planarity', 'gambit',
139+
]
140+
pc = PackageClass(':standard:')
141+
for package_name in pc.names:
142+
if package_name in exclude:
143+
log.debug('skipping %s because of pypi name collision', package_name)
144+
continue
145+
self.update_latest(package_name)
146+
116147
def download(self, package_name, allow_upstream=False):
117148
"""
118149
Download a package
@@ -126,6 +157,31 @@ def download(self, package_name, allow_upstream=False):
126157
package.tarball.download(allow_upstream=allow_upstream)
127158
print(package.tarball.upstream_fqn)
128159

160+
def download_cls(self, package_name_or_class):
161+
pc = PackageClass(package_name_or_class)
162+
pc.apply(self.download)
163+
164+
def upload(self, package_name):
165+
"""
166+
Upload a package to the Sage mirror network
167+
168+
$ sage --package upload pari
169+
Uploading /home/vbraun/Code/sage.git/upstream/pari-2.8-2044-g89b0f1e.tar.gz
170+
"""
171+
package = Package(package_name)
172+
if not os.path.exists(package.tarball.upstream_fqn):
173+
log.debug('Skipping %s because there is no local tarbal', package_name)
174+
return
175+
log.info('Uploading %s', package.tarball.upstream_fqn)
176+
fs = FileServer()
177+
fs.upload(package)
178+
179+
def upload_cls(self, package_name_or_class):
180+
pc = PackageClass(package_name_or_class)
181+
pc.apply(self.upload)
182+
fs = FileServer()
183+
fs.publish()
184+
129185
def fix_all_checksums(self):
130186
"""
131187
Fix the checksum of a package

build/sage_bootstrap/cmdline.py

+56-3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@
6969
autotools
7070
[...]
7171
zn_poly
72+
73+
$ sage --package list :standard: | sort
74+
arb
75+
atlas
76+
backports_ssl_match_hostname
77+
[...]
78+
zn_poly
7279
"""
7380

7481

@@ -115,6 +122,16 @@
115122
"""
116123

117124

125+
epilog_update_latest = \
126+
"""
127+
Update a package to the latest version. This modifies the Sage sources.
128+
129+
EXAMPLE:
130+
131+
$ sage --package update-latest ipython
132+
"""
133+
134+
118135
epilog_download = \
119136
"""
120137
Download the tarball for a package and print the filename to stdout
@@ -127,6 +144,17 @@
127144
"""
128145

129146

147+
epilog_upload = \
148+
"""
149+
Upload the tarball to the Sage mirror network (requires ssh key authentication)
150+
151+
EXAMPLE:
152+
153+
$ sage --package upload pari
154+
Uploading /home/vbraun/Code/sage.git/upstream/pari-2.8-2044-g89b0f1e.tar.gz
155+
"""
156+
157+
130158
epilog_fix_checksum = \
131159
"""
132160
Fix the checksum of a package
@@ -170,6 +198,10 @@ def make_parser():
170198
'list', epilog=epilog_list,
171199
formatter_class=argparse.RawDescriptionHelpFormatter,
172200
help='Print a list of all available packages')
201+
parser_list.add_argument(
202+
'package_class',
203+
type=str, default=':all:', nargs='?',
204+
help='Package class like :all: (default) or :standard:')
173205

174206
parser_name = subparsers.add_parser(
175207
'name', epilog=epilog_name,
@@ -202,15 +234,29 @@ def make_parser():
202234
parser_update.add_argument(
203235
'--url', type=str, default=None, help='Download URL')
204236

237+
parser_update_latest = subparsers.add_parser(
238+
'update-latest', epilog=epilog_update_latest,
239+
formatter_class=argparse.RawDescriptionHelpFormatter,
240+
help='Update a package to the latest version. This modifies the Sage sources.')
241+
parser_update_latest.add_argument(
242+
'package_name', type=str, help='Package name (:all: for all packages)')
243+
205244
parser_download = subparsers.add_parser(
206245
'download', epilog=epilog_download,
207246
formatter_class=argparse.RawDescriptionHelpFormatter,
208247
help='Download tarball')
209248
parser_download.add_argument(
210-
'package_name', type=str, help='Package name')
249+
'package_name', type=str, help='Package name or :type:')
211250
parser_download.add_argument(
212251
'--allow-upstream', action="store_true",
213252
help='Whether to fall back to downloading from the upstream URL')
253+
254+
parser_upload = subparsers.add_parser(
255+
'upload', epilog=epilog_upload,
256+
formatter_class=argparse.RawDescriptionHelpFormatter,
257+
help='Upload tarball to Sage mirrors')
258+
parser_upload.add_argument(
259+
'package_name', type=str, help='Package name or :type:')
214260

215261
parser_fix_checksum = subparsers.add_parser(
216262
'fix-checksum', epilog=epilog_fix_checksum,
@@ -254,7 +300,7 @@ def run():
254300
if args.subcommand == 'config':
255301
app.config()
256302
elif args.subcommand == 'list':
257-
app.list()
303+
app.list_cls(args.package_class)
258304
elif args.subcommand == 'name':
259305
app.name(args.tarball_filename)
260306
elif args.subcommand == 'tarball':
@@ -263,10 +309,17 @@ def run():
263309
app.apropos(args.incorrect_name)
264310
elif args.subcommand == 'update':
265311
app.update(args.package_name, args.new_version, url=args.url)
312+
elif args.subcommand == 'update-latest':
313+
if args.package_name == ':all:':
314+
app.update_latest_all()
315+
else:
316+
app.update_latest(args.package_name)
266317
elif args.subcommand == 'download':
267-
app.download(args.package_name, args.allow_upstream)
318+
app.download_cls(args.package_name, args.allow_upstream)
268319
elif args.subcommand == 'create':
269320
app.create(args.package_name, args.version, args.tarball, args.type, args.url)
321+
elif args.subcommand == 'upload':
322+
app.upload_cls(args.package_name)
270323
elif args.subcommand == 'fix-checksum':
271324
if args.package_name is None:
272325
app.fix_all_checksums()

0 commit comments

Comments
 (0)