Skip to content

Commit 7737679

Browse files
authored
PYTHON-2502 Remove Python 2.7 from release scripts (#548)
PYTHON-1300 Stop shipping .egg files. PYTHON-2507 Future proof pip version upgrade.
1 parent 3c899ae commit 7737679

File tree

6 files changed

+19
-24
lines changed

6 files changed

+19
-24
lines changed

.evergreen/build-mac.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ rm -rf validdist
88
mkdir -p validdist
99
mv dist/* validdist || true
1010

11-
for VERSION in 2.7 3.4 3.5 3.6 3.7 3.8 3.9; do
12-
if [[ $VERSION == "2.7" ]]; then
13-
PYTHON=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
14-
rm -rf build
15-
$PYTHON setup.py bdist_egg
16-
else
17-
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
18-
fi
11+
for VERSION in 3.4 3.5 3.6 3.7 3.8 3.9; do
12+
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
1913
rm -rf build
2014

2115
# Install wheel if not already there.

.evergreen/build-manylinux-internal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mv dist/* validdist || true
1111

1212
# Compile wheels
1313
for PYTHON in /opt/python/*/bin/python; do
14-
if [[ ! $PYTHON =~ (cp27|cp34|cp35|cp36|cp37|cp38|cp39) ]]; then
14+
if [[ ! $PYTHON =~ (cp34|cp35|cp36|cp37|cp38|cp39) ]]; then
1515
continue
1616
fi
1717
# https://github.com/pypa/manylinux/issues/49

.evergreen/build-manylinux.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ls dist
2222

2323
# Check for any unexpected files.
2424
unexpected=$(find dist \! \( -iname dist -or \
25-
-iname '*cp27*' -or \
2625
-iname '*cp34*' -or \
2726
-iname '*cp35*' -or \
2827
-iname '*cp36*' -or \

.evergreen/build-windows.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ rm -rf validdist
88
mkdir -p validdist
99
mv dist/* validdist || true
1010

11-
for VERSION in 27 34 35 36 37 38 39; do
11+
for VERSION in 34 35 36 37 38 39; do
1212
_pythons=(C:/Python/Python${VERSION}/python.exe \
1313
C:/Python/32/Python${VERSION}/python.exe)
1414
for PYTHON in "${_pythons[@]}"; do
15-
if [[ $VERSION == "2.7" ]]; then
16-
rm -rf build
17-
$PYTHON setup.py bdist_egg
18-
fi
1915
rm -rf build
2016
$PYTHON setup.py bdist_wheel
2117

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,6 @@ tasks:
856856
- name: "release"
857857
tags: ["release"]
858858
exec_timeout_secs: 216000 # 60 minutes (manylinux task is slow).
859-
git_tag_only: true
860859
commands:
861860
- command: shell.exec
862861
type: test
@@ -2601,6 +2600,7 @@ buildvariants:
26012600
matrix_spec:
26022601
platform: [ubuntu-20.04, windows-64-vsMulti-small, macos-1014]
26032602
display_name: "Release ${platform}"
2603+
batchtime: 20160 # 14 days
26042604
tasks:
26052605
- name: "release"
26062606

.evergreen/utils.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ createvirtualenv () {
2424
fi
2525
# Upgrade to the latest versions of pip setuptools wheel so that
2626
# pip can always download the latest cryptography+cffi wheels.
27-
python -m pip install --upgrade pip setuptools wheel
27+
PYTHON_VERSION=$(python -c 'import sys;print("%s.%s" % sys.version_info[:2])')
28+
if [[ $PYTHON_VERSION == "3.4" ]]; then
29+
# pip 19.2 dropped support for Python 3.4.
30+
python -m pip install --upgrade 'pip<19.2'
31+
elif [[ $PYTHON_VERSION == "3.5" ]]; then
32+
# pip 21 will drop support for 3.5.
33+
python -m pip install --upgrade 'pip<21'
34+
else
35+
python -m pip install --upgrade pip
36+
fi
37+
python -m pip install --upgrade setuptools wheel
2838
}
2939

3040
# Usage:
31-
# testinstall /path/to/python /path/to/.whl/or/.egg ["no-virtualenv"]
41+
# testinstall /path/to/python /path/to/.whl ["no-virtualenv"]
3242
# * param1: Python binary to test
33-
# * param2: Path to the wheel or egg file to install
43+
# * param2: Path to the wheel to install
3444
# * param3 (optional): If set to a non-empty string, don't create a virtualenv. Used in manylinux containers.
3545
testinstall () {
3646
PYTHON=$1
@@ -42,11 +52,7 @@ testinstall () {
4252
PYTHON=python
4353
fi
4454

45-
if [[ $RELEASE == *.egg ]]; then
46-
$PYTHON -m easy_install $RELEASE
47-
else
48-
$PYTHON -m pip install --upgrade $RELEASE
49-
fi
55+
$PYTHON -m pip install --upgrade $RELEASE
5056
cd tools
5157
$PYTHON fail_if_no_c.py
5258
$PYTHON -m pip uninstall -y pymongo

0 commit comments

Comments
 (0)