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

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

Closed
mkoeppe opened this issue Nov 14, 2020 · 207 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Nov 14, 2020

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Nov 14, 2020
@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 15, 2020

Changed dependencies from #30578, #30912 to #30578, #30912, #30719

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 15, 2020

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 15, 2020

Author: Matthias Koeppe

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 15, 2020

Commit: b0f5cd2

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 15, 2020

Last 10 new commits:

e61929dbuild/pkgs/sphinx/install-requires.txt: Update from gentoo
8fe0e35build/pkgs/python_openid: Unused, remove
ba1d913build/pkgs/itsdangerous: Unused, remove
bb6c4aebuild/pkgs/tox/install-requires.txt: New
d507501build/pkgs/networkx/install-requires.txt: Update from gentoo
c3a9352build/pkgs/pathpy/install-requires.txt: Package removed in #30611, remove
ebd4610build/pkgs/pynac/install-requires.txt: New
6ec00ddbuild/pkgs/{numpy,pillow}/install-requires.txt: New
6bff345Merge branch 't/30719/add_build_pkgs_spkg_install_requires_txt_for_all_python_packages' into t/30913/sagelib__add_setup_cfg__install_requires_
b0f5cd2bootstrap: Generate build/pkgs/sagelib/src/setup.cfg with m4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 15, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

6094c68build/pkgs/cypari/install-requires.txt: cypari2, not cypari

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 15, 2020

Changed commit from b0f5cd2 to 6094c68

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 20, 2020

Changed commit from 6094c68 to 411cbfb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 20, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

411cbfbbuild/bin/sage-get-system-packages: Add comment

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 20, 2020

Changed commit from 411cbfb to 3b02c3d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 20, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

3b02c3dbootstrap: Run bootstrap scripts in build/pkgs/*/, create build/pkgs/sagelib/bootstrap

@kiwifb
Copy link
Member

kiwifb commented Nov 20, 2020

comment:10

Will this be able to deal with optional package declarations (in time)?

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 20, 2020

comment:11

The plan for optional packages is that users would install a package such as sagemath-meataxe or sagemath-tdlib in addition to sagemath-standard.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 27, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

95b74e8Merge tag '9.3.beta2' into t/30913/sagelib__add_setup_cfg__install_requires_

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 27, 2020

Changed commit from 3b02c3d to 95b74e8

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 6, 2020

Changed keywords from none to sd111

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 6, 2020

Changed dependencies from #30578, #30912, #30719 to #30578, #30912

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 10, 2020

Changed commit from 95b74e8 to 8b8b9f9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 10, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

99b56f5build/pkgs/sagelib/src/tox.ini: Add environment python-norequirements
8b8b9f9Merge tag '9.3.beta3' into t/30913/sagelib__add_setup_cfg__install_requires_

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 10, 2020

comment:16

Added instructions for testing to the ticket description.
In particular, this reveals the missing dependencies of upstream Python packages tracked in #30922.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 10, 2020

Changed commit from 8b8b9f9 to 3382a47

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 10, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

3382a47build/pkgs/pplpy/install-requires.txt: Switch to git+https link

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 12, 2020

Changed commit from 3382a47 to bf61db4

@mkoeppe
Copy link
Member Author

mkoeppe commented Mar 24, 2021

comment:148

pip likes to use temporary directories, probably in /tmp or /var/tmp

@mkoeppe
Copy link
Member Author

mkoeppe commented Mar 24, 2021

comment:149

Try setting TMPDIR to something elese

@dimpase
Copy link
Member

dimpase commented Mar 24, 2021

comment:150

is TMPDIR an env.var. I can export before running this job? Or is it something pythonic?

@mkoeppe
Copy link
Member Author

mkoeppe commented Mar 24, 2021

comment:151

Just the standard environment variable

@dimpase
Copy link
Member

dimpase commented Mar 25, 2021

comment:152

OK, this run finishes, with some doctest errors, mainly in sphinx/docs related:

$ ./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v -e python-sagewheels-nopypi)'
...
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage/all.py  # 1 doctest failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage/misc/package.py  # 1 doctest failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage/misc/sagedoc.py  # 4 doctests failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage/docs/conf.py  # 1 doctest failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage/interfaces/gap.py  # 1 doctest failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage_setup/find.py  # 1 doctest failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage_docbuild/__init__.py  # 35 doctests failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage_docbuild/sphinxbuild.py  # 13 doctests failed
sage -t --random-seed=0 /home/scratch2/dimpase/sage/sage/src/sage_docbuild/utils.py  # 5 doctests failed

if this is expected, feel free to make it positive review.

@dimpase
Copy link
Member

dimpase commented Mar 25, 2021

Reviewer: Dima Pasechnik

@mkoeppe
Copy link
Member Author

mkoeppe commented Mar 25, 2021

comment:153

Thanks for testing! Yes, this looks as expected. The documentation is not built by this invocation. We should disable the corresponding doctests, for example using #30778 - but that's something for the 9.4 series.

@mkoeppe
Copy link
Member Author

mkoeppe commented Mar 29, 2021

comment:154

Setting priority to blocker to bring this ticket to the attention of the release bot.

@vbraun
Copy link
Member

vbraun commented May 27, 2021

Changed branch from u/mkoeppe/sagelib__add_setup_cfg__install_requires_ to 04da2c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants