Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/sagemath_objects/spkg-install: Build and store the wheel, …
Browse files Browse the repository at this point in the history
…use it for testing with tox
  • Loading branch information
mkoeppe committed May 6, 2022
1 parent b07a1db commit ddb80dc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_objects/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FORCE $(PYTHON) cysignals gmpy2 ipython | $(PYTHON_TOOLCHAIN) cython pkgconfig $(and $(filter-out no,$(SAGE_CHECK)), tox)
FORCE $(PYTHON) cysignals gmpy2 ipython | $(PYTHON_TOOLCHAIN) cython pkgconfig build $(and $(filter-out no,$(SAGE_CHECK)), tox)

# FORCE: Always run the spkg-install script
# ipython - for the doctester
25 changes: 22 additions & 3 deletions build/pkgs/sagemath_objects/spkg-install
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -x
# From sage-spkg.
# For type=script packages, the build rule in build/make/Makefile sources
# sage-env but not sage-dist-helpers.
lib="$SAGE_ROOT/build/bin/sage-dist-helpers"
source "$lib"
if [ $? -ne 0 ]; then
echo >&2 "Error: failed to source $lib"
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
exit 1
fi
cd src

# First build the sdist, then build the wheel from the sdist.
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
# Do not install the wheel.
DIST_DIR="$(mktemp -d)"
python3 -m build --outdir "$DIST_DIR"/dist .

wheel=$(cd "$DIST_DIR" && sdh_store_wheel . && echo $wheel)

if [ "$SAGE_CHECK" != no ]; then
tox
tox --installpkg $wheel
fi
# We skip the install for now.

exit 0

0 comments on commit ddb80dc

Please sign in to comment.