Skip to content

Commit

Permalink
Trac #33613: Add pip packages to conda environments, add missing cond…
Browse files Browse the repository at this point in the history
…a.txt files

We have a number of pip-installable optional packages, for which there
is no conda package.

Here we add a mechanism to add such packages using a `pip: ` line
in `src/environment-optional.yml` and `src/environment-dev.yml`
(#33740).

We also add lots of `conda.txt` files.

To test, follow the instructions in
https://doc.sagemath.org/html/en/installation/conda.html#using-conda-to-
provide-all-dependencies-for-the-sage-library-experimental
using `src/environment-optional.yml` or `src/environment-dev.yml`

(A use case for the pip line in `src/environment-dev.yml` is #34524: Pip
package `git_trac_command`.)

URL: https://trac.sagemath.org/33613
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Sep 19, 2022
2 parents 92b1db1 + 0e4a696 commit 700a1f5
Show file tree
Hide file tree
Showing 55 changed files with 77 additions and 2 deletions.
23 changes: 23 additions & 0 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,26 @@ echo >&2 $0:$LINENO: generate conda environment files
echo " - $pkg"
done
) > src/environment-optional.yml
(
echo >&4 " - pip:"
echo >&5 " - pip:"
for PKG_BASE in $((sage-package list :standard: :optional: --has-file requirements.txt --no-file distros/conda.txt --no-file src; sage-package list :standard: :optional: --has-file install-requires.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src) | sort); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt
if [ ! -f $SYSTEM_PACKAGES_FILE ]; then
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/install-requires.txt
fi
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
if grep -q SAGERUNTIME $PKG_SCRIPTS/dependencies $PKG_SCRIPTS/dependencies_order_only 2>/dev/null; then
: # cannot install packages that depend on the Sage library
else
case "$PKG_BASE:$PKG_TYPE" in
$DEVELOP_SPKG_PATTERN:*) FD=4;;
*) FD=5;;
esac
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE | while read -r line; do
[ -n "$line" ] && echo >&$FD " - $line"
done
fi
done
) 4>> src/environment-dev.yml 5>> src/environment-optional.yml
1 change: 1 addition & 0 deletions build/pkgs/appdirs/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
appdirs
1 change: 1 addition & 0 deletions build/pkgs/appnope/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
appnope
1 change: 1 addition & 0 deletions build/pkgs/argon2_cffi/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
argon2-cffi
1 change: 1 addition & 0 deletions build/pkgs/asttokens/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
asttokens
1 change: 1 addition & 0 deletions build/pkgs/backports_zoneinfo/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
backports.zoneinfo
1 change: 1 addition & 0 deletions build/pkgs/beniget/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
beniget
1 change: 1 addition & 0 deletions build/pkgs/charset_normalizer/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charset-normalizer
1 change: 1 addition & 0 deletions build/pkgs/cppy/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cppy
1 change: 1 addition & 0 deletions build/pkgs/debugpy/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debugpy
1 change: 1 addition & 0 deletions build/pkgs/deprecation/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deprecation
1 change: 1 addition & 0 deletions build/pkgs/distlib/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distlib
1 change: 1 addition & 0 deletions build/pkgs/dot2tex/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dot2tex
1 change: 1 addition & 0 deletions build/pkgs/editables/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
editables
1 change: 1 addition & 0 deletions build/pkgs/executing/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
executing
1 change: 1 addition & 0 deletions build/pkgs/fastjsonschema/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-fastjsonschema
1 change: 1 addition & 0 deletions build/pkgs/filelock/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filelock
1 change: 1 addition & 0 deletions build/pkgs/flit_core/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flit-core
1 change: 1 addition & 0 deletions build/pkgs/fonttools/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fonttools
1 change: 1 addition & 0 deletions build/pkgs/gast/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gast
1 change: 1 addition & 0 deletions build/pkgs/hatchling/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hatchling
1 change: 1 addition & 0 deletions build/pkgs/idna/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
idna
1 change: 1 addition & 0 deletions build/pkgs/importlib_resources/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
importlib-resources
1 change: 1 addition & 0 deletions build/pkgs/jupyter_jsmol/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jupyter-jsmol
1 change: 1 addition & 0 deletions build/pkgs/jupyterlab_pygments/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jupyterlab_pygments
1 change: 1 addition & 0 deletions build/pkgs/mathics/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mathics3
1 change: 1 addition & 0 deletions build/pkgs/matplotlib_inline/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
matplotlib-inline
1 change: 1 addition & 0 deletions build/pkgs/nbclient/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nbclient
1 change: 1 addition & 0 deletions build/pkgs/nest_asyncio/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nest-asyncio
1 change: 1 addition & 0 deletions build/pkgs/palettable/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
palettable
1 change: 1 addition & 0 deletions build/pkgs/pathspec/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pathspec
1 change: 1 addition & 0 deletions build/pkgs/pint/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pint
1 change: 1 addition & 0 deletions build/pkgs/platformdirs/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
platformdirs
1 change: 1 addition & 0 deletions build/pkgs/pluggy/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pluggy
1 change: 1 addition & 0 deletions build/pkgs/ply/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ply
1 change: 1 addition & 0 deletions build/pkgs/poetry_core/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry-core
1 change: 1 addition & 0 deletions build/pkgs/pure_eval/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pure_eval
1 change: 1 addition & 0 deletions build/pkgs/py/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
py
1 change: 1 addition & 0 deletions build/pkgs/python_build/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
1 change: 1 addition & 0 deletions build/pkgs/pythran/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pythran
1 change: 1 addition & 0 deletions build/pkgs/pytz_deprecation_shim/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytz-deprecation-shim
2 changes: 1 addition & 1 deletion build/pkgs/sage_flatsurf/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(PYTHON) | $(PYTHON_TOOLCHAIN) surface_dynamics
$(PYTHON) | $(PYTHON_TOOLCHAIN) surface_dynamics $(SAGERUNTIME)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/setuptools_scm_git_archive/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setuptools-scm-git-archive
2 changes: 1 addition & 1 deletion build/pkgs/slabbe/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(PYTHON) | $(PYTHON_TOOLCHAIN)
$(PYTHON) | $(PYTHON_TOOLCHAIN) $(SAGERUNTIME)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/soupsieve/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
soupsieve
1 change: 1 addition & 0 deletions build/pkgs/stack_data/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stack_data
1 change: 1 addition & 0 deletions build/pkgs/texttable/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
texttable
1 change: 1 addition & 0 deletions build/pkgs/tinycss2/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tinycss2
1 change: 1 addition & 0 deletions build/pkgs/toml/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toml
1 change: 1 addition & 0 deletions build/pkgs/tomli/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tomli
1 change: 1 addition & 0 deletions build/pkgs/tomlkit/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tomlkit
1 change: 1 addition & 0 deletions build/pkgs/typing_extensions/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typing_extensions
1 change: 1 addition & 0 deletions build/pkgs/tzdata/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tzdata
1 change: 1 addition & 0 deletions build/pkgs/urllib3/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
urllib3
1 change: 1 addition & 0 deletions build/pkgs/virtualenv/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
virtualenv

0 comments on commit 700a1f5

Please sign in to comment.