Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6127016
bootstrap-conda: Generate environment files with hard-coded Python mi…
mkoeppe Oct 5, 2023
03a2acf
src/doc/en/installation/conda.rst: Update for versioned environment-.…
mkoeppe Oct 8, 2023
5c0bac8
bootstrap, Makefile (bootstrap-clean): Update for versioned environme…
mkoeppe Sep 27, 2023
c2be172
tox.ini (local-conda-environment): Update for versioned environment-.…
mkoeppe Sep 27, 2023
b3ba591
.github/workflows/ci-conda.yml: Update for versioned environment*.yml
mkoeppe Sep 27, 2023
018de2b
.github/workflows/ci-conda.yml: Fix environment name
mkoeppe Oct 3, 2023
fc9bab5
tox.ini (conda-environment-{src,dev}), .github/workflows/ci-conda.yml…
mkoeppe Sep 27, 2023
b02ef8e
bootstrap-conda: Refactor using sage-get-system-packages
mkoeppe Oct 5, 2023
235ce91
bootstrap-conda: Only one 'python' line + speed up
mkoeppe Oct 9, 2023
3332a89
build/sage_bootstrap/download/mirror_list.py: Remove sagepad.org
mkoeppe Oct 9, 2023
dd939ff
sage_bootstrap.{tarball, download.mirror_list}: Lower layout of the m…
mkoeppe Oct 9, 2023
2dfe081
sage_bootstrap.download.mirror_list: Delay downloading/reading/rankin…
mkoeppe Oct 9, 2023
a37f4fd
sage_bootstrap.download.mirror_list: Use master list of download sour…
mkoeppe Oct 9, 2023
2323480
src/bin/sage-update-version: Update .upstream.d/20-github.amrom.workers.dev-sagemat…
mkoeppe Oct 9, 2023
7e65260
sage_bootstrap.download.mirror_list: Skip empty lines earlier
mkoeppe Oct 9, 2023
371be50
src/bin/sage-update-version: Also commit
mkoeppe Oct 9, 2023
423e48a
build/bin/write-dockerfile.sh: ADD .upstream.d
mkoeppe Oct 9, 2023
73ab316
bootstrap-conda (src/environment-dev*.yml): Suppress pip section, for…
mkoeppe Oct 10, 2023
f429993
.ci/retrofit-worktree.sh: New, factored out from .github/workflows/bu…
mkoeppe Oct 10, 2023
47f6a98
src/tox.ini (pyright): Remove old version pin, do not rely on global …
mkoeppe Oct 10, 2023
47e2783
.github/workflows/build.yml: Simplify use of pyright by going through…
mkoeppe Oct 10, 2023
94c8b88
Fixup
mkoeppe Oct 11, 2023
8bf3bcb
src/tox.ini (pyright): Do not restrict to subdirectories by default
mkoeppe Oct 11, 2023
81e1afa
src/tox.ini (pyright): Pin to 1.1.331 (latest)
mkoeppe Oct 11, 2023
e3dce3f
conda: Do not pin setuptools, instead add legacy editable to install …
mkoeppe Oct 12, 2023
c60de9a
build/pkgs/setuptools_wheel: Make distros a symlink too
mkoeppe Sep 27, 2023
756e5c4
src/doc/en/installation/conda.rst: Restore 'bootstrap' in instruction…
mkoeppe Oct 11, 2023
ddbbdc5
pkgs/sage-conf_conda/setup.py: Always run configure
mkoeppe Oct 11, 2023
d0cae80
pkgs/sage-conf_conda/setup.py: Remove 'reusing configured SAGE_ROOT' …
mkoeppe Oct 12, 2023
c555723
Merge branch 'tox_pyright_update' into ci_streamline
mkoeppe Oct 12, 2023
19f029b
Merge branch 'conda_legacy_editable' into ci_streamline
mkoeppe Oct 12, 2023
68e9997
Merge branch 'bootstrap_conda_refactor' into ci_streamline
mkoeppe Oct 12, 2023
66a8be4
Merge branch 'gh_actions_release' into ci_streamline
mkoeppe Oct 12, 2023
2e11b0f
Merge branch 'ci_refactor_build' into ci_streamline
mkoeppe Oct 12, 2023
0bfb487
build/bin/write-dockerfile.sh, tox.ini (docker-incremental): Make inc…
mkoeppe Oct 11, 2023
8e25cbd
.github/workflows/build.yml: Merge doc-build.yml, doc-build-pdf.yml
mkoeppe Oct 11, 2023
459da44
.github/workflows/build.yml: Merge ci-linux-incremental.yml
mkoeppe Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sage_bootstrap.download.mirror_list: Use master list of download sour…
…ces in SAGE_ROOT/.upstream.d
  • Loading branch information
