Skip to content

sagelib: Generate pyproject.toml and setup.cfg [install_requires], requirements.txt, Pipfile, and src/Pipfile #30913

@mkoeppe

Description

@mkoeppe

After #29500, it is possible to install Python packages built by the Sage distribution into user-defined venvs.

As of Sage 9.3.beta8, sagelib is published as a source distribution on PyPI (https://pypi.org/project/sagemath-standard), but the package does not have proper dependency information yet.

As part of bootstrap, we now generate (1) the pyproject.toml (PEP 517 metadata) and install_requires information, (2) requirements.txt and (3) Pipfile using m4 from the information added in #30719. These files provide 3 distinct ways of setting up a user-defined venv.

(Adding pyproject.toml does not change how the Sage distribution installs sagelib because build/pkgs/sagelib/spkg-install uses setup.py install directly.)

To test - use ./bootstrap and then configure and build the Sage distribution. Then follow the instructions in build/pkgs/sagelib/src/tox.ini:

    #
    # SUPPORTED ENVIRONMENTS:
    #
    # Build dependencies according to requirements.txt (all versions fixed).
    # Use ONLY the wheels built and stored by the Sage distribution (no PyPI):
    #
    #   ./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v -e python-sagewheels-nopypi)'
    #
    python-sagewheels-nopypi,
    #
    # Build and test without using the concrete dependencies specified by requirements.txt,
    # using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only:
    # Still use ONLY the wheels built and stored by the Sage distribution (no PyPI).
    #
    #   ./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v -e python-sagewheels-nopypi-norequirements)'
    #
    python-sagewheels-nopypi-norequirements,
    #

Related or follow-up tickets:

References:

CC: @dimpase @tobiasdiez @jhpalmieri @videlec @kiwifb @malb

Component: build

Keywords: sd111

Author: Matthias Koeppe

Branch/Commit: 04da2c6

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/30913

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions