Updated dependencies.

master
Pacman Ghost 2 years ago
parent f93888c51b
commit 3a5e472b36
  1. 86
      .pylintrc
  2. 8
      Dockerfile
  3. 2
      docker/config/site.cfg
  4. 4
      freeze.py
  5. 10
      requirements-dev.txt
  6. 12
      requirements.txt
  7. 2
      vasl_templates/about.py
  8. 6
      vasl_templates/main_window.py
  9. 4
      vasl_templates/server_settings.py
  10. 2
      vasl_templates/web_channel.py
  11. 2
      vasl_templates/webapp/lfa.py
  12. 2
      vasl_templates/webapp/snippets.py
  13. 2
      vasl_templates/webapp/tests/control_tests.py
  14. 2
      vasl_templates/webapp/tests/control_tests_servicer.py
  15. 2
      vasl_templates/webapp/tests/test_counters.py
  16. 2
      vasl_templates/webapp/utils.py
  17. 2
      vasl_templates/webapp/vassal.py
  18. 2
      vasl_templates/webapp/vo.py

@ -54,88 +54,14 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have # --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes # no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W" # --disable=W"
disable=print-statement, disable=
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
invalid-unicode-literal,
raw-checker-failed, raw-checker-failed,
bad-inline-option, bad-inline-option,
locally-disabled, locally-disabled,
locally-enabled,
file-ignored, file-ignored,
suppressed-message, suppressed-message,
useless-suppression, useless-suppression,
deprecated-pragma, deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
bad-whitespace,
bad-continuation,
invalid-name, invalid-name,
wrong-import-position, wrong-import-position,
global-statement, global-statement,
@ -149,7 +75,8 @@ disable=print-statement,
isinstance-second-argument-not-valid-type, isinstance-second-argument-not-valid-type,
consider-using-f-string, consider-using-f-string,
consider-using-max-builtin, consider-using-max-builtin,
use-implicit-booleaness-not-comparison use-implicit-booleaness-not-comparison,
unnecessary-lambda-assignment,
# Enable the message, report, category or checker with the given id(s). You can # Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option # either give multiple identifier separated by comma (,) or put this option
@ -294,13 +221,6 @@ max-line-length=120
# Maximum number of lines in a module # Maximum number of lines in a module
max-module-lines=1000 max-module-lines=1000
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator
# Allow the body of a class to be on the same line as the declaration if body # Allow the body of a class to be on the same line as the declaration if body
# contains single statement. # contains single statement.
single-line-class-stmt=no single-line-class-stmt=no

@ -1,17 +1,17 @@
# NOTE: Use the run-container.sh script to build and launch this container. # NOTE: Use the run-container.sh script to build and launch this container.
# NOTE: Multi-stage builds require Docker >= 17.05. # NOTE: Multi-stage builds require Docker >= 17.05.
FROM rockylinux:8 AS base FROM rockylinux:8.5 AS base
# update packages and install requirements # update packages and install requirements
RUN dnf -y upgrade-minimal && \ RUN dnf -y upgrade-minimal && \
dnf install -y python38 dnf install -y python39
# NOTE: We don't need the following stuff for the build step, but it's nice to not have to re-install # NOTE: We don't need the following stuff for the build step, but it's nice to not have to re-install
# it all every time we change the requirements :-/ # it all every time we change the requirements :-/
# install Java # install Java
ARG JAVA_URL=https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz ARG JAVA_URL=https://download.oracle.com/java/17/archive/jdk-17.0.2_linux-x64_bin.tar.gz
RUN curl -s "$JAVA_URL" | tar -xz -C /usr/bin/ RUN curl -s "$JAVA_URL" | tar -xz -C /usr/bin/
# install Firefox # install Firefox
@ -22,7 +22,7 @@ RUN dnf install -y bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \
echo "exclude=firefox" >>/etc/dnf/dnf.conf echo "exclude=firefox" >>/etc/dnf/dnf.conf
# install geckodriver # install geckodriver
ARG GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz ARG GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
RUN curl -sL "$GECKODRIVER_URL" | tar -xz -C /usr/bin/ RUN curl -sL "$GECKODRIVER_URL" | tar -xz -C /usr/bin/
# clean up # clean up

@ -2,5 +2,5 @@
IS_CONTAINER = 1 IS_CONTAINER = 1
JAVA_PATH = /usr/bin/jdk-15.0.1/bin/java JAVA_PATH = /usr/bin/jdk-17.0.2/bin/java
WEBDRIVER_PATH = /usr/bin/geckodriver WEBDRIVER_PATH = /usr/bin/geckodriver

