mirror of https://github.com/apache/cassandra
Deprecate Python 3.7 and earlier, but allow cqlsh to run with Python 3.6-3.11
patch by Caleb Rackliffe; reviewed by Brandon Williams and Stefan Miklosovic for CASSANDRA-19467
This commit is contained in:
parent
36a1ca5e48
commit
8a33f32350
|
|
@ -1,4 +1,5 @@
|
||||||
5.0-beta2
|
5.0-beta2
|
||||||
|
* Deprecate Python 3.7 and earlier, but allow cqlsh to run with Python 3.6-3.11 (CASSANDRA-19467)
|
||||||
* Set uuid_sstable_identifiers_enabled to true in cassandra-latest.yaml (CASSANDRA-19460)
|
* Set uuid_sstable_identifiers_enabled to true in cassandra-latest.yaml (CASSANDRA-19460)
|
||||||
* Revert switching to approxTime in Dispatcher (CASSANDRA-19454)
|
* Revert switching to approxTime in Dispatcher (CASSANDRA-19454)
|
||||||
* Add an optimized default configuration to tests and make it available for new users (CASSANDRA-18753)
|
* Add an optimized default configuration to tests and make it available for new users (CASSANDRA-18753)
|
||||||
|
|
|
||||||
4
NEWS.txt
4
NEWS.txt
|
|
@ -203,8 +203,8 @@ Upgrading
|
||||||
---------
|
---------
|
||||||
- Default disk_access_mode value changed from "auto" to "mmap_index_only". Override this setting with "disk_access_mode: auto" on
|
- Default disk_access_mode value changed from "auto" to "mmap_index_only". Override this setting with "disk_access_mode: auto" on
|
||||||
cassandra.yaml to keep the previous default. See CASSANDRA-19021 for details.
|
cassandra.yaml to keep the previous default. See CASSANDRA-19021 for details.
|
||||||
- The Python version required to run cqlsh has been bumped from 3.6+ to 3.8-3.11. Python 3.6 and 3.7 are past their
|
- The Python versions recommended for running cqlsh have been bumped from 3.6+ to 3.8-3.11. Python 3.6-3.7 are now
|
||||||
end-of-life, and 3.8 is now the minimum version supported by the Python driver.
|
deprecated, as they have reached end-of-life, and support will be removed in a future major release.
|
||||||
- Java 8 has been removed. Lowest supported version is Java 11.
|
- Java 8 has been removed. Lowest supported version is Java 11.
|
||||||
- Ephemeral marker files for snapshots done by repairs are not created anymore,
|
- 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
|
there is a dedicated flag in snapshot manifest instead. On upgrade of a node to this version, on node's start, in case there
|
||||||
|
|
|
||||||
14
bin/cqlsh
14
bin/cqlsh
|
|
@ -62,9 +62,12 @@ is_supported_version() {
|
||||||
version=$1
|
version=$1
|
||||||
major_version="${version%.*}"
|
major_version="${version%.*}"
|
||||||
minor_version="${version#*.}"
|
minor_version="${version#*.}"
|
||||||
# python 3.8-3.11 is supported
|
# python 3.8-3.11 are supported
|
||||||
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 8 ] && [ "$minor_version" -le 11 ]; then
|
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 8 ] && [ "$minor_version" -le 11 ]; then
|
||||||
echo "supported"
|
echo "supported"
|
||||||
|
# python 3.6-3.7 are deprecated
|
||||||
|
elif [ "$major_version" = 3 ] && [ "$minor_version" -ge 6 ] && [ "$minor_version" -le 7 ]; then
|
||||||
|
echo "deprecated"
|
||||||
else
|
else
|
||||||
echo "unsupported"
|
echo "unsupported"
|
||||||
fi
|
fi
|
||||||
|
|
@ -75,12 +78,17 @@ run_if_supported_version() {
|
||||||
interpreter="$1" shift
|
interpreter="$1" shift
|
||||||
|
|
||||||
version=$(get_python_version "$interpreter")
|
version=$(get_python_version "$interpreter")
|
||||||
|
version_status=$(is_supported_version "$version")
|
||||||
if [ -n "$version" ]; then
|
if [ -n "$version" ]; then
|
||||||
if [ "$(is_supported_version "$version")" = "supported" ]; then
|
if [ "$version_status" = "supported" ] || [ "$version_status" = "deprecated" ]; then
|
||||||
|
if [ "$version_status" = "deprecated" ]; then
|
||||||
|
echo "Warning: using deprecated version of Python:" "$version" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$interpreter" "$($interpreter -c "import os; print(os.path.dirname(os.path.realpath('$0')))")/cqlsh.py" "$@"
|
exec "$interpreter" "$($interpreter -c "import os; print(os.path.dirname(os.path.realpath('$0')))")/cqlsh.py" "$@"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
echo "Warning: unsupported version of Python, required 3.8-3.11 but found" $version >&2
|
echo "Warning: unsupported version of Python, required 3.6-3.11 but found" "$version" >&2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ import platform
|
||||||
import sys
|
import sys
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
if sys.version_info < (3, 8) or sys.version_info >= (3, 12):
|
if sys.version_info < (3, 6) or sys.version_info >= (3, 12):
|
||||||
sys.exit("\ncqlsh requires Python 3.8-3.11\n")
|
sys.exit("\ncqlsh requires Python 3.6-3.11\n")
|
||||||
|
|
||||||
# see CASSANDRA-10428
|
# see CASSANDRA-10428
|
||||||
if platform.python_implementation().startswith('Jython'):
|
if platform.python_implementation().startswith('Jython'):
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ DEFAULT_CQLSH_TERM = 'xterm'
|
||||||
try:
|
try:
|
||||||
Pattern = re._pattern_type
|
Pattern = re._pattern_type
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# Python 3.8-3.11
|
# Python 3.6+
|
||||||
Pattern = re.Pattern
|
Pattern = re.Pattern
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue