Skip to content

Commit

Permalink
TEMPORARY: upgraded to python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
iagaponenko committed Feb 12, 2025
1 parent 684759a commit 1488489
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 77 deletions.
25 changes: 16 additions & 9 deletions admin/tools/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN dnf install -y 'dnf-command(config-manager)' \
clang \
clang-tools-extra \
docker-ce-cli \
docker-compose-plugin \
flex \
gcc-c++ \
gdb \
Expand All @@ -50,7 +51,10 @@ RUN dnf install -y 'dnf-command(config-manager)' \
patch \
protobuf-compiler \
protobuf-devel \
python3-devel \
python3.12-devel \
python3.12 \
python3.12-pip \
python3.12-pybind11-devel \
tree \
vim \
&& dnf clean all \
Expand Down Expand Up @@ -155,17 +159,20 @@ RUN echo /usr/local/lib > /etc/ld.so.conf.d/local.conf \
&& echo /usr/local/lib64 >> /etc/ld.so.conf.d/local.conf \
&& ldconfig

RUN pip3 install \
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1

RUN pip3.12 install \
backoff \
backoff-stubs \
"click==8.1.3" \
deprecated \
docker-compose \
documenteer[guide] \
tox \
sphinx \
jinja2 \
"sphinx-rtd-theme>=1.2.0rc3" \
mypy \
"mysql-connector-python==8.0.31" \
"mysql-connector-python==8.3.0" \
numpy \
pybind11[global] \
pyyaml \
Expand Down Expand Up @@ -220,8 +227,8 @@ RUN dnf install -y 'dnf-command(config-manager)' \
openssl \
procps-ng \
protobuf \
python3 \
pip \
python3.12 \
python3.12-pip \
tree \
vim \
lsof \
Expand Down Expand Up @@ -252,7 +259,7 @@ RUN mkdir -p /qserv/data && \
mkdir -p /var/run/xrootd && \
chown qserv:qserv /qserv/data /config-etc /config-etc/ssl /qserv/run/tmp /var/run/xrootd

RUN alternatives --install /usr/bin/python python /usr/bin/python3.9 1
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
ENV PYTHONPATH "${PYTHONPATH}:/usr/local/python"

COPY --from=lite-build /usr/local/lib64/liblog4cxx.so /usr/local/lib64/
Expand All @@ -276,12 +283,12 @@ RUN echo /usr/local/lib > /etc/ld.so.conf.d/local.conf \
&& echo /usr/local/lib64 >> /etc/ld.so.conf.d/local.conf \
&& ldconfig

RUN pip3 install \
RUN pip3.12 install \
backoff \
"click==8.1.3" \
deprecated \
jinja2 \
"mysql-connector-python==8.0.31" \
"mysql-connector-python==8.3.0" \
pyyaml \
requests \
requests_toolbelt \
Expand Down
3 changes: 2 additions & 1 deletion src/admin/python/lsst/qserv/admin/cli/_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_databases() -> List[str]:
) as connection:
with closing(connection.cursor()) as cursor:
cursor.execute("show databases;")
return [str(row[0]) for row in cursor.fetchall()]
result: List[str] = []
return [str(db) for (db,) in cursor.fetchall()]

databases = get_databases()
if checkdb in databases:
Expand Down
4 changes: 2 additions & 2 deletions src/admin/python/lsst/qserv/admin/itest_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def execute(cursor: MySQLCursorAbstract, stmt: str, multi: bool = False) -> None
results = []
# cursors may contain results objects (if multi==True) or a MySQLCursor (if
# multi==False)
cursors = []
cursors: List[Any] = []

if multi:
cursors = cursor.execute(stmt, multi=True)
cursors = cursor.execute(stmt, multi=True) # type: ignore
else:
cursor.execute(stmt, multi=False)
cursors = [cursor]
Expand Down
64 changes: 0 additions & 64 deletions src/replica/python/replicaConfig.py

This file was deleted.

7 changes: 6 additions & 1 deletion src/schema/python/schemaMigMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,12 @@ def apply_migrations(self, migrations: List[Migration]) -> Optional[Version]:
stmt = f.read()
_log.debug(f"Migration statement: {stmt}")
if stmt:
for result in cursor.execute(stmt, multi=True):
for result in cursor.execute(stmt, multi=True): # type: ignore
# Cast here because MySQLCursorAbtract does not have with_rows for some reason, even though both of
# its subclasses do...
result = cast(
Union[mysql.connector.cursor.MySQLCursor, mysql.connector.cursor_cext.CMySQLCursor], result
)
if result.with_rows:
result.fetchall()
else:
Expand Down

0 comments on commit 1488489

Please sign in to comment.