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

Commit 8ec310e

Browse files
author
Matthias Koeppe
committed
src/doc/en/developer/packaging.rst: Explain install-requires.txt (from https://wiki.sagemath.org/ReleaseTours/sage-9.3)
1 parent 18466f0 commit 8ec310e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/doc/en/developer/packaging.rst

+37
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,43 @@ example, the ``scipy`` ``spkg-check.in`` file contains the line
550550
551551
exec sage-python23 spkg-check.py
552552
553+
All normal Python packages must have a file ``install-requires.txt``.
554+
If a Python package is available on PyPI, this file must contain the
555+
name of the package as it is known to PyPI. Optionally,
556+
``install-requires.txt`` can encode version constraints (such as lower
557+
and upper bounds). The constraints are in the format of the
558+
``install_requires`` key of `setup.cfg
559+
<https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html>`_
560+
or `setup.py
561+
<https://packaging.python.org/discussions/install-requires-vs-requirements/#id5>`_.
562+
563+
The files may include comments (starting with ``#``) that explain why a particular lower
564+
bound is warranted or why we wish to include or reject certain versions.
565+
566+
For example:
567+
568+
.. CODE-BLOCK:: bash
569+
570+
$ cat build/pkgs/sphinx/package-version.txt
571+
3.1.2.p0
572+
$ cat build/pkgs/sphinx/install-requires.txt
573+
# gentoo uses 3.2.1
574+
sphinx >=3, <3.3
575+
576+
The comments may include links to Trac tickets, as in the following example:
577+
578+
.. CODE-BLOCK:: bash
579+
580+
$ cat build/pkgs/packaging/install-requires.txt
581+
packaging >=18.0
582+
# Trac #30975: packaging 20.5 is known to work but we have to silence "DeprecationWarning: Creating a LegacyVersion"
583+
584+
The currently encoded version constraints are merely a starting point.
585+
Developers and downstream packagers are invited to refine the version
586+
constraints based on their experience and tests. When a package
587+
update is made in order to pick up a critical bug fix from a newer
588+
version, then the lower bound should be adjusted.
589+
553590
554591
.. _section-spkg-SPKG-txt:
555592

0 commit comments

Comments
 (0)