Skip to content

Commit

Permalink
Change cqlsh's min required Python version from 3.6+ to 3.7+
Browse files Browse the repository at this point in the history
patch by Andrés de la Peña; reviewed by Brandon Williams for CASSANDRA-18960
  • Loading branch information
adelapena committed Nov 14, 2023
1 parent 127f718 commit b91c0fc
Show file tree
Hide file tree
Showing 14 changed files with 288 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .build/docker/ubuntu2004_test.docker
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ WORKDIR ${BUILD_HOME}
ENV ANT_HOME=/usr/share/ant

# run pip commands and setup virtualenv (note we do this after we switch to cassandra user so we
# setup the virtualenv for the cassandra user and not the root user by accident) for Python 3.6/3.7/3.8
# setup the virtualenv for the cassandra user and not the root user by accident) for Python 3.7/3.8
# Don't build cython extensions when installing cassandra-driver. During test execution the driver
# dependency is refreshed via pip install --upgrade, so that driver changes can be pulled in without
# requiring the image to be rebuilt. Rebuilding compiled extensions is costly and is disabled by
Expand Down
170 changes: 85 additions & 85 deletions .circleci/config.yml

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions .circleci/config.yml.FREE

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions .circleci/config.yml.PAID

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions .circleci/config_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ jobs:
- run_dtests:
file_tag: j11_with_vnodes
pytest_extra_args: '--use-vnodes --num-tokens=16 --skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py3_offheap:
<<: *j11_par_executor
Expand All @@ -2114,7 +2114,7 @@ jobs:
- run_dtests:
file_tag: j11_dtests_offheap
pytest_extra_args: '--use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py38_vnode:
<<: *j11_par_executor
Expand Down Expand Up @@ -2201,7 +2201,7 @@ jobs:
- run_dtests:
file_tag: j11_without_vnodes
pytest_extra_args: '--skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py38:
<<: *j11_par_executor
Expand Down Expand Up @@ -2252,7 +2252,7 @@ jobs:
- run_dtests:
file_tag: j17_with_vnodes
pytest_extra_args: '--use-vnodes --num-tokens=16 --skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py3_offheap:
<<: *j17_par_executor
Expand All @@ -2267,7 +2267,7 @@ jobs:
- run_dtests:
file_tag: j17_dtests_offheap
pytest_extra_args: '--use-vnodes --num-tokens=16 --use-off-heap-memtables --skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py38_vnode:
<<: *j17_par_executor
Expand Down Expand Up @@ -2354,7 +2354,7 @@ jobs:
- run_dtests:
file_tag: j17_without_vnodes
pytest_extra_args: '--skip-resource-intensive-tests'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py38:
<<: *j17_par_executor
Expand Down Expand Up @@ -3117,8 +3117,8 @@ commands:
parameters:
python_version:
type: enum
default: "3.6"
enum: ["3.6", "3.7", "3.8", "3.11"]
default: "3.7"
enum: ["3.7", "3.8", "3.11"]
steps:
- run:
name: Configure virtualenv and python Dependencies
Expand Down Expand Up @@ -3148,8 +3148,8 @@ commands:
default: ''
python_version:
type: enum
default: "3.6"
enum: ["3.6", "3.7", "3.8", "3.11"]
default: "3.7"
enum: ["3.7", "3.8", "3.11"]
steps:
- run:
name: Determine Tests to Run (<<parameters.file_tag>>)
Expand Down Expand Up @@ -3190,8 +3190,8 @@ commands:
default: ''
python_version:
type: enum
default: "3.6"
enum: ["3.6", "3.7", "3.8", "3.11"]
default: "3.7"
enum: ["3.7", "3.8", "3.11"]
steps:
- run:
name: Run dtests (<<parameters.file_tag>>)
Expand Down Expand Up @@ -3662,7 +3662,7 @@ commands:
else
echo "Running <<parameters.tests>> $count times"
source ~/env3.6/bin/activate
source ~/env3.7/bin/activate
export PATH=$JAVA_HOME/bin:$PATH
java -version
Expand Down
16 changes: 8 additions & 8 deletions .circleci/config_template.yml.PAID.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- config_template.yml 2023-08-11 10:06:39.000000000 -0400
+++ config_template.yml.PAID 2023-08-11 10:07:25.000000000 -0400
--- config_template.yml 2023-11-10 15:39:02.663105186 +0000
+++ config_template.yml.PAID 2023-11-10 15:39:24.839456426 +0000
@@ -157,20 +157,20 @@
j11_par_executor: &j11_par_executor
executor:
Expand Down Expand Up @@ -215,7 +215,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2102,7 +2125,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py3_offheap:
- <<: *j11_par_executor
Expand All @@ -224,7 +224,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2117,7 +2140,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py38_vnode:
- <<: *j11_par_executor
Expand Down Expand Up @@ -269,7 +269,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2204,7 +2227,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j11_cqlsh_dtests_py38:
- <<: *j11_par_executor
Expand All @@ -296,7 +296,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2255,7 +2278,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py3_offheap:
- <<: *j17_par_executor
Expand All @@ -305,7 +305,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2270,7 +2293,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py38_vnode:
- <<: *j17_par_executor
Expand Down Expand Up @@ -350,7 +350,7 @@
- attach_workspace:
at: /home/cassandra
@@ -2357,7 +2380,7 @@
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.6'
extra_env_args: 'CQLSH_PYTHON=/usr/bin/python3.7'

