#28425 closed enhancement (duplicate)

py3 : install only the correct pip

Reported by: chapoton Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords:
Cc: embray, jdemeyer, fbissey Merged in:
Authors: Frédéric Chapoton Reviewers:
Report Upstream: N/A Work issues:
Branch: u/chapoton/28425 (Commits, GitHub, GitLab) Commit: d83528e3f974ef35b35a46bfa8dea33a6c435516
Dependencies: Stopgaps:

Status badges

Description

namely either pip2 or pip3

Change History (7)

comment:1 Changed 20 months ago by chapoton

  • Branch set to u/chapoton/28425
  • Commit set to d83528e3f974ef35b35a46bfa8dea33a6c435516
  • Status changed from new to needs_review

New commits:

d83528einstall only either pip2 or pip3

comment:2 Changed 20 months ago by chapoton

probably one should also change the "dependencies" file, no ?

comment:3 Changed 20 months ago by jhpalmieri

I was trying to accomplish something similar, but in fact to remove Python 2 completely with a Python 3 build (as you mentioned on sage-devel). The only reason Python 2 is built in a Python 3 build, currently, is that it is a dependency for setuptools and pip. My patch, which I am currently testing:

  • build/pkgs/pip/dependencies

    diff --git a/build/pkgs/pip/dependencies b/build/pkgs/pip/dependencies
    index d7000d134d..6fb99bfe3f 100644
    a b  
    1 python2 python3 setuptools
     1$(PYTHON) python3 setuptools
    22
    33----------
    44All lines of this file are ignored except the first.
  • build/pkgs/pip/spkg-install

    diff --git a/build/pkgs/pip/spkg-install b/build/pkgs/pip/spkg-install
    index db656d4b4d..f7243906fb 100644
    a b export PYTHONPATH="$(pwd)/src" 
    88# need to use --upgrade or --ignore-installed; Otherwise pip, which is
    99# importing itself, will think itself is already installed
    1010#
    11 # Install pip3 first so pip2 overwrites local/bin/pip
    12 for vers in 3 2; do
     11if [ "$SAGE_PYTHON3" = "yes" ]; then
     12    versions="3"
     13else
     14    # Install pip3 first so pip2 overwrites local/bin/pip
     15    versions="3 2"
     16fi
     17
     18for vers in $versions; do
    1319    python${vers} -m pip install --verbose --no-index --ignore-installed \
    1420            --no-build-isolation --isolated --root="$SAGE_DESTDIR" . || \
    1521        sdh_die "Error building / installing pip${vers}"
  • build/pkgs/setuptools/dependencies

    diff --git a/build/pkgs/setuptools/dependencies b/build/pkgs/setuptools/dependencies
    index 6e4d4d7da4..6304688354 100644
    a b  
    1 python2 python3
     1$(PYTHON) python3
    22
    33----------
    44All lines of this file are ignored except the first.
  • build/pkgs/setuptools/spkg-install

    diff --git a/build/pkgs/setuptools/spkg-install b/build/pkgs/setuptools/spkg-install
    index e231615d95..800170674b 100644
    a b export PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs" 
    99
    1010cd src
    1111
     12if [ "$SAGE_PYTHON3" = "yes" ]; then
     13    versions="3"
     14else
     15    versions="2 3"
     16fi
     17
    1218# Prevent setuptools from installing itself with easy_install
    13 for vers in 2 3; do
     19for vers in $versions; do
    1420    python${vers} setup.py --no-user-cfg install \
    1521            --single-version-externally-managed --root="$SAGE_DESTDIR" || \
    1622        sdh_die "Error building / installing setuptools for Python ${vers}"

comment:4 Changed 20 months ago by jhpalmieri

I've opened up #28426 for my changes.

comment:5 Changed 20 months ago by chapoton

ok, then I think I can close the ticket as duplicate, right ?

comment:6 Changed 20 months ago by jhpalmieri

Yes, I agree.

comment:7 Changed 20 months ago by chapoton

  • Milestone changed from sage-8.9 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.