Skip to content

Commit 21924f5

Browse files
author
Matthias Koeppe
committed
Update scripts for rename of build/pkgs/*/install-requires.txt to version_requirements.txt
1 parent 1cd4990 commit 21924f5

File tree

12 files changed

+41
-41
lines changed

12 files changed

+41
-41
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,15 @@ CONFIGURE_DEPENDENCIES = \
343343
build/pkgs/*/spkg-configure.m4 \
344344
build/pkgs/*/type build/pkgs/*/SPKG.rst \
345345
build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt \
346-
build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \
346+
build/pkgs/*/version_requirements.txt build/pkgs/*/package-version.txt \
347347
build/pkgs/*/spkg-install build/pkgs/*/spkg-install.in
348348

349349
# SPKG_INFO_DEPENDENCIES is the list of files that influence the run of 'sage-spkg-info' and hence
350350
# the generation of the files generated in 'src/doc' by 'src/doc/bootstrap'.
351351
SPKG_INFO_DEPENDENCIES = \
352352
build/pkgs/*/type build/pkgs/*/SPKG.rst \
353353
build/pkgs/*/requirements.txt \
354-
build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \
354+
build/pkgs/*/version_requirements.txt build/pkgs/*/package-version.txt \
355355
build/pkgs/*/distros/*.txt
356356

357357
configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES)

bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ EOF
105105
SPKG_TREE_VAR="$(sed "s/#.*//;" "$DIR/trees.txt")"
106106
else
107107
SPKG_TREE_VAR=SAGE_LOCAL
108-
if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then
108+
if test -f "$DIR/requirements.txt" -o -f "$DIR/version_requirements.txt"; then
109109
# A Python package
110110
SPKG_TREE_VAR=SAGE_VENV
111111
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4

bootstrap-conda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ echo >&2 $0:$LINENO: generate conda environment files
132132
(
133133
echo >&4 " - pip:"
134134
echo >&5 " - pip:"
135-
for PKG_BASE in $(sage-package list :standard: :optional: --has-file requirements.txt --no-file distros/conda.txt --no-file src; sage-package list :standard: :optional: --has-file install-requires.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src); do
135+
for PKG_BASE in $(sage-package list :standard: :optional: --has-file requirements.txt --no-file distros/conda.txt --no-file src; sage-package list :standard: :optional: --has-file version_requirements.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src); do
136136
PKG_SCRIPTS=build/pkgs/$PKG_BASE
137137
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt
138138
if [ ! -f $SYSTEM_PACKAGES_FILE ]; then
139-
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/install-requires.txt
139+
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/version_requirements.txt
140140
fi
141141
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
142142
if grep -q SAGERUNTIME $PKG_SCRIPTS/dependencies $PKG_SCRIPTS/dependencies_order_only 2>/dev/null; then

build/bin/sage-get-system-packages

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ fi
1414

1515
case "$SYSTEM" in
1616
install-requires)
17-
# Collect install-requires.txt (falling back to requirements.txt) and output it in the format
18-
# needed by setup.cfg [options] install_requires=
19-
SYSTEM_PACKAGES_FILE_NAMES="install-requires.txt requirements.txt"
17+
# Collect version_requirements.txt (falling back to requirements.txt) and output it in the format
18+
# needed by setup.cfg [options] version_requirements=
19+
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
2020
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;"
2121
COLLECT=
2222
;;
2323
install-requires-toml)
24-
# Collect install-requires.txt (falling back to requirements.txt) and output it in the format
24+
# Collect version_requirements.txt (falling back to requirements.txt) and output it in the format
2525
# needed by pyproject.toml [build-system] requires=
26-
SYSTEM_PACKAGES_FILE_NAMES="install-requires.txt requirements.txt"
26+
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
2727
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/^/'/;s/$/',/;"
2828
COLLECT=
2929
;;
3030
pip)
31-
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt install-requires.txt"
31+
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt version_requirements.txt"
3232
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
3333
COLLECT=echo
3434
;;

