From 90cc90551f77c70928f10e6196fde4e3b5cbb330 Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Wed, 21 Feb 2024 08:14:48 +0100 Subject: [PATCH 1/2] PHOENIX-7222 Fix tox tests and add Python 3.12 to supported versions and the test matrix --- python-phoenixdb/Dockerfile | 4 ++-- python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py | 2 +- python-phoenixdb/setup.py | 3 ++- python-phoenixdb/tox.ini | 5 ++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/python-phoenixdb/Dockerfile b/python-phoenixdb/Dockerfile index 95f6b2d..daf8a4e 100644 --- a/python-phoenixdb/Dockerfile +++ b/python-phoenixdb/Dockerfile @@ -13,13 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from advian/tox-base:ubuntu as tox +from advian/tox-base:ubuntu-jammy-2024-02-07 as tox ########################### # Prebuild given versions # ########################### ARG BUILD_PYTHON_VERSIONS="3.11 3.10 3.9 3.8" #Can we take this from the parent image ? -ARG EXTRA_PYTHON_VERSIONS="3.5 3.6 3.7 2.7" +ARG EXTRA_PYTHON_VERSIONS="3.12 3.5 3.6 3.7 2.7" RUN export RESOLVED_VERSIONS=`pyenv_resolve $BUILD_PYTHON_VERSIONS` \ && export EXTRA_RESOLVED_VERSIONS=`pyenv_resolve $EXTRA_PYTHON_VERSIONS` \ && for pyver in $EXTRA_RESOLVED_VERSIONS; do pyenv install $pyver; done \ diff --git a/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py b/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py index d21b827..3df83ef 100644 --- a/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py +++ b/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py @@ -22,7 +22,7 @@ from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext from sqlalchemy.exc import CompileError from sqlalchemy.sql.compiler import DDLCompiler -from sqlalchemy.types import BIGINT, BOOLEAN, CHAR, DATE, DECIMAL, FLOAT, INTEGER, NUMERIC,\ +from sqlalchemy.types import BIGINT, BOOLEAN, CHAR, DATE, DECIMAL, FLOAT, INTEGER, NUMERIC, \ SMALLINT, TIME, TIMESTAMP, VARBINARY, VARCHAR if sys.version_info.major == 3: diff --git a/python-phoenixdb/setup.py b/python-phoenixdb/setup.py index 3245433..c3acca5 100644 --- a/python-phoenixdb/setup.py +++ b/python-phoenixdb/setup.py @@ -88,7 +88,8 @@ def readme(): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11' + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' ], install_requires=install_requires, tests_require=[ diff --git a/python-phoenixdb/tox.ini b/python-phoenixdb/tox.ini index 5739ed7..8b41293 100644 --- a/python-phoenixdb/tox.ini +++ b/python-phoenixdb/tox.ini @@ -14,6 +14,8 @@ # limitations under the License. [tox] +# See https://tox.wiki/en/latest/faq.html#testing-end-of-life-python-versions +requires = virtualenv<20.22.0 envlist = py27-SQLAlchemy{13,14}, py35-SQLAlchemy{13}, py36-SQLAlchemy{13,14}, @@ -21,7 +23,8 @@ envlist = py27-SQLAlchemy{13,14}, py38-SQLAlchemy{13,14,20}, py39-SQLAlchemy{13,14,20}, py310-SQLAlchemy{13,14,20}, - py311-SQLAlchemy{13,14,20} + py311-SQLAlchemy{13,14,20}, + py312-SQLAlchemy{13,14,20} [testenv] passenv = PHOENIXDB_TEST_DB_URL commands = From 11f2604636c846b58875ecefd2b286ce5ff03d9a Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Wed, 21 Feb 2024 10:29:20 +0100 Subject: [PATCH 2/2] update docs and gitignore --- python-phoenixdb/.gitignore | 1 + python-phoenixdb/README.rst | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/python-phoenixdb/.gitignore b/python-phoenixdb/.gitignore index d7a54af..369f6a2 100644 --- a/python-phoenixdb/.gitignore +++ b/python-phoenixdb/.gitignore @@ -11,3 +11,4 @@ dev-support/work phoenixdb/.eggs phoenixdb/build phoenixdb/e +phoenixdb/.python-version diff --git a/python-phoenixdb/README.rst b/python-phoenixdb/README.rst index 3858ea0..0c609a8 100644 --- a/python-phoenixdb/README.rst +++ b/python-phoenixdb/README.rst @@ -68,19 +68,22 @@ necessary requirements:: You can start a Phoenix QueryServer instance on http://localhost:8765 for testing by running the following command in the pohoenix-queryserver-parent directory:: - mvn clean verify -am -pl phoenix-queryserver-it -Dtest=foo \ + mvn clean verify -Pshade-javax-servlet -am -pl phoenix-queryserver-it -Dtest=foo \ -Dit.test=QueryServerBasicsIT#startLocalPQS \ -Ddo.not.randomize.pqs.port=true -Dstart.unsecure.pqs=true You can start a secure (https+kerberos) Phoenix QueryServer instance on https://localhost:8765 for testing by running the following command in the phoenix-queryserver-parent directory:: - mvn clean verify -am -pl phoenix-queryserver-it -Dtest=foo \ + mvn clean verify -Pshade-javax-servlet -am -pl phoenix-queryserver-it -Dtest=foo \ -Dit.test=SecureQueryServerPhoenixDBIT#startLocalPQS \ -Ddo.not.randomize.pqs.port=true -Dstart.secure.pqs=true -this will also create a shell script in phoenix-queryserver-it/target/krb_setup.sh, that you can use to set -up the environment for the tests. +this will also create a shell script in phoenix-queryserver-it/target/krb_setup.sh, that you can +use to set up the environment for the tests. + +Note: Depending on the Phoenix version used for building, you may or may not need the +`-Pshade-javax-servlet` option. Check BUILDING.md in the repository root. If you want to use the library without installing the phoenixdb library, you can use the `PYTHONPATH` environment variable to point to the library directly::