j17_cqlsh_dtests_py38:
- <<: *j17_par_executor
Expand Down
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
5.0-beta1
* Make cqlsh's min required Python version 3.7+ instead of 3.6+ (CASSANDRA-18960)
* Fix incorrect seeking through the sstable iterator by IndexState (CASSANDRA-18932)
* Upgrade Python driver to 3.28.0 (CASSANDRA-18960)
* Add retries to IR messages (CASSANDRA-18962)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ New features

Upgrading
---------
- The minimumn Python version to run cqlsh has been bumped from 3.6 to 3.7. Python 3.6 is past its end-of-life, and
3.7 is the minimum version supported by the Python driver.
- Java 8 has been removed. Lowest supported version is Java 11.
- Ephemeral marker files for snapshots done by repairs are not created anymore,
there is a dedicated flag in snapshot manifest instead. On upgrade of a node to this version, on node's start, in case there
Expand Down
4 changes: 2 additions & 2 deletions bin/cqlsh
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ is_supported_version() {
version=$1
major_version="${version%.*}"
minor_version="${version#*.}"
# python3.6+ is supported
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 6 ]; then
# python 3.7+ is supported
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 7 ]; then
echo "supported"
else
echo "unsupported"
Expand Down
4 changes: 2 additions & 2 deletions bin/cqlsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import sys
from glob import glob

if sys.version_info < (3, 6):
sys.exit("\ncqlsh requires Python 3.6+\n")
if sys.version_info < (3, 7):
sys.exit("\ncqlsh requires Python 3.7+\n")

# see CASSANDRA-10428
if platform.python_implementation().startswith('Jython'):
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/cassandra/pages/installing/installing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Deploying on older Linux versions is not recommended unless you have previous ex

include::cassandra:partial$java_version.adoc[]

* To use the CQL shell `cqlsh`, install the latest version of Python 3.6+.
* To use the CQL shell `cqlsh`, install the latest version of Python 3.7+.

To verify that you have the correct version of Python installed, type `python --version`.

Expand Down
2 changes: 1 addition & 1 deletion pylib/Dockerfile.ubuntu.py3
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y python3-minimal && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
RUN apt-get update && apt-get install -y python3-minimal && update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
2 changes: 1 addition & 1 deletion pylib/README.asc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This directory contains code primarily for cqlsh. cqlsh uses cqlshlib in this directory.

== Requirements
. Python 3.6+ (for cqlsh)
. Python 3.7+ (for cqlsh)
. virtualenv
. Docker (optional)

Expand Down
2 changes: 1 addition & 1 deletion pylib/cassandra-cqlsh-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export TMPDIR="$(mktemp -d /tmp/run-python-dtest.XXXXXX)"
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk -F. '{print $1}')
version=$(grep 'property\s*name=\"base.version\"' ${CASSANDRA_DIR}/build.xml |sed -ne 's/.*value=\"\([^"]*\)\".*/\1/p')

python_version="3.6"
python_version="3.7"
command -v python3 >/dev/null 2>&1 && python_version="$(python3 -V | awk '{print $2}' | awk -F'.' '{print $1"."$2}')"

export TESTSUITE_NAME="cqlshlib.python${python_version}.jdk${java_version}"
Expand Down

0 comments on commit b91c0fc

Please sign in to comment.