@@ -6,15 +6,6 @@ CHPL_MAKE_HOST_TARGET = --host
6
6
include $(CHPL_MAKE_HOME ) /make/Makefile.base
7
7
include $(THIRD_PARTY_DIR ) /chpl-venv/Makefile.include
8
8
9
- ifneq (,$(findstring cygwin, $(CHPL_MAKE_TARGET_PLATFORM ) ) )
10
- # easy_install from cygwin's setuptools is `easy_install-<MAJOR>.<MINOR>`
11
- # instead of `easy_install`. If we can't find easy_install, look for the
12
- # versioned one.
13
- EASY_INSTALL = $(shell which easy_install 2>/dev/null || which easy_install-$(PYTHON_VERSION ) )
14
- else
15
- EASY_INSTALL = $(shell which easy_install)
16
- endif
17
-
18
9
default : all
19
10
20
11
all : test-venv chpldoc-venv
@@ -28,32 +19,40 @@ clobber: FORCE
28
19
29
20
check-python :
30
21
ifeq ($(wildcard $(PYTHON ) ) ,)
31
- $(error python and easy_install are required to install chpldoc \
32
- and start_test dependencies. See https://www.python.org/)
33
- endif
34
-
35
- check-easy-install :
36
- ifeq ($(wildcard $(EASY_INSTALL ) ) ,)
37
- $(error python and easy_install are required to install chpldoc \
22
+ $(error python and pip are required to install chpldoc \
38
23
and start_test dependencies. See https://www.python.org/)
39
24
endif
40
25
41
- check-exes : check-python check-easy-install
26
+ check-exes : check-python
42
27
43
28
$(CHPL_VENV_INSTALL_DIR ) :
44
29
mkdir -p $@
45
30
31
+ # Install pip via get-pip.py to ensure we have an updated version
32
+ $(PIP ) : $(CHPL_VENV_INSTALL_DIR )
33
+ @echo " Installing local copy of pip with get-pip.py from $( GETPIP) "
34
+ @if [ -z " $$ CHPL_PIP" ]; then \
35
+ (cd install && curl -O $( GETPIP) || \
36
+ { echo " Failed on command: curl -O $( GETPIP) ." ; \
37
+ echo " Try setting CHPL_PIP to $$ (which pip) and trying again" ; \
38
+ exit 1; } && \
39
+ export PYTHONUSERBASE=$(CHPL_VENV_INSTALL_DIR ) && \
40
+ python get-pip.py --user) \
41
+ fi
42
+
46
43
# Install virtualenv program.
47
- $(CHPL_VENV_VIRTUALENV ) : $(CHPL_VENV_INSTALL_DIR ) check-exes
48
- export PYTHONPATH=$(CHPL_VENV_INSTALL_DIR ) :$$ PYTHONPATH && \
49
- $(EASY_INSTALL ) --install-dir=$(CHPL_VENV_INSTALL_DIR ) $(CHPL_EASY_INSTALL_PARAMS ) $(shell cat virtualenv.txt)
44
+ $(CHPL_VENV_VIRTUALENV ) : check-exes $(PIP )
45
+ export PYTHONPATH=" $$ CHPL_PYTHONPATH:$( PIPLIBS) :$$ PYTHONPATH" && \
46
+ python -S $(PIP ) install -U --force-reinstall --ignore-installed \
47
+ --prefix=$(CHPL_VENV_INSTALL_DIR ) $(CHPL_PIP_INSTALL_PARAMS ) $(shell cat virtualenv.txt)
50
48
51
49
# Phony convenience target for installing virtualenv.
52
50
virtualenv : $(CHPL_VENV_VIRTUALENV )
53
51
54
52
# Create the virtualenv.
55
53
$(CHPL_VENV_VIRTUALENV_DIR ) : $(CHPL_VENV_VIRTUALENV )
56
- $(CHPL_VENV_VIRTUALENV ) --python=$(PYTHON ) $@
54
+ export PYTHONPATH=" $( PIPLIBS) :$$ PYTHONPATH" && \
55
+ python $(CHPL_VENV_VIRTUALENV ) --python=$(PYTHON ) $@
57
56
58
57
# Phony convenience target for creating virtualenv.
59
58
create-virtualenv : $(CHPL_VENV_VIRTUALENV_DIR )
@@ -71,26 +70,29 @@ create-virtualenv: $(CHPL_VENV_VIRTUALENV_DIR)
71
70
#
72
71
# By calling `python .../path/to/pip ...`, this issue is circumvented.
73
72
$(CHPL_VENV_TEST_REQS ) : $(CHPL_VENV_VIRTUALENV_DIR )
73
+ export PYTHONPATH=" $( PIPLIBS) :$$ PYTHONPATH" && \
74
74
export PATH=$(CHPL_VENV_VIRTUALENV_BIN ) :$$ PATH && \
75
75
export VIRTUAL_ENV=$(CHPL_VENV_VIRTUALENV_DIR ) && \
76
76
python $(CHPL_VENV_VIRTUALENV_BIN ) /pip install \
77
77
-U --force-reinstall $(CHPL_PIP_INSTALL_PARAMS ) -r test-requirements.txt && \
78
- $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR ) && \
78
+ python $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR ) && \
79
79
touch $(CHPL_VENV_TEST_REQS )
80
80
81
81
$(CHPL_VENV_SPHINX_BUILD ) : $(CHPL_VENV_VIRTUALENV_DIR )
82
+ export PYTHONPATH=" $( PIPLIBS) :$$ PYTHONPATH" && \
82
83
export PATH=$(CHPL_VENV_VIRTUALENV_BIN ) :$$ PATH && \
83
84
export VIRTUAL_ENV=$(CHPL_VENV_VIRTUALENV_DIR ) && \
84
85
python $(CHPL_VENV_VIRTUALENV_BIN ) /pip install \
85
86
-U --force-reinstall $(CHPL_PIP_INSTALL_PARAMS ) -r chpldoc-requirements.txt && \
86
- $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR )
87
+ python $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR )
87
88
88
89
$(CHPL_VENV_CHPLSPELL_REQS ) : $(CHPL_VENV_VIRTUALENV_DIR )
90
+ export PYTHONPATH=" $( PIPLIBS) :$$ PYTHONPATH" && \
89
91
export PATH=$(CHPL_VENV_VIRTUALENV_BIN ) :$$ PATH && \
90
92
export VIRTUAL_ENV=$(CHPL_VENV_VIRTUALENV_DIR ) && \
91
93
python $(CHPL_VENV_VIRTUALENV_BIN ) /pip install \
92
94
-U --force-reinstall $(CHPL_PIP_INSTALL_PARAMS ) -r chplspell-requirements.txt && \
93
- $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR ) && \
95
+ python $(CHPL_VENV_VIRTUALENV ) --relocatable $(CHPL_VENV_VIRTUALENV_DIR ) && \
94
96
touch $(CHPL_VENV_CHPLSPELL_REQS )
95
97
96
98
test-venv : $(CHPL_VENV_TEST_REQS )
@@ -122,6 +124,6 @@ use-system-python: FORCE
122
124
123
125
FORCE :
124
126
125
- .PHONY : install-requirements create-virtualenv virtualenv check-exes rm-sphinx-build check-easy-install check-python
127
+ .PHONY : install-requirements create-virtualenv virtualenv check-exes rm-sphinx-build check-pip check-python
126
128
127
129
.NOTPARALLEL :
0 commit comments