build/bin/sage-spkg-info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ echo
5454
echo "Version Information"
5555
echo "-------------------"
5656
echo
57-
for a in package-version.txt requirements.txt install-requires.txt; do
57+
for a in package-version.txt requirements.txt version_requirements.txt; do
5858
if [ -f "$PKG_SCRIPTS"/"$a" ]; then
5959
echo "$a::"
6060
echo

build/sage_bootstrap/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def update_latest(self, package_name, commit=False):
258258
pkg = Package(package_name)
259259
dist_name = pkg.distribution_name
260260
if dist_name is None:
261-
log.debug('%s does not have Python distribution info in install-requires.txt' % pkg)
261+
log.debug('%s does not have Python distribution info in version_requirements.txt' % pkg)
262262
return
263263
if pkg.tarball_pattern.endswith('.whl'):
264264
source = 'wheel'
@@ -279,7 +279,7 @@ def update_latest_cls(self, package_name_or_class, commit=False):
279279
'cypari' # Name conflict
280280
]
281281
# Restrict to normal Python packages
282-
pc = PackageClass(package_name_or_class, has_files=['checksums.ini', 'install-requires.txt'])
282+
pc = PackageClass(package_name_or_class, has_files=['checksums.ini', 'version_requirements.txt'])
283283
if not pc.names:
284284
log.warn('nothing to do (does not name a normal Python package)')
285285
for package_name in sorted(pc.names):

build/sage_bootstrap/creator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal'):
110110
Write the file ``dependencies`` and other files for Python packages.
111111
112112
If ``source`` is ``"normal"``, write the files ``spkg-install.in`` and
113-
``install-requires.txt``.
113+
``version_requirements.txt``.
114114
115-
If ``source`` is ``"wheel"``, write the file ``install-requires.txt``.
115+
If ``source`` is ``"wheel"``, write the file ``version_requirements.txt``.
116116
117117
If ``source`` is ``"pip"``, write the file ``requirements.txt``.
118118
@@ -126,12 +126,12 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal'):
126126
if source == 'normal':
127127
with open(os.path.join(self.path, 'spkg-install.in'), 'w+') as f:
128128
f.write('cd src\nsdh_pip_install .\n')
129-
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
129+
with open(os.path.join(self.path, 'version_requirements.txt'), 'w+') as f:
130130
f.write('{0}\n'.format(pypi_package_name))
131131
# Remove this file, which would mark the package as a pip package.
132132
self._remove_files(['requirements.txt'])
133133
elif source == 'wheel':
134-
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
134+
with open(os.path.join(self.path, 'version_requirements.txt'), 'w+') as f:
135135
f.write('{0}\n'.format(pypi_package_name))
136136
# Remove this file, which would mark the package as a pip package.
137137
self._remove_files(['requirements.txt'])

build/sage_bootstrap/package.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, package_name):
4646
self._init_checksum()
4747
self._init_version()
4848
self._init_type()
49-
self._init_install_requires()
49+
self._init_version_requirements()
5050
self._init_dependencies()
5151
self._init_trees()
5252

@@ -355,9 +355,9 @@ def distribution_name(self):
355355
"""
356356
Return the Python distribution name or ``None`` for non-Python packages
357357
"""
358-
if self.__install_requires is None:
358+
if self.__version_requirements is None:
359359
return None
360-
for line in self.__install_requires.split('\n'):
360+
for line in self.__version_requirements.split('\n'):
361361
line = line.strip()
362362
if line.startswith('#'):
363363
continue
@@ -510,12 +510,12 @@ def _init_type(self):
510510
]
511511
self.__type = package_type
512512

513-
def _init_install_requires(self):
513+
def _init_version_requirements(self):
514514
try:
515-
with open(os.path.join(self.path, 'install-requires.txt')) as f:
516-
self.__install_requires = f.read().strip()
515+
with open(os.path.join(self.path, 'version_requirements.txt')) as f:
516+
self.__version_requirements = f.read().strip()
517517
except IOError:
518-
self.__install_requires = None
518+
self.__version_requirements = None
519519

