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

pkgs/sagemath-*/tox.ini: Create environment that uses Sage's python as the basepython, fix sagemath-standard deps #32716

Closed
mkoeppe opened this issue Oct 18, 2021 · 60 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 18, 2021

Newer versions of tox seem to provision python 3.10 when the environment python is used, but then our wheels don't necessarily fit.

For this reason, the examples shown in the developer's manual hardcoded the Python version (tox -e py39).

We now define tox environments sagepython in tox.ini, which takes Python as SAGE_VENV/bin/python3 and change the manual to use this environment in examples, such as:

./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard && SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython-sagewheels-nopypi)'

(to be run after make build)

Depends on #33936

CC: @dimpase @kwankyu

Component: refactoring

Author: Matthias Koeppe

Branch: ca9d6ce

Reviewer: Dima Pasechnik

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

@mkoeppe mkoeppe added this to the sage-9.5 milestone Oct 18, 2021
@mkoeppe mkoeppe changed the title pkg/sagemath-standard/tox.ini: Use Sage's python by default pkgs/sagemath-standard/tox.ini: Use Sage's python by default Oct 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Jan 10, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 7, 2022
@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 7, 2022

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 7, 2022

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 7, 2022

Commit: 9db6b2f

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 7, 2022

New commits:

5ce30b8pkgs/sage-setup, sagemath-{objects,categories,standard}: Add tox environment sagepython
9db6b2fsrc/doc/en/developer/packaging_sage_library.rst: Use sagepython instead of hardcoded py39

@mkoeppe mkoeppe changed the title pkgs/sagemath-standard/tox.ini: Use Sage's python by default pkgs/sagemath-standard/tox.ini: Create environment that uses Sage's python as the basepython May 7, 2022
@mkoeppe

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jun 10, 2022

comment:8

command in the ticket description fails with

WARNING: Url 'file:///home/scratch/scratch2/dimpase/sage/sagetrac-mirror/pkgs/sagemath-standard/../../../../venv/var/lib/sage/wheels' is ignored: it is neither a file nor a directory.
ERROR: Could not find a version that satisfies the requirement sage-conf==9.7.beta1
ERROR: No matching distribution found for sage-conf==9.7.beta1
ERROR: invocation failed (exit code 1)
ERROR: could not install deps [-rrequirements.txt]; v = InvocationError('/home/scratch/scratch2/dimpase/sage/sagetrac-mirror/pkgs/sagemath-standard/.tox/sagepython-sagewheels-nopypi/bin/python -m pip install -rrequirements.txt', 1)
sagepython-sagewheels-nopypi finish: getenv /home/scratch/scratch2/dimpase/sage/sagetrac-mirror/pkgs/sagemath-standard/.tox/sagepython-sagewheels-nopypi after 0.69 seconds
...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 10, 2022

comment:9

Did you run make build as the manual explains?

@mkoeppe

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jun 13, 2022

comment:11

besides make build, I also needed to apply

diff --git a/build/pkgs/sage_conf/install-requires.txt b/build/pkgs/sage_conf/install-requires.txt
index 83ad7e641fa..3d4ff51d565 100644
--- a/build/pkgs/sage_conf/install-requires.txt
+++ b/build/pkgs/sage_conf/install-requires.txt
@@ -1 +1 @@
-sage-conf ~= 9.5.b6
+sage-conf
diff --git a/build/pkgs/sage_setup/install-requires.txt b/build/pkgs/sage_setup/install-requires.txt
index 01a931f5eb5..9d4666c07f4 100644
--- a/build/pkgs/sage_setup/install-requires.txt
+++ b/build/pkgs/sage_setup/install-requires.txt
@@ -1 +1 @@
-sage-setup ~= 9.5.b6
+sage-setup

that 9.5.b6 seemed to come from an obsolete workaround anyway.

@dimpase
Copy link
Member

dimpase commented Jun 13, 2022

comment:12

And after these changes, it errors out (much later) with

ModuleNotFoundError: No module named 'primecountpy'
ERROR: InvocationError for command /home/scratch/scratch2/dimpase/sage/sagetrac-mirror/pkgs/sagemath-standard/.tox/sagepython-sagewheels-nopypi/bin/python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all; print(sage.all.__file__)' (exited with code 1)

@dimpase
Copy link
Member

dimpase commented Jun 13, 2022

comment:13

the latter is probably a config error, as the module is there and well:

sage: import primecountpy
sage: primecountpy.primecount.prime_pi(100)
25

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 17, 2022

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

b030e7aMerge tag '9.7.beta2' into t/32716/pkgs_sagemath_standard_tox_ini__use_sage_s_python_by_default

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 2, 2022

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

5ea0035src/requirements.txt.m4, src/setup.cfg.m4 (install_requires): Add lrcalc_python
7b17c2dSplit sage_docbuild.conf to sage.misc.sagedoc_conf
282270fFix docs
c2766bfMove skip_member() to sage_docbuild
4296851Move the remnants of skip_member from sagedoc_conf
45f9ff3Merge branch 'develop'
0a02496Change assert back to if
1c2f41bMerge #33936

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 2, 2022

comment:43

Replying to @dimpase:

I'm trying the change for lrcalc analogous to the one for primecountpy.

Indeed, that was missing too, fixed now.

@mkoeppe mkoeppe changed the title pkgs/sagemath-*/tox.ini: Create environment that uses Sage's python as the basepython pkgs/sagemath-*/tox.ini: Create environment that uses Sage's python as the basepython, fix sagemath-standard deps Jul 2, 2022
@dimpase
Copy link
Member

dimpase commented Jul 3, 2022

comment:46

Replying to @dimpase:

I'm trying the change for lrcalc analogous to the one for primecountpy.

that appeared to suffice (but now the branch got updated)

@dimpase
Copy link
Member

dimpase commented Jul 3, 2022

comment:47

what I don't like are explicit versions of sage-conf and sage-setup in requirements.txt

Obviously there should be an automated way.

@dimpase
Copy link
Member

dimpase commented Jul 3, 2022

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Jul 3, 2022

comment:48

OK, otherwise it looks good. Perhaps deal with versions mentioned in the last comment on another ticket (unless it can be trivially fixed).

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 3, 2022

comment:49

Replying to @dimpase:

what I don't like are explicit versions of sage-conf and sage-setup in requirements.txt

Obviously there should be an automated way.

src/requirements.txt is already generated from src/requirements.txt.m4

If you mean build/pkgs/sage_conf/install-requires.txt and build/pkgs/sage_setup/install-requires.txt, yes, that will need a better solution but it's way beyond the scope of this ticket

@dimpase
Copy link
Member

dimpase commented Jul 3, 2022

comment:51

OK

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 3, 2022

comment:52

Thanks!

@vbraun
Copy link
Member

vbraun commented Jul 8, 2022

comment:53

Merge failure on top of:

662aaf2 Trac #32423: Update numpy to 1.22.x, scipy 1.8.x, networkx 2.8.x

d98aa73 Trac #29549: bootstrap: Clean up use of gettextize

24b4eeb Trac #13321: FreeModule.hom stores its matrix over the wrong ring

93357f3 Trac #34104: Build & Test workflow: Run apt-get update first

23e4bbe Trac #34092: Docbuild workflow broken because furo is too new

9440e71 Trac #34088: cygwin python3 missing ensurepip

9879ff4 Trac #33936: Remove runtime dependency on sage_docbuild introduced in #33763

55d05c9 Trac #31403: giac: Make cliquer a dependency, libnauty an optional dependency

843eb03 Updated SageMath version to 9.7.beta4

merge was not clean: conflicts in pkgs/sagemath-standard/tox.ini

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 8, 2022

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

ca9d6ceMerge tag '9.7.beta4' into t/32716/pkgs_sagemath_standard_tox_ini__use_sage_s_python_by_default

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 8, 2022

Changed commit from 1c2f41b to ca9d6ce

@vbraun
Copy link
Member

vbraun commented Jul 10, 2022

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 27, 2022

Changed commit from ca9d6ce to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 27, 2022

comment:57

Replying to @mkoeppe:

Replying to @dimpase:

what I don't like are explicit versions of sage-conf and sage-setup in requirements.txt

Obviously there should be an automated way.

src/requirements.txt is already generated from src/requirements.txt.m4

If you mean build/pkgs/sage_conf/install-requires.txt and build/pkgs/sage_setup/install-requires.txt, yes, that will need a better solution but it's way beyond the scope of this ticket

Implemented now in #33817

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

3 participants