Skip to content

PYTHON-2502 Remove Python 2.7 from release scripts #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .evergreen/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ rm -rf validdist
mkdir -p validdist
mv dist/* validdist || true

for VERSION in 2.7 3.4 3.5 3.6 3.7 3.8 3.9; do
if [[ $VERSION == "2.7" ]]; then
PYTHON=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
rm -rf build
$PYTHON setup.py bdist_egg
else
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
fi
for VERSION in 3.4 3.5 3.6 3.7 3.8 3.9; do
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
rm -rf build

# Install wheel if not already there.
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/build-manylinux-internal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mv dist/* validdist || true

# Compile wheels
for PYTHON in /opt/python/*/bin/python; do
if [[ ! $PYTHON =~ (cp27|cp34|cp35|cp36|cp37|cp38|cp39) ]]; then
if [[ ! $PYTHON =~ (cp34|cp35|cp36|cp37|cp38|cp39) ]]; then
continue
fi
# https://github.com/pypa/manylinux/issues/49
Expand Down
1 change: 0 additions & 1 deletion .evergreen/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ls dist

# Check for any unexpected files.
unexpected=$(find dist \! \( -iname dist -or \
-iname '*cp27*' -or \
-iname '*cp34*' -or \
-iname '*cp35*' -or \
-iname '*cp36*' -or \
Expand Down
6 changes: 1 addition & 5 deletions .evergreen/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ rm -rf validdist
mkdir -p validdist
mv dist/* validdist || true

for VERSION in 27 34 35 36 37 38 39; do
for VERSION in 34 35 36 37 38 39; do
_pythons=(C:/Python/Python${VERSION}/python.exe \
C:/Python/32/Python${VERSION}/python.exe)
for PYTHON in "${_pythons[@]}"; do
if [[ $VERSION == "2.7" ]]; then
rm -rf build
$PYTHON setup.py bdist_egg
fi
rm -rf build
$PYTHON setup.py bdist_wheel

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ tasks:
- name: "release"
tags: ["release"]
exec_timeout_secs: 216000 # 60 minutes (manylinux task is slow).
git_tag_only: true
commands:
- command: shell.exec
type: test
Expand Down Expand Up @@ -2601,6 +2600,7 @@ buildvariants:
matrix_spec:
platform: [ubuntu-20.04, windows-64-vsMulti-small, macos-1014]
display_name: "Release ${platform}"
batchtime: 20160 # 14 days
tasks:
- name: "release"

Expand Down
22 changes: 14 additions & 8 deletions .evergreen/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,23 @@ createvirtualenv () {
fi
# Upgrade to the latest versions of pip setuptools wheel so that
# pip can always download the latest cryptography+cffi wheels.
python -m pip install --upgrade pip setuptools wheel
PYTHON_VERSION=$(python -c 'import sys;print("%s.%s" % sys.version_info[:2])')
if [[ $PYTHON_VERSION == "3.4" ]]; then
# pip 19.2 dropped support for Python 3.4.
python -m pip install --upgrade 'pip<19.2'
elif [[ $PYTHON_VERSION == "3.5" ]]; then
# pip 21 will drop support for 3.5.
python -m pip install --upgrade 'pip<21'
else
python -m pip install --upgrade pip
fi
python -m pip install --upgrade setuptools wheel
}

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

if [[ $RELEASE == *.egg ]]; then
$PYTHON -m easy_install $RELEASE
else
$PYTHON -m pip install --upgrade $RELEASE
fi
$PYTHON -m pip install --upgrade $RELEASE
cd tools
$PYTHON fail_if_no_c.py
$PYTHON -m pip uninstall -y pymongo
Expand Down