520520
def _init_dependencies(self):
521521
try:

m4/sage_python_package_check.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Determine if the system copy of a python package can be used by sage.
99
#
1010
# This macro uses setuptools.version's pkg_resources to check that the
11-
# "install-requires.txt" file for the named package is satisfied, and
11+
# "version_requirements.txt" file for the named package is satisfied, and
1212
# it can typically fail in four ways:
1313
#
1414
# 1. If --enable-system-site-packages was not passed to ./configure,
@@ -19,7 +19,7 @@
1919
#
2020
# 4. If setuptools is not available to the system python,
2121
#
22-
# 5. If the contents of install-requires.txt are not met (wrong
22+
# 5. If the contents of version_requirements.txt are not met (wrong
2323
# version, no version, etc.) by the system python.
2424
#
2525
# In any of those cases, we set sage_spkg_install_$package to "yes"
@@ -56,7 +56,7 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [
5656
config.venv dnl
5757
2>&AS_MESSAGE_LOG_FD], [
5858
AC_MSG_RESULT(yes)
59-
dnl strip all comments from install-requires.txt; this should leave
59+
dnl strip all comments from version_requirements.txt; this should leave
6060
dnl only a single line containing the version specification for this
6161
dnl package. Afterwards, convert all double-quotes to single quotes.
6262
dnl Both work, but only single quotes are documented. However, at the
@@ -67,7 +67,7 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [
6767
SAGE_PKG_VERSPEC=$(sed \
6868
-e '/^#/d' \
6969
-e "s/\"/'/g" \
70-
"./build/pkgs/$1/install-requires.txt"
70+
"./build/pkgs/$1/version_requirements.txt"
7171
)
7272
AC_MSG_CHECKING([for python package $1 ("${SAGE_PKG_VERSPEC}")])
7373

src/bin/sage-update-version

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ for version_file in "$SAGE_ROOT"/pkgs/*/VERSION.txt; do
4343
fi
4444
done
4545

46-
# Update install-requires.txt for all distribution packages
46+
# Update version_requirements.txt for all distribution packages
4747
( cd "$SAGE_ROOT"/build/pkgs/ && for spkg in sage*; do
48-
if [ -f "$spkg"/install-requires.txt -a -d "$spkg"/src ]; then
48+
if [ -f "$spkg"/version_requirements.txt -a -d "$spkg"/src ]; then
4949
( echo "# This file is updated on every release by the sage-update-version script"
5050
# Normalize the package name to PyPI convention (dashes, not underscores)
5151
if [ "$spkg" = sagelib ]; then
@@ -58,7 +58,7 @@ done
5858
version=${version//.beta/b}
5959
version=${version//.rc/rc}
6060
# ~= asks for a compatible release. https://peps.python.org/pep-0440/#compatible-release
61-
echo "$pkg ~= $version" ) > "$spkg"/install-requires.txt
61+
echo "$pkg ~= $version" ) > "$spkg"/version_requirements.txt
6262
fi
6363
done )
6464

@@ -121,7 +121,7 @@ git commit -m "Updated SageMath version to $SAGE_VERSION" -- \
121121
"$SAGE_SRC/bin/sage-version.sh" \
122122
"$SAGE_ROOT/build/pkgs/configure/checksums.ini" \
123123
"$SAGE_ROOT/build/pkgs/configure/package-version.txt" \
124-
"$SAGE_ROOT/build/pkgs/*/install-requires.txt" \
124+
"$SAGE_ROOT/build/pkgs/*/version_requirements.txt" \
125125
"$SAGE_ROOT"/pkgs/*/VERSION.txt \
126126
"$SAGE_ROOT/.upstream.d/20-github.com-sagemath-sage-releases" \
127127
|| die "Error committing to the repository."

0 commit comments

Comments
 (0)