@ -95,8 +95,8 @@ def main( args ): #pylint: disable=too-many-locals
args.append( "--noconsole" ) args.append( "--noconsole" )
args.extend( [ "--icon", APP_ICON ] ) args.extend( [ "--icon", APP_ICON ] )
# NOTE: These files are not always required but it's probably safer to always include them. # NOTE: These files are not always required but it's probably safer to always include them.
import distutils.sysconfig #pylint: disable=import-error import sysconfig
dname = os.path.join( distutils.sysconfig.get_python_lib() , "PyQt5/Qt5/bin" ) dname = os.path.join( sysconfig.get_path("platlib") , "PyQt5/Qt5/bin" )
args.extend( [ "--add-binary", os.path.join(dname,"libEGL.dll") + os.pathsep + "PyQt5/Qt/bin" ] ) args.extend( [ "--add-binary", os.path.join(dname,"libEGL.dll") + os.pathsep + "PyQt5/Qt/bin" ] )
args.extend( [ "--add-binary", os.path.join(dname,"libGLESv2.dll") + os.pathsep + "PyQt5/Qt/bin" ] ) args.extend( [ "--add-binary", os.path.join(dname,"libGLESv2.dll") + os.pathsep + "PyQt5/Qt/bin" ] )
args.append( MAIN_SCRIPT ) args.append( MAIN_SCRIPT )

@ -1,7 +1,7 @@
pytest==6.2.5 pytest==7.1.2
grpcio-tools==1.44.0 grpcio-tools==1.46.3
tabulate==0.8.9 tabulate==0.8.9
lxml==4.8.0 lxml==4.9.0
pylint==2.12.2 pylint==2.14.1
pytest-pylint==0.18.0 pytest-pylint==0.18.0
pyinstaller==4.9 pyinstaller==5.1

@ -1,8 +1,8 @@
# python 3.8.7 # python 3.10.4
flask==2.0.3 flask==2.1.2
pyyaml==6.0 pyyaml==6.0
pillow==9.0.1 pillow==9.1.1
selenium==4.1.0 selenium==4.2.0
waitress==2.0.0 waitress==2.1.2
click==8.0.4 click==8.1.3

@ -61,7 +61,7 @@ class AboutDialog( QDialog ):
APP_HOME_URL, mo.group(1) if mo else APP_HOME_URL APP_HOME_URL, mo.group(1) if mo else APP_HOME_URL
) ) ) )
def on_app_icon_clicked( self, event ): #pylint: disable=no-self-use,unused-argument def on_app_icon_clicked( self, event ): #pylint: disable=unused-argument
"""Click handler.""" """Click handler."""
QDesktopServices.openUrl( QUrl( APP_HOME_URL ) ) QDesktopServices.openUrl( QUrl( APP_HOME_URL ) )

@ -25,7 +25,7 @@ _CONSOLE_SOURCE_REGEX = re.compile( r"^http://.+?/static/(.*)$" )
class AppWebPage( QWebEnginePage ): class AppWebPage( QWebEnginePage ):
"""Application web page.""" """Application web page."""
def acceptNavigationRequest( self, url, nav_type, is_mainframe ): #pylint: disable=no-self-use,unused-argument def acceptNavigationRequest( self, url, nav_type, is_mainframe ): #pylint: disable=unused-argument
"""Called when a link is clicked.""" """Called when a link is clicked."""
if url.host() in ("localhost","127.0.0.1"): if url.host() in ("localhost","127.0.0.1"):
if "/asl-rulebook2/" not in url.url(): # nb: asl-rulebook2 links are routed through our webapp if "/asl-rulebook2/" not in url.url(): # nb: asl-rulebook2 links are routed through our webapp
@ -39,7 +39,7 @@ class AppWebPage( QWebEnginePage ):
QDesktopServices.openUrl( url ) QDesktopServices.openUrl( url )
return False return False
def javaScriptConsoleMessage( self, level, msg, line_no, source_id ): #pylint: disable=unused-argument,no-self-use def javaScriptConsoleMessage( self, level, msg, line_no, source_id ): #pylint: disable=unused-argument
"""Log a Javascript console message.""" """Log a Javascript console message."""
mo = _CONSOLE_SOURCE_REGEX.search( source_id ) mo = _CONSOLE_SOURCE_REGEX.search( source_id )
source = mo.group(1) if mo else source_id source = mo.group(1) if mo else source_id
@ -308,7 +308,7 @@ class MainWindow( QWidget ):
@pyqtSlot( str ) @pyqtSlot( str )
@catch_exceptions( caption="SLOT EXCEPTION" ) @catch_exceptions( caption="SLOT EXCEPTION" )
def on_user_settings_change( self, user_settings ): #pylint: disable=no-self-use def on_user_settings_change( self, user_settings ):
"""Called when the user changes the user settings.""" """Called when the user changes the user settings."""
# delete all existing keys # delete all existing keys
for key in app_settings.allKeys(): for key in app_settings.allKeys():

@ -155,9 +155,9 @@ class ServerSettingsDialog( QDialog ):
app_settings.setValue( "ServerSettings/"+key, val ) app_settings.setValue( "ServerSettings/"+key, val )
try: try:
install_server_settings( False ) install_server_settings( False )
except Exception as ex: #pylint: disable=broad-except except Exception as ex2: #pylint: disable=broad-except
logging.error( traceback.format_exc() ) logging.error( traceback.format_exc() )
MainWindow.showErrorMsg( "Couldn't rollback the server settings:\n\n{}".format( ex ) ) MainWindow.showErrorMsg( "Couldn't rollback the server settings:\n\n{}".format( ex2 ) )
return return
self.close() self.close()

