diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 6f8aa2a4..dd0dd026 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-python@v3 with: - python-version: "3.10.2" + python-version: "3.10.3" architecture: "x86" - name: Install python tools diff --git a/.python-version b/.python-version index 7b59a5ca..7d4ef04f 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.10.2 +3.10.3 diff --git a/ChangeLog.md b/ChangeLog.md index 36d42dab..8d7a111c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,7 +9,7 @@ produce the Windows executables and installer. --- -* We now test against, and package with, Python 3.10.2. +* We now test against, and package with, Python 3.10.3. **As a consequence of this we no longer support Windows 7. This is due to @@ -27,6 +27,19 @@ produce the Windows executables and installer. --- +* We now test against, and package with, Python 3.10.3. + +Release 5.3.4 +=== + +Whilst EDMarketConnector.exe was fixed for the Odyssey Update 11 difference in +Journal file names, EDMC.exe was not. + +* Use the new common function for finding latest journal file in EDMC.py. +* Quietens some NavRoute related logging for the benefit of EDMC.py. This is + now at DEBUG level, rather than INFO. + + Release 5.3.3 === diff --git a/EDMC.py b/EDMC.py index 6c7163d7..ed36dfba 100755 --- a/EDMC.py +++ b/EDMC.py @@ -7,9 +7,8 @@ import json import locale import os import queue -import re import sys -from os.path import getmtime, join +from os.path import getmtime from time import sleep, time from typing import TYPE_CHECKING, Any, List, Optional @@ -65,8 +64,6 @@ l10n.Translations.install_dummy() SERVER_RETRY = 5 # retry pause for Companion servers [s] EXIT_SUCCESS, EXIT_SERVER, EXIT_CREDENTIALS, EXIT_VERIFICATION, EXIT_LAGGING, EXIT_SYS_ERR, EXIT_ARGS = range(7) -JOURNAL_RE = re.compile(r'^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$') - def versioncmp(versionstring) -> List: """Quick and dirty version comparison assuming "strict" numeric only version numbers.""" @@ -225,10 +222,7 @@ sys.path: {sys.path}''' monitor.currentdir = config.default_journal_dir logger.debug(f'logdir = "{monitor.currentdir}"') - logfiles = sorted((x for x in os.listdir(monitor.currentdir) if JOURNAL_RE.search(x)), - key=lambda x: x.split('.')[1:]) - - logfile = join(monitor.currentdir, logfiles[-1]) + logfile = monitor.journal_newest_filename(monitor.currentdir) logger.debug(f'Using logfile "{logfile}"') with open(logfile, 'r', encoding='utf-8') as loghandle: diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 6aa27ca3..b3eb10ba 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1672,15 +1672,19 @@ class AppWindow(object): def exit_tray(self, systray: 'SysTrayIcon') -> None: """Tray icon is shutting down.""" - exit_thread = threading.Thread(target=self.onexit) - exit_thread.setDaemon(True) + exit_thread = threading.Thread( + target=self.onexit, + daemon=True, + ) exit_thread.start() def onexit(self, event=None) -> None: """Application shutdown procedure.""" if sys.platform == 'win32': - shutdown_thread = threading.Thread(target=self.systray.shutdown) - shutdown_thread.setDaemon(True) + shutdown_thread = threading.Thread( + target=self.systray.shutdown, + daemon=True, + ) shutdown_thread.start() config.set_shutdown() # Signal we're in shutdown now. diff --git a/config/__init__.py b/config/__init__.py index dacb7ce6..fa485ba6 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.3.3' +_static_appversion = '5.3.4' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2022 EDCD' diff --git a/docs/Releasing.md b/docs/Releasing.md index d311c85a..2756f2fe 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -40,8 +40,8 @@ You will need several pieces of software installed, or the files from their auto-select some others). NB: If you have need to uninstall this it's "Windows Software Development Kit - Windows 10.0.19041.1" in "Apps & Features", *not* "Windows SDK AddOn". -1. [Python](https://python.org): 32-bit version of Python 3.9 for Windows. - [v3.9.5](https://www.python.org/downloads/release/python-395/) is the most +1. [Python](https://python.org): 32-bit version of Python 3.10 for Windows. + [v3.10.3](https://www.python.org/downloads/release/python-3103/) is the most recently tested version. You need the `Windows x86 executable installer` file, for the 32-bit version. Double-check the version against the `.python.version` file, as it should always contain the intended version. diff --git a/monitor.py b/monitor.py index 2eee38e2..dd388875 100644 --- a/monitor.py +++ b/monitor.py @@ -268,6 +268,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below :param journals_dir: The directory to check :return: The `str` form of the full path to the newest Journal file """ + # os.listdir(None) returns CWD's contents + if journals_dir is None: + return None + journal_files = (x for x in listdir(journals_dir) if self._RE_LOGFILE.search(x)) if journal_files: # Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log @@ -430,7 +434,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # Check whether new log file started, e.g. client (re)started. if emitter and emitter.is_alive(): - new_journal_file = self.logfile # updated by on_created watchdog callback + new_journal_file: Optional[str] = self.logfile # updated by on_created watchdog callback + else: # Poll try: @@ -2231,7 +2236,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below if self._navroute_retries_remaining == 0: return False - logger.info(f'Navroute read retry [{self._navroute_retries_remaining}]') + logger.debug(f'Navroute read retry [{self._navroute_retries_remaining}]') self._navroute_retries_remaining -= 1 if self._last_navroute_journal_timestamp is None: diff --git a/requirements-dev.txt b/requirements-dev.txt index 154c5e0f..31b82fc3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ wheel # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==60.9.3 +setuptools==60.10.0 # Static analysis tools flake8==4.0.1 @@ -20,10 +20,10 @@ flake8-noqa==1.2.1 flake8-polyfill==1.0.2 flake8-use-fstring==1.3 -mypy==0.931 +mypy==0.941 pep8-naming==0.12.1 safety==1.10.3 -types-requests==2.27.11 +types-requests==2.27.13 # Code formatting tools autopep8==1.6.0 @@ -40,7 +40,7 @@ lxml==4.8.0 py2exe==0.11.1.0; sys_platform == 'win32' # Testing -pytest==7.0.1 +pytest==7.1.0 pytest-cov==3.0.0 # Pytest code coverage support coverage[toml]==6.3.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs # For manipulating folder permissions and the like.