Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sagemath-standard: Add dependencies typing_extensions, importlib_resources, importlib_metadata #35203

10 changes: 6 additions & 4 deletions build/pkgs/importlib_metadata/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ importlib_metadata: Library to access the metadata for a Python package
Description
-----------

importlib_metadata is a library to access the metadata for a Python package.
It is intended to be ported to Python 3.8.
This is a backport package, supplying access to the functionality of
``importlib.metadata`` including improvements added to subsequent Python versions.


License
-------

Apache Software License
Apache Software License


Upstream Contact
----------------

Home page: http://importlib-metadata.readthedocs.io/
- https://pypi.org/project/importlib-metadata/

- http://importlib-metadata.readthedocs.io/
6 changes: 3 additions & 3 deletions build/pkgs/importlib_metadata/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=importlib_metadata-VERSION.tar.gz
sha1=4a49e8c6d8e2eb02e9ea821444b5ba153d8c34a6
md5=56d34f2e854bb0f318baa9e47aba3439
cksum=3438247256
sha1=b9b1f85f9d7ea8464990aa48078c2bc18c88b17d
md5=a7d0734680f70b03368b69fe3e89dc56
cksum=579037727
upstream_url=https://pypi.io/packages/source/i/importlib_metadata/importlib_metadata-VERSION.tar.gz
4 changes: 3 additions & 1 deletion build/pkgs/importlib_metadata/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
importlib_metadata >=1.7.0
# According to https://pypi.org/project/importlib-metadata/,
# 4.13 provides the features of Python 3.11 importlib.metadata
importlib_metadata >=4.13
2 changes: 1 addition & 1 deletion build/pkgs/importlib_metadata/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
6.0.0
6 changes: 3 additions & 3 deletions build/pkgs/importlib_resources/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=importlib_resources-VERSION.tar.gz
sha1=a8c7a6a976fffb9841c548230cb633eda3111c4f
md5=8afc48c5f3a7c4ba63cb38163340d78b
cksum=196052500
sha1=b793f4fb94148414679e3192e731fef25e3e9bc9
md5=5457c25b89b19fcaca8af03e541dfa41
cksum=527125049
upstream_url=https://pypi.io/packages/source/i/importlib_resources/importlib_resources-VERSION.tar.gz
4 changes: 3 additions & 1 deletion build/pkgs/importlib_resources/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
importlib-resources
# According to https://pypi.org/project/importlib-resources/,
# version 5.7 provides the features of Python 3.11 importlib.resources
importlib_resources >= 5.7
2 changes: 1 addition & 1 deletion build/pkgs/importlib_resources/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.10.0
5.12.0
2 changes: 1 addition & 1 deletion build/pkgs/sagelib/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf singular symmetrica $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup
FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup

----------
All lines of this file are ignored except the first.
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/typing_extensions/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=typing_extensions-VERSION.tar.gz
sha1=9dbf798784009efaef80c8198a75b2a9e519eb95
md5=5cfcb56ea6fc4972c3600c0030f4d136
cksum=386983249
sha1=544dc62dfcd6871ad6ca72f840ecd1b8c29ccf96
md5=03a01698ace869506cab825697dfb7e1
cksum=106787813
upstream_url=https://pypi.io/packages/source/t/typing_extensions/typing_extensions-VERSION.tar.gz
4 changes: 3 additions & 1 deletion build/pkgs/typing_extensions/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
typing-extensions
# According to https://github.com/python/typing_extensions/blob/main/CHANGELOG.md,
# version 4.4.0 adds another Python 3.11 typing backport
typing_extensions >= 4.4.0
2 changes: 1 addition & 1 deletion build/pkgs/typing_extensions/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.0
4.5.0
27 changes: 18 additions & 9 deletions src/doc/en/developer/coding_in_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ doctests.
Some key language and library features have been backported to Python 3.8
using one of two mechanisms:

- ``from __future__ import annotations`` (see
https://docs.python.org/3.7/library/__future__.html) modernizes type
annotations according to PEP 563 (Postponed evaluation of
annotations, see https://www.python.org/dev/peps/pep-0563). All
Sage library code that uses type annotations should include this
``__future__`` import and follow PEP 563.

- The Sage distribution includes the backport packages ``importlib_metadata``
and ``importlib_resources``.
- ``from __future__ import annotations`` (see Python reference for
`__future__ <https://docs.python.org/3.8/library/__future__.html>`_)
modernizes type annotations according to `PEP 563
<https://www.python.org/dev/peps/pep-0563>`_ (Postponed evaluation
of annotations). All Sage library code that uses type annotations
should include this ``__future__`` import and follow PEP 563.

- Backport packages

- `importlib_metadata <../reference/spkg/importlib_metadata>`_
(to be used in place of ``importlib.metadata``),
- `importlib_resources <../reference/spkg/importlib_resources>`_
(to be used in place of ``importlib.resources``),
- `typing_extensions <../reference/spkg/typing_extensions>`_
(to be used in place of ``typing``).

The Sage library declares these packages as dependencies and ensures that
versions that provide features of Python 3.11 are available.

Meta-ticket :trac:`29756` keeps track of newer Python features and serves
as a starting point for discussions on how to make use of them in the
Expand Down
3 changes: 3 additions & 0 deletions src/requirements.txt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dnl ... but building bdist_wheel of cypari2 fails with recent pip... https://git
cysignals==esyscmd(`printf $(sed "s/[.]p.*//;" ../cysignals/package-version.txt)')
Cython==esyscmd(`printf $(sed "s/[.]p.*//;" ../cython/package-version.txt)')
gmpy2==esyscmd(`printf $(sed "s/[.]p.*//;" ../gmpy2/package-version.txt)')
importlib_metadata==esyscmd(`printf $(sed "s/[.]p.*//;" ../importlib_metadata/package-version.txt)')
importlib_resources==esyscmd(`printf $(sed "s/[.]p.*//;" ../importlib_resources/package-version.txt)')
jinja2==esyscmd(`printf $(sed "s/[.]p.*//;" ../jinja2/package-version.txt)')
dnl ... for sage_setup.autogen.interpreters
jupyter_core==esyscmd(`printf $(sed "s/[.]p.*//;" ../jupyter_core/package-version.txt)')
Expand All @@ -32,6 +34,7 @@ pplpy==esyscmd(`printf $(sed "s/[.]p.*//;" ../pplpy/package-version.txt)')
primecountpy==esyscmd(`printf $(sed "s/[.]p.*//;" ../primecountpy/package-version.txt)')
pycygwin==esyscmd(`printf $(sed "s/[.]p.*//;" ../pycygwin/package-version.txt)'); sys_platform == 'cygwin'
requests==esyscmd(`printf $(sed "s/[.]p.*//;" ../requests/package-version.txt)')
typing_extensions==esyscmd(`printf $(sed "s/[.]p.*//;" ../typing_extensions/package-version.txt)')

dnl From Makefile.in: SAGERUNTIME
ipython==esyscmd(`printf $(sed "s/[.]p.*//;" ../ipython/package-version.txt)')
Expand Down
3 changes: 3 additions & 0 deletions src/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dnl From build/pkgs/sagelib/dependencies
cysignals \
cython \
gmpy2 \
importlib_metadata \
importlib_resources \
jinja2 \
jupyter_core \
lrcalc_python \
Expand All @@ -48,6 +50,7 @@ dnl From build/pkgs/sagelib/dependencies
pplpy \
primecountpy \
requests \
typing_extensions \
| sed "2,\$s/^/ /;"')dnl'
dnl From Makefile.in: SAGERUNTIME
esyscmd(`sage-get-system-packages install-requires \
Expand Down