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):

- Ubuntu 22.04 / python3 3.10 / NO python3-distutils:   ** problem fixed
- Ubuntu 22.04 / python3 3.10 / WITH python3-distutils: ** still working
- Debian 11 / python3 3.10 / WITH python3-distutils:    ** still working
- Debian 11 / python3 3.10 / WITHOUT python3-distutils: ** ok error msg

*** 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
Yasuaki Kudo committed Sep 21, 2022
1 parent 2bccbd1 commit 7661cec
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 7661cec

Please sign in to comment.