Matthias Koeppe committed Oct 9, 2023
commit a37f4fdd8261e1871f446593d62cb51903a5dae8
2 changes: 2 additions & 0 deletions .upstream.d/10-SAGE_SERVER
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# When SAGE_SERVER is set, it should be an https/https server in the format of Sage mirrors.
${SAGE_SERVER}/spkg/upstream/${SPKG}/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Upstream packages as uploaded as GitHub release assets.
https://github.com/sagemath/sage/releases/download/10.1/
1 change: 1 addition & 0 deletions .upstream.d/30-www.sagemath.org-mirror_list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://www.sagemath.org/mirror_list
56 changes: 50 additions & 6 deletions build/sage_bootstrap/download/mirror_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
log = logging.getLogger()

from sage_bootstrap.compat import urllib, urlparse
from sage_bootstrap.env import SAGE_DISTFILES
from sage_bootstrap.env import SAGE_DISTFILES, SAGE_ROOT

from fcntl import flock, LOCK_SH, LOCK_EX
from errno import ENOLCK
Expand All @@ -41,16 +41,60 @@ class MirrorListException(RuntimeError):
pass


MIRRORLIST_FILENAME = os.path.join(SAGE_DISTFILES, 'mirror_list')
class MirrorList(object):

def __init__(self):
self.sources = []
upstream_d = os.path.join(SAGE_ROOT, '.upstream.d')
for fname in sorted(os.listdir(upstream_d)):
if '~' in fname or '#' in fname:
# Ignore auto-save and backup files
continue
try:
with open(os.path.join(upstream_d, fname), 'r') as f:
for line in f:
line = line.replace('${SAGE_ROOT}', SAGE_ROOT)
line = line.replace('${SAGE_DISTFILES}', SAGE_DISTFILES)
if '${SAGE_SERVER}' in line:
SAGE_SERVER = os.environ.get("SAGE_SERVER", "")
if not SAGE_SERVER:
continue
line = line.replace('${SAGE_SERVER}',)
line = line.strip()
if line.startswith('#'):
continue
if not line:
continue
if line.endswith('mirror_list'):
cache_filename = os.path.join(SAGE_DISTFILES, line.rpartition('/')[2])
self.sources.append(MirrorList_from_url(line, cache_filename))
else:
self.sources.append([line])
except IOError:
# Silently ignore files that do not exist
pass

class MirrorList(object):
def __iter__(self):
"""
Iterate through the list of mirrors.

This is the main entry point into the mirror list. Every
script should just use this function to try mirrors in order
of preference. This will not just yield the official mirrors,
but also urls for packages that are currently being tested.
"""
for source in self.sources:
for mirror in source:
yield mirror


class MirrorList_from_url(object):

URL = 'http://www.sagemath.org/mirror_list'
MAXAGE = 24*60*60 # seconds

def __init__(self):
self.filename = MIRRORLIST_FILENAME
def __init__(self, url, filename):
self.url = url
self.filename = filename
self._mirrors = None

@property
Expand Down