Skip to content

Commit

Permalink
WIP pactivate: proposed fix for Debian Python 3.10 pkg w/o distutils
Browse files Browse the repository at this point in the history
*** Tests (all manual so far):

                  ----- Debian package ------
    Tested on     python3   python3-distutils   result after fix
    ──────────────────────────────────────────────────────────────────────
    Ubuntu 22.04   3.10        NO               problem fixed
    Ubuntu 22.04   3.10        YES              still working
    Debian 11      3.9         YES              still working
    Debian 11      3.9         NO               fails with clear message

*** To-do:

- Discuss what we want to do for testing of the workaround. Currently we
  test only in debian:11, which confirms that the workaround does not
  affect that (where it's not needed) but does _not_ confirm that the
  workaround does work where it is needed (ubuntu:22.04 w/o
  python3-distutils).

*** Bugs in previous code:

- Deb 11 w/o python3-distutils fails to install bootstrap pip, prints a
  message, and should stop, but instead goes on with "Installing
  bootstrap virtualenv".
- Also separate commit to add commented-out "head-of-main" thing below.

*** Changes since last good commit (some need to be moved to other commits)

- pactivate:
  - Add commented-out "head of main" package for virtualenv
    - XXX move to a separate commit
  - add DEB_PYTHON_INSTALL_LAYOUT workaround
- cont-test:
  - remove the debugging
  - XXX keep a check for pactivate failure:
      (. ./$pactivate) || fail "pactivate failed: return code $?"
  - XXX keep large comment about system python 3.10.x

*** Stuff to document

    print(sysconfig.get_default_scheme())

    [2350]: pypa/virtualenv#2350
    [au 1415153]: https://askubuntu.com/a/1415153/354600

    [2415]: https://github.com/pypa/virtualenv/pull/2415/files?diff=unified&w=0

*** Maybe document

    pypa/setuptools#3278
  • Loading branch information
0cjs authored and Yasuaki Kudo committed Sep 22, 2022
1 parent 406a04b commit 9313677
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 49 deletions.
38 changes: 0 additions & 38 deletions DEBUGGING.md

This file was deleted.

11 changes: 0 additions & 11 deletions cont-test
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@ echo '━━━━━ run pactivate clean'
[[ -d $bsve/virtualenv/ ]] || fail "not a dir: $bsve/virtualenv/"
$virtualenv/bin/pip --version || fail "pip --version didn't work"

# temp stop and look
echo
ls -CF .build/virtualenv/
fail "XXX Tests temporarily stop here"

echo '━━━━━ XXX debugging test'
rm -rf .build
ln -s $(/usr/local/pythonz/bin/pythonz locate 3.10.7) .python
(. $pactivate)
$virtualenv/bin/pip --version || fail "pip --version didn't work"

echo '━━━━━ run pactivate installed'
# This should do nothing but run the existing virtualenv's activate
# It also tests the -q option so we can leave it out (by default)
Expand Down
3 changes: 3 additions & 0 deletions pactivate
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ mkdir -p "$__pa_bootdir" # also ensures that $__pa_builddir exists
echo '----- Installing bootstrap virtualenv'
PYTHONPATH="$__pa_bootdir" "$__pa_bootdir/bin/pip" \
$__pa_quiet install -t "$__pa_bootdir" virtualenv
# If you want to use "current" virtualenv instead, install:
# git+https://github.com/pypa/virtualenv@main
}

[[ -d $__pa_builddir/virtualenv/ ]] || {
Expand All @@ -83,6 +85,7 @@ mkdir -p "$__pa_bootdir" # also ensures that $__pa_builddir exists
echo
fi
echo -n "Version: " && "$__pa_python" --version
DEB_PYTHON_INSTALL_LAYOUT='deb' \
PYTHONPATH="$__pa_bootdir" "$__pa_python_deref" -s -m virtualenv \
$__pa_quiet --prompt $(dirname "$__pa_basedir") \
"$__pa_builddir/virtualenv/" \
Expand Down

0 comments on commit 9313677

Please sign in to comment.