From a6a56ad873fe342f004db8891da75ef49f296567 Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Fri, 20 Mar 2020 13:28:52 +0100 Subject: [PATCH 1/4] Bump minimum Python version to 3.7 With this commit we require at least Python 3.7 for Rally. This is done as a preparation for Rally's new load generator which requires certain Python 3.7 features (like contextvars) and uses asyncio internally which has been improved in more recent versions of Python. --- .ci/variables.json | 3 +-- Makefile | 9 ++------- docs/install.rst | 41 +++++++++++++---------------------------- docs/migrate.rst | 8 ++++++++ docs/quickstart.rst | 2 +- esrally/__init__.py | 4 ++-- setup.py | 2 +- tox.ini | 2 +- 8 files changed, 29 insertions(+), 42 deletions(-) diff --git a/.ci/variables.json b/.ci/variables.json index 4be30e568..4fb621b68 100644 --- a/.ci/variables.json +++ b/.ci/variables.json @@ -1,7 +1,6 @@ { "python_versions": { "PY38": "3.8.0", - "PY37": "3.7.5", - "PY36": "3.6.9" + "PY37": "3.7.5" } } diff --git a/Makefile b/Makefile index 35bacd0da..18dba1c4f 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ PYENV_REGEX = .pyenv/shims PY_BIN = python3 # https://github.com/pypa/pip/issues/5599 PIP_WRAPPER = $(PY_BIN) -m pip -PY36 = $(shell jq '.python_versions.PY36' .ci/variables.json) PY37 = $(shell jq '.python_versions.PY37' .ci/variables.json) PY38 = $(shell jq '.python_versions.PY38' .ci/variables.json) VENV_NAME ?= .venv @@ -35,10 +34,9 @@ PYENV_PREREQ_HELP = "\033[0;31mIMPORTANT\033[0m: please add \033[0;31meval \"\$$ VE_MISSING_HELP = "\033[0;31mIMPORTANT\033[0m: Couldn't find $(PWD)/$(VENV_NAME); have you executed make venv-create?\033[0m\n" prereq: - pyenv install --skip-existing $(PY36) pyenv install --skip-existing $(PY37) pyenv install --skip-existing $(PY38) - pyenv local $(PY36) $(PY37) $(PY38) + pyenv local $(PY37) $(PY38) @# Ensure all Python versions are registered for this project @ jq -r '.python_versions | [.[] | tostring] | join("\n")' .ci/variables.json > .python-version -@ printf $(PYENV_PREREQ_HELP) @@ -108,9 +106,6 @@ precommit: lint it: check-venv python-caches-clean tox-env-clean . $(VENV_ACTIVATE_FILE); tox -it36: check-venv python-caches-clean tox-env-clean - . $(VENV_ACTIVATE_FILE); tox -e py36 - it37: check-venv python-caches-clean tox-env-clean . $(VENV_ACTIVATE_FILE); tox -e py37 @@ -131,4 +126,4 @@ release-checks: check-venv release: check-venv release-checks clean docs it . $(VENV_ACTIVATE_FILE); ./release.sh $(release_version) $(next_version) -.PHONY: install clean nondocs-clean docs-clean python-caches-clean tox-env-clean docs serve-docs test it it36 it37 it38 benchmark coverage release release-checks prereq venv-create check-env +.PHONY: install clean nondocs-clean docs-clean python-caches-clean tox-env-clean docs serve-docs test it it37 it38 benchmark coverage release release-checks prereq venv-create check-env diff --git a/docs/install.rst b/docs/install.rst index 25d1f5105..5ec5e4cbe 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -13,35 +13,27 @@ Prerequisites Rally does not support Windows and is only actively tested on MacOS and Linux. Install the following packages first. +.. _install_python: + Python ~~~~~~ -* Python 3.6 or better available as `python3` on the path. Verify with: ``python3 --version``. +* Python 3.7 or better available as ``python3`` on the path. Verify with: ``python3 --version``. * Python3 header files (included in the Python3 development package). * ``pip3`` available on the path. Verify with ``pip3 --version``. -**Debian / Ubuntu** - -:: - - sudo apt-get install gcc python3-pip python3.6-dev +We recommend to use `pyenv `_ to manage installation of Python. For details refer to their `installation instructions `_. Once ``pyenv`` is installed, install a compatible Python version:: + # Install Python + pyenv install 3.8.0 -**RHEL / CentOS 6 and 7** - -Please refer to the `installation instructions for Python 3.6 in the Red Hat Software Collections `_. - -**Amazon Linux** - -:: + # select that version for the current user + # see https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global for details + pyenv global 3.8.0 - sudo yum install -y gcc python3-pip.noarch python3-devel.x86_64 - -**MacOS** - -We recommend that you use `Homebrew `_:: - - brew install python3 + # Install pip3 + curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py + python3 get-pip.py --user git ~~~ @@ -104,7 +96,7 @@ Non-sudo Install If you don't want to use ``sudo`` when installing Rally, installation is still possible but a little more involved: 1. Specify the ``--user`` option when installing Rally (step 2 above), so the command to be issued is: ``python3 setup.py develop --user``. -2. Check the output of the install script or lookup the `Python documentation on the variable site.USER_BASE `_ to find out where the script is located. On Linux, this is typically ``~/.local/bin``. +2. Check the output of the install script or lookup the `Python documentation on the variable site.USER_BASE `_ to find out where the script is located. On Linux, this is typically ``~/.local/bin``. You can now either add ``~/.local/bin`` to your path or invoke Rally via ``~/.local/bin/esrally`` instead of just ``esrally``. @@ -119,13 +111,6 @@ You can also use Virtualenv to install Rally into an isolated Python environment Whenever you want to use Rally, run the activation script (step 2 above) first. When you are done, simply execute ``deactivate`` in the shell to exit the virtual environment. -PyEnv Install ------------------- - -Rally can be tested with different Python versions and it uses pyenv to manage them. - -Please refer to PyEnv `installation instructions `_. - Docker ------ diff --git a/docs/migrate.rst b/docs/migrate.rst index 7e8de6fc3..789b9d37b 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -1,6 +1,14 @@ Migration Guide =============== +Migrating to Rally 1.5.0 +------------------------ + +Minimum Python version is 3.7.0 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Rally 1.5.0 requires Python 3.7.0. Check the :ref:`updated installation instructions ` for more details. + Migrating to Rally 1.4.1 ------------------------ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index a8369620c..d32b31046 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -6,7 +6,7 @@ Rally is developed for Unix and is actively tested on Linux and MacOS. Rally sup Install ------- -Install Python 3.6+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: +Install Python 3.7+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: pip3 install esrally diff --git a/esrally/__init__.py b/esrally/__init__.py index 51dfac712..a5a42e631 100644 --- a/esrally/__init__.py +++ b/esrally/__init__.py @@ -72,8 +72,8 @@ def check_python_version(): - if sys.version_info.major != 3 or sys.version_info.minor < 6: - raise RuntimeError("Rally requires at least Python 3.6 but you are using:\n\nPython %s" % str(sys.version)) + if sys.version_info.major != 3 or sys.version_info.minor < 7: + raise RuntimeError("Rally requires at least Python 3.7 but you are using:\n\nPython %s" % str(sys.version)) def doc_link(path=None): diff --git a/setup.py b/setup.py index b070754aa..04ccc2b6e 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def str_from_file(name): long_description = str_from_file("README.rst") # tuples of (major, minor) of supported Python versions ordered from lowest to highest -supported_python_versions = [(3, 6), (3, 7), (3, 8)] +supported_python_versions = [(3, 7), (3, 8)] ################################################################################################ # diff --git a/tox.ini b/tox.ini index 9a38aa119..28838706c 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ ############################################################################### [tox] envlist = - docs, py36, py37, py38 + docs, py37, py38 platform = linux|darwin From 60193d8ba2e469466f1d8b73a542d04fa91d2971 Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Fri, 20 Mar 2020 15:29:28 +0100 Subject: [PATCH 2/4] Mention pyenv prereqs --- docs/install.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index 5ec5e4cbe..b2746633a 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -22,7 +22,9 @@ Python * Python3 header files (included in the Python3 development package). * ``pip3`` available on the path. Verify with ``pip3 --version``. -We recommend to use `pyenv `_ to manage installation of Python. For details refer to their `installation instructions `_. Once ``pyenv`` is installed, install a compatible Python version:: +We recommend to use `pyenv `_ to manage installation of Python. For details refer to their `installation instructions `_ and `ensure that all of pyenv's prerequisites are installed `_. + +Once ``pyenv`` is installed, install a compatible Python version:: # Install Python pyenv install 3.8.0 From 726f89062ca7cb2b5fdfae2e6a3e48011fdb0846 Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Mon, 23 Mar 2020 11:58:45 +0100 Subject: [PATCH 3/4] Highlight pyenv prereqs --- docs/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index b2746633a..a32b2fd5d 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -22,7 +22,7 @@ Python * Python3 header files (included in the Python3 development package). * ``pip3`` available on the path. Verify with ``pip3 --version``. -We recommend to use `pyenv `_ to manage installation of Python. For details refer to their `installation instructions `_ and `ensure that all of pyenv's prerequisites are installed `_. +We recommend to use `pyenv `_ to manage installation of Python. For details refer to their `installation instructions `_ and **ensure that all of** `pyenv's prerequisites `_ are installed. Once ``pyenv`` is installed, install a compatible Python version:: From e49b85af80adbe25d6971d6c7075568c1a9e6eb3 Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Mon, 23 Mar 2020 13:48:17 +0100 Subject: [PATCH 4/4] Require Python 3.8 --- .ci/variables.json | 3 +-- Makefile | 9 ++------- README.rst | 2 +- docker/Dockerfiles/Dockerfile-dev | 4 ++-- docker/Dockerfiles/Dockerfile-release | 2 +- docs/docker.rst | 2 +- docs/install.rst | 2 +- docs/migrate.rst | 4 ++-- docs/quickstart.rst | 2 +- esrally/__init__.py | 4 ++-- setup.py | 2 +- tox.ini | 2 +- 12 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.ci/variables.json b/.ci/variables.json index 4fb621b68..259b418d5 100644 --- a/.ci/variables.json +++ b/.ci/variables.json @@ -1,6 +1,5 @@ { "python_versions": { - "PY38": "3.8.0", - "PY37": "3.7.5" + "PY38": "3.8.0" } } diff --git a/Makefile b/Makefile index 18dba1c4f..ad7aef8f2 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ PYENV_REGEX = .pyenv/shims PY_BIN = python3 # https://github.com/pypa/pip/issues/5599 PIP_WRAPPER = $(PY_BIN) -m pip -PY37 = $(shell jq '.python_versions.PY37' .ci/variables.json) PY38 = $(shell jq '.python_versions.PY38' .ci/variables.json) VENV_NAME ?= .venv VENV_ACTIVATE_FILE = $(VENV_NAME)/bin/activate @@ -34,9 +33,8 @@ PYENV_PREREQ_HELP = "\033[0;31mIMPORTANT\033[0m: please add \033[0;31meval \"\$$ VE_MISSING_HELP = "\033[0;31mIMPORTANT\033[0m: Couldn't find $(PWD)/$(VENV_NAME); have you executed make venv-create?\033[0m\n" prereq: - pyenv install --skip-existing $(PY37) pyenv install --skip-existing $(PY38) - pyenv local $(PY37) $(PY38) + pyenv local $(PY38) @# Ensure all Python versions are registered for this project @ jq -r '.python_versions | [.[] | tostring] | join("\n")' .ci/variables.json > .python-version -@ printf $(PYENV_PREREQ_HELP) @@ -106,9 +104,6 @@ precommit: lint it: check-venv python-caches-clean tox-env-clean . $(VENV_ACTIVATE_FILE); tox -it37: check-venv python-caches-clean tox-env-clean - . $(VENV_ACTIVATE_FILE); tox -e py37 - it38: check-venv python-caches-clean tox-env-clean . $(VENV_ACTIVATE_FILE); tox -e py38 @@ -126,4 +121,4 @@ release-checks: check-venv release: check-venv release-checks clean docs it . $(VENV_ACTIVATE_FILE); ./release.sh $(release_version) $(next_version) -.PHONY: install clean nondocs-clean docs-clean python-caches-clean tox-env-clean docs serve-docs test it it37 it38 benchmark coverage release release-checks prereq venv-create check-env +.PHONY: install clean nondocs-clean docs-clean python-caches-clean tox-env-clean docs serve-docs test it it38 benchmark coverage release release-checks prereq venv-create check-env diff --git a/README.rst b/README.rst index 63f621997..b8b1a90ba 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ Installing Rally **Note**: If you actively develop on Elasticsearch, we recommend that you `install Rally in development mode `_ instead as Elasticsearch is fast moving and Rally always adapts accordingly to the latest master version. -Install Python 3.5+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: +Install Python 3.8+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: pip3 install esrally diff --git a/docker/Dockerfiles/Dockerfile-dev b/docker/Dockerfiles/Dockerfile-dev index ba49078e2..1cbb27957 100644 --- a/docker/Dockerfiles/Dockerfile-dev +++ b/docker/Dockerfiles/Dockerfile-dev @@ -3,7 +3,7 @@ # Install Rally from source inside a virtualenv ################################################################################ -FROM python:3.7.3-slim as builder +FROM python:3.8.2-slim as builder RUN apt-get -y update && \ apt-get install -y curl git gcc && \ @@ -34,7 +34,7 @@ RUN pip3 install /rally # Add entrypoint ################################################################################ -FROM python:3.7.3-slim +FROM python:3.8.2-slim ARG RALLY_VERSION ARG RALLY_LICENSE ENV RALLY_RUNNING_IN_DOCKER True diff --git a/docker/Dockerfiles/Dockerfile-release b/docker/Dockerfiles/Dockerfile-release index 21ebf4293..d66a5d1e4 100644 --- a/docker/Dockerfiles/Dockerfile-release +++ b/docker/Dockerfiles/Dockerfile-release @@ -1,4 +1,4 @@ -FROM python:3.7.3-slim +FROM python:3.8.2-slim ARG RALLY_VERSION ARG RALLY_LICENSE diff --git a/docs/docker.rst b/docs/docker.rst index 4e1c0f441..2b842a0a3 100644 --- a/docs/docker.rst +++ b/docs/docker.rst @@ -133,7 +133,7 @@ For example, after executing our earlier quickstart example ``docker run elastic To further examine the contents we can bind mount it from another image e.g.:: - $ docker run --rm -i -v=96256462c3a1f61120443e6d69d9cb0091b28a02234318bdabc52b6801972199:/rallyvolume -ti python:3.7.3-slim /bin/bash + $ docker run --rm -i -v=96256462c3a1f61120443e6d69d9cb0091b28a02234318bdabc52b6801972199:/rallyvolume -ti python:3.8.2-slim /bin/bash root@9a7dd7b3d8df:/# cd /rallyvolume/ root@9a7dd7b3d8df:/rallyvolume# ls root@9a7dd7b3d8df:/rallyvolume/.rally# ls diff --git a/docs/install.rst b/docs/install.rst index a32b2fd5d..ccb39fad4 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -18,7 +18,7 @@ Rally does not support Windows and is only actively tested on MacOS and Linux. I Python ~~~~~~ -* Python 3.7 or better available as ``python3`` on the path. Verify with: ``python3 --version``. +* Python 3.8 or better available as ``python3`` on the path. Verify with: ``python3 --version``. * Python3 header files (included in the Python3 development package). * ``pip3`` available on the path. Verify with ``pip3 --version``. diff --git a/docs/migrate.rst b/docs/migrate.rst index 789b9d37b..2e55a7f77 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -4,10 +4,10 @@ Migration Guide Migrating to Rally 1.5.0 ------------------------ -Minimum Python version is 3.7.0 +Minimum Python version is 3.8.0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Rally 1.5.0 requires Python 3.7.0. Check the :ref:`updated installation instructions ` for more details. +Rally 1.5.0 requires Python 3.8.0. Check the :ref:`updated installation instructions ` for more details. Migrating to Rally 1.4.1 ------------------------ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index d32b31046..6219f04bf 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -6,7 +6,7 @@ Rally is developed for Unix and is actively tested on Linux and MacOS. Rally sup Install ------- -Install Python 3.7+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: +Install Python 3.8+ including ``pip3``, git 1.9+ and an `appropriate JDK to run Elasticsearch `_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary:: pip3 install esrally diff --git a/esrally/__init__.py b/esrally/__init__.py index a5a42e631..4ba990251 100644 --- a/esrally/__init__.py +++ b/esrally/__init__.py @@ -72,8 +72,8 @@ def check_python_version(): - if sys.version_info.major != 3 or sys.version_info.minor < 7: - raise RuntimeError("Rally requires at least Python 3.7 but you are using:\n\nPython %s" % str(sys.version)) + if sys.version_info.major != 3 or sys.version_info.minor < 8: + raise RuntimeError("Rally requires at least Python 3.8 but you are using:\n\nPython %s" % str(sys.version)) def doc_link(path=None): diff --git a/setup.py b/setup.py index 04ccc2b6e..22643fd8a 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def str_from_file(name): long_description = str_from_file("README.rst") # tuples of (major, minor) of supported Python versions ordered from lowest to highest -supported_python_versions = [(3, 7), (3, 8)] +supported_python_versions = [(3, 8)] ################################################################################################ # diff --git a/tox.ini b/tox.ini index 28838706c..838392ca5 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ ############################################################################### [tox] envlist = - docs, py37, py38 + docs, py38 platform = linux|darwin