Add src/requirements.txt for installation of sagelib in a venv
mkoeppe opened this issue · 60 comments
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
In this ticket, we create build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt to facilitate installing sagelib into such a venv. (This file duplicates some information also available in build/pkgs; #29041 will rectify this.)
A virtual environment using it can be created and doctested using:
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
(Reusing wheels built by the Sage distribution requires to do sage -i pip2pi first - this is from #30527.)
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environment
- #28752 Make sagelib pip-installable in a conda environment
Follow-up tickets:
- #30371 In-place (editable) installs of sagelib in a venv
- #29041 at
./bootstraptime, generaterequirements.txt,constraints.txt,setup.cfg [install_requires],Pipfilefrombuild/pkgs - add documentation on how to set up the virtual environment, using either plain
python -m venv,virtualenv(20.x), orpipenv.
Depends on #30527
Depends on #30013
CC: @tobiasdiez @kiwifb @jhpalmieri @videlec
Component: build
Keywords: sd111
Branch/Commit: u/mkoeppe/add-src-requirements-txt @ 9ad6b36
Issue created by migration from https://trac.sagemath.org/ticket/30578
Description changed:
---
+++
@@ -1,6 +1,7 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
In this ticket, we create `src/requirements.txt` to facilitate this.
+(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
We add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
What do you think about generating the requirements.txt file from a pipfile: https://pipenv-fork.readthedocs.io/en/latest/advanced.html#generating-a-requirements-txt? (Maybe as part of this ticket or as #29041)
Last 10 new commits:
0a64674 | build/pkgs/gambit/spkg-install.in: Install via bdist_wheel |
ca58693 | build/pkgs/pillow/spkg-install.in: Install via bdist_wheel |
207d80f | build/pkgs/pip2pi: New |
2555e19 | build/make/install: At the end, update the repository index |
5a747c4 | build/bin/sage-pip-{install,uninstall}: Remove pip2 support |
e66243f | Merge branch 't/29500/install_all_python_packages_via_pip_wheel__create_pep_503_simple_repository_for_wheels' into t/30527/pep-503-simple-repository-for-wheels |
9937126 | Merge branch 't/30527/pep-503-simple-repository-for-wheels' into t/30371/public/build/inplace |
1a39442 | build/pkgs/sagelib/src/setup.py: Replace symlink to SAGE_SRC/setup.py by a copy |
67c56a6 | src/requirements.txt, src/MANIFEST.in: Move here from build/pkgs/sagelib/src, leave symlinks behind |
1d88afe | WIP |
Commit: 1d88afe
Branch pushed to git repo; I updated commit sha1. New commits:
033a95a | sage_setup.command.sage_install: Fixup: Remove cleaning code (moved to sage_install_and_clean) |
Description changed:
---
+++
@@ -3,7 +3,10 @@
In this ticket, we create `src/requirements.txt` to facilitate this.
(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
-We add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
+We add a tox environment to `src/tox.ini`, enabling the command
+`../sage -sh -c 'tox -e develop'` (with #30410: `../sage -tox -e develop`) for building sagelib in a venv.
+
+We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
The existing `src/setup.py` is copied into `build/pkgs/sagelib/src` to replace the symlink. In this way, the changes to `src/setup.py` made in this ticket do not affect the existing build process of the Sage library.
Branch pushed to git repo; I updated commit sha1. New commits:
4ed815a | src/tox.ini (develop): New |
Branch pushed to git repo; I updated commit sha1. New commits:
85175ab | src/setup.py: Switch to setuptools, add setup.cfg, install-requires.txt |
Branch pushed to git repo; I updated commit sha1. New commits:
9ee2110 | build/bin/sage-dist-helpers: Also use $sudo for storing the wheel file |
d7aac84 | src/doc/en/developer/packaging.rst: Update sdh_... documentation |
9b7c7a0 | build/bin/sage-pip-{install,uninstall}: Fix typo in comment |
4135e8b | build/bin/sage-pip-install: Remove an outdated comment |
f2e7075 | Merge tag '9.2.beta13' into t/29500/install_all_python_packages_via_pip_wheel__create_pep_503_simple_repository_for_wheels |
c2efa14 | Merge branch 't/29500/install_all_python_packages_via_pip_wheel__create_pep_503_simple_repository_for_wheels' into t/30658/conda_forge_ubuntu_standard__pillow_fails_to_install__follow_up_ |
ff0c973 | build/pkgs/pillow/spkg-install.in: Fix up 'setup.py bdist_wheel' command |
63490fd | Merge branch 't/30658/conda_forge_ubuntu_standard__pillow_fails_to_install__follow_up_' into t/30578/add-src-requirements-txt |
Branch pushed to git repo; I updated commit sha1. New commits:
5a2491a | Merge branch 't/29500/install_all_python_packages_via_pip_wheel__create_pep_503_simple_repository_for_wheels' into t/30527/pep-503-simple-repository-for-wheels |
4e3a2c3 | Merge branch 't/30527/pep-503-simple-repository-for-wheels' into t/30578/add-src-requirements-txt |
Branch pushed to git repo; I updated commit sha1. New commits:
659f723 | Merge tag '9.2.rc2' into t/30578/add-src-requirements-txt |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
f82f345 | Merge branch 't/22731/22731' into t/30578/add-src-requirements-txt |
7980130 | Merge branch 't/30779/duplicate_src_setup_py' into t/30780/sage_setup__separate_installing_and_cleaning |
9b95628 | sage_setup.command.sage_install.sage_install: Rename to sage_install_and_clean, update use it in build/pkgs/sagelib/src/setup.py; refactor through new class sage_install |
ad9402f | sage_setup.command.sage_install: Fixup: Remove cleaning code (moved to sage_install_and_clean) |
e2fa705 | Merge branch 't/30780/sage_setup__separate_installing_and_cleaning' into t/30578/add-src-requirements-txt |
3557bb8 | src/requirements.txt, src/MANIFEST.in: Move here from build/pkgs/sagelib/src, leave symlinks behind |
c584408 | WIP |
343ebfb | src/requirements.txt: Add sage_conf |
1e766ec | src/tox.ini (develop): New |
22a92ce | src/setup.py: Switch to setuptools, add setup.cfg, install-requires.txt |
Description changed:
---
+++
@@ -4,7 +4,7 @@
(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
We add a tox environment to `src/tox.ini`, enabling the command
-`../sage -sh -c 'tox -e develop'` (with #30410: `../sage -tox -e develop`) for building sagelib in a venv.
+`../sage -sh -c 'tox -e develop'` (with #30410: `../sage -tox -e develop`) for building sagelib in a venv. (This requires `sage -i pip2pi` from #30527.)
We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
Branch pushed to git repo; I updated commit sha1. New commits:
9e9b419 | src/requirements.txt, src/setup.cfg: Fix up |
Description changed:
---
+++
@@ -4,7 +4,7 @@
(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
We add a tox environment to `src/tox.ini`, enabling the command
-`../sage -sh -c 'tox -e develop'` (with #30410: `../sage -tox -e develop`) for building sagelib in a venv. (This requires `sage -i pip2pi` from #30527.)
+`../sage -tox -e develop` for building sagelib in a venv. (This requires `sage -i pip2pi` from #30527.)
We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
Description changed:
---
+++
@@ -1,15 +1,17 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
-In this ticket, we create `src/requirements.txt` to facilitate this.
+In this ticket, we create `build/pkgs/sagelib/src/requirements.txt ->
+ src/requirements.txt` to facilitate this.
(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
-We add a tox environment to `src/tox.ini`, enabling the command
-`../sage -tox -e develop` for building sagelib in a venv. (This requires `sage -i pip2pi` from #30527.)
+A virtual environment using it can be created using:
+./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
+(This requires `sage -i pip2pi` from #30527.)
+
+
+(We also add a tox environment `develop` to `src/tox.ini`, enabling the command `../sage -tox -e develop` for building sagelib in a venv - but this needs further work in #30371.)
We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
-
-The existing `src/setup.py` is copied into `build/pkgs/sagelib/src` to replace the symlink. In this way, the changes to `src/setup.py` made in this ticket do not affect the existing build process of the Sage library.
-
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environmentDescription changed:
---
+++
@@ -1,8 +1,7 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
-In this ticket, we create `build/pkgs/sagelib/src/requirements.txt ->
- src/requirements.txt` to facilitate this.
-(This duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
+In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate this.
+(This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
A virtual environment using it can be created using:
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'Description changed:
---
+++
@@ -4,7 +4,10 @@
(This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
A virtual environment using it can be created using:
+
+```
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
+```
(This requires `sage -i pip2pi` from #30527.)
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
f6f1e97 | Merge branch 't/22731/22731' into t/30578/add-src-requirements-txt |
1a93d0d | Merge branch 't/30780/sage_setup__separate_installing_and_cleaning' into t/30578/add-src-requirements-txt |
a796d49 | src/requirements.txt, src/MANIFEST.in: Move here from build/pkgs/sagelib/src, leave symlinks behind |
aebb1ce | WIP |
95f02a1 | src/requirements.txt: Add sage_conf |
8e12b7c | src/tox.ini (develop): New |
9ddaf26 | src/setup.py: Switch to setuptools, add setup.cfg, install-requires.txt |
8a5d01f | src/requirements.txt, src/setup.cfg: Fix up |
7f9388d | build/pkgs/sagelib/src: Add more symlinks to SAGE_ROOT/src |
d3f3683 | WIP |
Author: Matthias Koeppe
Now, with #30013 merged, the correct sage script is executed in the venv created by tox.
What remains to be done is to add more packages to requirements.txt - in particular ipywidgets so that the doctester can run.
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
842995f | src/bin/sage-venv-config: Add comment |
1a518c0 | src/bin/sage: Set SAGE_VENV from sage-venv-config |
d372ecf | src/bin/sage-env: Put $SAGE_VENV/bin before $SAGE_LOCAL/bin in PATH |
0140f84 | src/bin/sage-src-env-config.in: New, sourced in src/bin/sage |
948fb49 | Merge branch 'u/mkoeppe/src_bin_sage_env__make_sure__sage_venv_bin_is_at_the_beginning_of_the_path' of git://trac.sagemath.org/sage into t/30578/add-src-requirements-txt |
e96dc7a | src/requirements.txt, src/MANIFEST.in: Move here from build/pkgs/sagelib/src, leave symlinks behind |
367fd3e | src/tox.ini (develop): New |
0c5a1a1 | WIP |
7121cb7 | src/requirements.txt: Add sage_conf |
8c03c6b | src/setup.py: Switch to setuptools, add setup.cfg, install-requires.txt |
Description changed:
---
+++
@@ -1,19 +1,13 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
-In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate this.
-(This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
+In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate installing sagelib into such a venv. (This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
-A virtual environment using it can be created using:
+A virtual environment using it can be created and doctested using:
```
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
```
-(This requires `sage -i pip2pi` from #30527.)
-
-
-(We also add a tox environment `develop` to `src/tox.ini`, enabling the command `../sage -tox -e develop` for building sagelib in a venv - but this needs further work in #30371.)
-
-We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
+(Reusing wheels built by the Sage distribution requires to do `sage -i pip2pi` - from #30527.)
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environment
@@ -22,3 +16,5 @@
Follow-up tickets:
- #30371 In-place (editable) installs of sagelib in a venv
- #29041 at `./bootstrap` time, generate `requirements.txt`, `constraints.txt`, `setup.cfg [install_requires]`, `Pipfile` from `build/pkgs`
+- add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
+This works; only minor issues in doctests remain.
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/sage/interfaces/gap_workspace.py", line 55, in sage.interfaces.gap_workspace.gap_workspace_file
Failed example:
name1 = Popen([sys.executable, '-c', cmd], stdout=PIPE).communicate()[0]
Expected nothing
Got:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/sagelib/src/sage/all.py", line 125, in <module>
import sage.misc.lazy_import
ModuleNotFoundError: No module named 'sage.misc.lazy_import'
There are also some doctest errors in the pexpect interfaces for singular and gap.
Description changed:
---
+++
@@ -1,13 +1,19 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
-In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate installing sagelib into such a venv. (This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
+In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate this.
+(This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
-A virtual environment using it can be created and doctested using:
+A virtual environment using it can be created using:
```
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
```
-(Reusing wheels built by the Sage distribution requires to do `sage -i pip2pi` - from #30527.)
+(This requires `sage -i pip2pi` from #30527.)
+
+
+(We also add a tox environment `develop` to `src/tox.ini`, enabling the command `../sage -tox -e develop` for building sagelib in a venv - but this needs further work in #30371.)
+
+We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environment
@@ -16,5 +22,3 @@
Follow-up tickets:
- #30371 In-place (editable) installs of sagelib in a venv
- #29041 at `./bootstrap` time, generate `requirements.txt`, `constraints.txt`, `setup.cfg [install_requires]`, `Pipfile` from `build/pkgs`
-- add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
-Description changed:
---
+++
@@ -1,19 +1,13 @@
After #30527, it is possible to install Python packages built by the Sage distribution into user-defined venvs.
-In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate this.
-(This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
+In this ticket, we create `build/pkgs/sagelib/src/requirements.txt -> src/requirements.txt` to facilitate installing sagelib into such a venv. (This file duplicates some information also available in `build/pkgs`; #29041 will rectify this.)
-A virtual environment using it can be created using:
+A virtual environment using it can be created and doctested using:
```
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
```
-(This requires `sage -i pip2pi` from #30527.)
-
-
-(We also add a tox environment `develop` to `src/tox.ini`, enabling the command `../sage -tox -e develop` for building sagelib in a venv - but this needs further work in #30371.)
-
-We also add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
+(Reusing wheels built by the Sage distribution requires to do `sage -i pip2pi` - from #30527.)
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environment
@@ -22,3 +16,5 @@
Follow-up tickets:
- #30371 In-place (editable) installs of sagelib in a venv
- #29041 at `./bootstrap` time, generate `requirements.txt`, `constraints.txt`, `setup.cfg [install_requires]`, `Pipfile` from `build/pkgs`
+- add documentation on how to set up the virtual environment, using either plain `python -m venv`, `virtualenv` (20.x), or `pipenv`.
+ The fpylll package unfortunately does not install because it does not declare its build dependencies correctly. Reported upstream: fplll/fpylll#185
Branch pushed to git repo; I updated commit sha1. New commits:
db148ac | src/requirements.txt: Disable fpylll |
Branch pushed to git repo; I updated commit sha1. New commits:
9ad6b36 | build/pkgs/sagelib/src/setup.cfg: Remove |
Description changed:
---
+++
@@ -7,7 +7,7 @@
```
./sage -sh -c '(cd build/pkgs/sagelib/src && tox -v -v -v)'
```
-(Reusing wheels built by the Sage distribution requires to do `sage -i pip2pi` - from #30527.)
+(Reusing wheels built by the Sage distribution requires to do `sage -i pip2pi` first - this is from #30527.)
Related:
- #28746 Developer's Guide: Add instructions for sagelib development in a conda environmentChanged keywords from none to sd111
Changed author from Matthias Koeppe to none