@ -68,7 +68,7 @@ class WebChannelHandler:
title += " (*)" title += " (*)"
self.parent.setWindowTitle( title ) self.parent.setWindowTitle( title )
def on_snippet_image( self, img_data ): #pylint: disable=no-self-use def on_snippet_image( self, img_data ):
"""Called when a snippet image has been generated.""" """Called when a snippet image has been generated."""
# NOTE: We could maybe add an HTML object to the clipboard as well, but having two formats on the clipboard # NOTE: We could maybe add an HTML object to the clipboard as well, but having two formats on the clipboard
# simultaneously might confuse some programs, causing problems for no real benefit :shrug: # simultaneously might confuse some programs, causing problems for no real benefit :shrug:

@ -4,7 +4,7 @@ import os
import time import time
import base64 import base64
import logging import logging
import xml.etree.cElementTree as ET import xml.etree.ElementTree as ET
from flask import request, jsonify from flask import request, jsonify

@ -247,7 +247,7 @@ def _get_small_image( fp, key, default_height ):
if height > 0: if height > 0:
width = img.size[0] / ( float(img.size[1]) / height ) width = img.size[0] / ( float(img.size[1]) / height )
width = int( width + 0.5 ) width = int( width + 0.5 )
img = img.resize( (width,height), Image.ANTIALIAS ) img = img.resize( (width,height), Image.Resampling.LANCZOS )
# add the image to the cache # add the image to the cache
buf = io.BytesIO() buf = io.BytesIO()
img.save( buf, format="PNG" ) img.save( buf, format="PNG" )

@ -4,7 +4,7 @@ import json
import base64 import base64
import grpc import grpc
from google.protobuf.empty_pb2 import Empty from google.protobuf.empty_pb2 import Empty #pylint: disable=no-name-in-module
from vasl_templates.webapp.tests.proto.generated.control_tests_pb2_grpc import ControlTestsStub from vasl_templates.webapp.tests.proto.generated.control_tests_pb2_grpc import ControlTestsStub
from vasl_templates.webapp.tests.proto.utils import enum_from_string from vasl_templates.webapp.tests.proto.utils import enum_from_string

@ -13,7 +13,7 @@ import inspect
import random import random
import tabulate import tabulate
from google.protobuf.empty_pb2 import Empty from google.protobuf.empty_pb2 import Empty #pylint: disable=no-name-in-module
from vasl_templates.webapp.config.constants import DATA_DIR from vasl_templates.webapp.config.constants import DATA_DIR
from vasl_templates.webapp.vassal import VassalShim from vasl_templates.webapp.vassal import VassalShim

@ -198,7 +198,7 @@ def test_compare_version_strings():
for i,vassal_version in enumerate( vassal_versions ): for i,vassal_version in enumerate( vassal_versions ):
if i > 0: if i > 0:
assert compare_version_strings( vassal_versions[i-1], vassal_version ) < 0 assert compare_version_strings( vassal_versions[i-1], vassal_version ) < 0
assert compare_version_strings( vassal_versions[i], vassal_version ) == 0 assert compare_version_strings( vassal_version, vassal_version ) == 0
if i < len(vassal_versions)-1: if i < len(vassal_versions)-1:
assert compare_version_strings( vassal_version, vassal_versions[i+1] ) < 0 assert compare_version_strings( vassal_version, vassal_versions[i+1] ) < 0

@ -178,7 +178,7 @@ def resize_image_response( resp, default_width=None, default_height=None, defaul
if width or height: if width or height:
assert width and height assert width and height
# yup - make it so # yup - make it so
img = img.resize( (int(width),int(height)), Image.ANTIALIAS ) img = img.resize( (int(width),int(height)), Image.Resampling.LANCZOS )
buf = io.BytesIO() buf = io.BytesIO()
img.save( buf, format="PNG" ) img.save( buf, format="PNG" )
buf.seek( 0 ) buf.seek( 0 )

@ -14,7 +14,7 @@ import base64
import time import time
import io import io
import zipfile import zipfile
import xml.etree.cElementTree as ET import xml.etree.ElementTree as ET
from flask import request, jsonify from flask import request, jsonify

@ -124,7 +124,7 @@ def _do_load_vo_listings( vasl_mod, vo_type, merge_common, real_data_dir, msg_st
vo_entries[i] = copy_vo_entry( vo_entry, vo_index[vo_id], nat, vo_type, msg_store ) vo_entries[i] = copy_vo_entry( vo_entry, vo_index[vo_id], nat, vo_type, msg_store )
# update nationality variants with the listings from their base nationality # update nationality variants with the listings from their base nationality
for nat in listings: for nat in list( listings.keys() ):
if "~" not in nat: if "~" not in nat:
continue continue
base_nat = nat.split( "~" )[0] base_nat = nat.split( "~" )[0]

Loading…
Cancel
Save