From 57b00c6105e63f9143fd269dd3fd79b56c247a50 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 23 Dec 2023 20:12:17 -0500 Subject: [PATCH 01/26] [Minor] Minor Code Tweaks Officially Deprecates ttkHyperlinkLabel/openurl() function, a few minor code readability updates, and updates dependencies --- l10n.py | 2 +- requirements-dev.txt | 8 ++++---- stats.py | 4 +++- td.py | 2 +- ttkHyperlinkLabel.py | 9 ++++++--- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/l10n.py b/l10n.py index 26be12fc..a34ea0dc 100755 --- a/l10n.py +++ b/l10n.py @@ -25,7 +25,7 @@ from config import config from EDMCLogging import get_main_logger if TYPE_CHECKING: - def _(x: str) -> str: ... + def _(x: str) -> str: return x # Note that this is also done in EDMarketConnector.py, and thus removing this here may not have a desired effect try: diff --git a/requirements-dev.txt b/requirements-dev.txt index 7fb98e50..331a117b 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==69.0.2 +setuptools==69.0.3 # Static analysis tools flake8==6.1.0 @@ -18,7 +18,7 @@ flake8-noqa==1.3.2 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.7.1 +mypy==1.8.0 pep8-naming==0.13.3 safety==2.3.5 types-requests==2.31.0.10 @@ -28,7 +28,7 @@ types-pkg-resources==0.1.3 autopep8==2.0.4 # Git pre-commit checking -pre-commit==3.5.0 +pre-commit==3.6.0 # HTML changelogs grip==4.6.2 @@ -40,7 +40,7 @@ py2exe==0.13.0.1; sys_platform == 'win32' # Testing pytest==7.4.3 pytest-cov==4.1.0 # Pytest code coverage support -coverage[toml]==7.3.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.3.4 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 # For manipulating folder permissions and the like. pywin32==306; sys_platform == 'win32' diff --git a/stats.py b/stats.py index 041e47f3..4351e297 100644 --- a/stats.py +++ b/stats.py @@ -5,6 +5,8 @@ Copyright (c) EDCD, All Rights Reserved Licensed under the GNU General Public License. See LICENSE file. """ +from __future__ import annotations + import csv import json import sys @@ -22,7 +24,7 @@ from monitor import monitor logger = EDMCLogging.get_main_logger() if TYPE_CHECKING: - def _(x: str) -> str: ... + def _(x: str) -> str: return x if sys.platform == 'win32': import ctypes diff --git a/td.py b/td.py index 00dd1736..6a588f57 100644 --- a/td.py +++ b/td.py @@ -32,7 +32,7 @@ def export(data: CAPIData) -> None: with open(data_path / data_filename, 'wb') as h: # Format described here: https://github.com/eyeonus/Trade-Dangerous/wiki/Price-Data h.write('#! trade.py import -\n'.encode('utf-8')) - this_platform = sys.platform == 'darwin' and "Mac OS" or system() + this_platform = "Mac OS" if sys.platform == 'darwin' else system() cmdr_name = data['commander']['name'].strip() h.write( f'# Created by {applongname} {appversion()} on {this_platform} for Cmdr {cmdr_name}.\n'.encode('utf-8') diff --git a/ttkHyperlinkLabel.py b/ttkHyperlinkLabel.py index 24470a93..fcb973ec 100644 --- a/ttkHyperlinkLabel.py +++ b/ttkHyperlinkLabel.py @@ -22,20 +22,21 @@ from __future__ import annotations import sys import tkinter as tk +import warnings import webbrowser from tkinter import font as tk_font from tkinter import ttk from typing import TYPE_CHECKING, Any if TYPE_CHECKING: - def _(x: str) -> str: ... + def _(x: str) -> str: return x # FIXME: Split this into multi-file module to separate the platforms class HyperlinkLabel(sys.platform == 'darwin' and tk.Label or ttk.Label): # type: ignore """Clickable label for HTTP links.""" - def __init__(self, master: tk.Frame | None = None, **kw: Any) -> None: + def __init__(self, master: ttk.Frame | None = None, **kw: Any) -> None: """ Initialize the HyperlinkLabel. @@ -135,7 +136,7 @@ class HyperlinkLabel(sys.platform == 'darwin' and tk.Label or ttk.Label): # typ url = self.url(self['text']) if callable(self.url) else self.url if url: self._leave(event) # Remove underline before we change window to browser - openurl(url) + webbrowser.open(url) def _contextmenu(self, event: tk.Event) -> None: if self['text'] and (self.popup_copy(self['text']) if callable(self.popup_copy) else self.popup_copy): @@ -183,4 +184,6 @@ def openurl(url: str) -> None: ended up using `webbrowser.open()` *anyway*. :param url: URL to open. """ + warnings.warn("This function is deprecated. " + "Please use `webbrowser.open() instead.", DeprecationWarning, stacklevel=2) webbrowser.open(url) From f7a23b5b6f67d316d1ba18579f042d2810079871 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 23 Dec 2023 20:12:34 -0500 Subject: [PATCH 02/26] [Minor] Bump Python Version, Update GitIgnore --- .gitignore | 1 + .python-version | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4283fcb0..a7da806e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ htmlcov/ .coverage pylintrc pylint.txt +.pylintrc # Ignore Submodule data directory coriolis-data/ diff --git a/.python-version b/.python-version index 371cfe35..d4b278f0 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11.1 +3.11.7 From e6e49d4601afb4047043cf4400504c51ac656896 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sat, 23 Dec 2023 20:20:00 -0500 Subject: [PATCH 03/26] Include .gitversion in linux archive --- .../{windows-build.yml => build-on-release.yml} | 13 ++++++++++--- config/__init__.py | 13 +++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) rename .github/workflows/{windows-build.yml => build-on-release.yml} (92%) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/build-on-release.yml similarity index 92% rename from .github/workflows/windows-build.yml rename to .github/workflows/build-on-release.yml index a3de381b..3839a734 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/build-on-release.yml @@ -1,5 +1,5 @@ # vim: tabstop=2 shiftwidth=2 -name: Build EDMC for Windows +name: Build EDMC on: push: @@ -11,7 +11,7 @@ jobs: variables: outputs: sem_ver: ${{ steps.var.outputs.sem_ver }} - archive_exclusions: ${{ steps.var.outputs.archive_exclusions }} + short_sha: ${{ steps.var.outputs.short_sha }} runs-on: "ubuntu-latest" steps: - name: Setting global variables @@ -20,6 +20,7 @@ jobs: with: script: | core.setOutput('sem_ver', '${{ github.ref_name }}'.replaceAll('Release\/', '')) + core.setOutput('short_sha', '${{ github.sha }}'.substring(0, 7)) linux_build: needs: [variables] @@ -29,6 +30,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Create .gitversion + run: | + echo "${{ needs.variables.outputs.short_sha }}" > ../.gitversion - name: Make tar archive run: | @@ -40,7 +44,10 @@ jobs: --exclude=EDMarketConnector-release-*.* \ --exclude=.editorconfig \ --exclude=.flake8 \ - --exclude=.git* \ + --exclude=.gitattribues \ + --exclude=.gitignore \ + --exclude=.gitmodules \ + --exclude=.git \ --exclude=.mypy.ini \ --exclude=.pre-commit-config.yaml \ --exclude=build.py \ diff --git a/config/__init__.py b/config/__init__.py index 77b6a0f7..73262ac9 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -137,10 +137,15 @@ def appversion() -> semantic_version.Version: shorthash = gitv.read() else: - # Running from source - shorthash = git_shorthash_from_head() - if shorthash is None: - shorthash = 'UNKNOWN' + # Running from source. For Linux, check to see if .gitversion file exists + # If so, use it. This is also required for the Flatpak + if pathlib.Path("./" + GITVERSION_FILE).is_file: + with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv: + shorthash = gitv.read() + else: + shorthash = git_shorthash_from_head() + if shorthash is None: + shorthash = 'UNKNOWN' _cached_version = semantic_version.Version(f'{_static_appversion}+{shorthash}') return _cached_version From 4ef439f1c02f69f0adbeddb35d4f536ab28ab7e7 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 23 Dec 2023 20:55:32 -0500 Subject: [PATCH 04/26] [Fix] Add Required Dupe Imports --- EDMarketConnector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 87ba6814..53c73e6c 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -336,6 +336,8 @@ if __name__ == '__main__': # noqa: C901 def already_running_popup(): """Create the "already running" popup.""" + import tkinter as tk + from tkinter import ttk # Check for CL arg that suppresses this popup. if args.suppress_dupe_process_popup: sys.exit(0) From c522250a400bb94126f3a084e3fadf2802e4ed56 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sat, 23 Dec 2023 22:03:46 -0500 Subject: [PATCH 05/26] More indentation to satisfy linter --- config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/__init__.py b/config/__init__.py index 73262ac9..5ce889f4 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -141,7 +141,7 @@ def appversion() -> semantic_version.Version: # If so, use it. This is also required for the Flatpak if pathlib.Path("./" + GITVERSION_FILE).is_file: with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv: - shorthash = gitv.read() + shorthash = gitv.read() else: shorthash = git_shorthash_from_head() if shorthash is None: From b6150cab7d0a6e159f0b93fa088add4d29e7cb7b Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 10:09:49 -0500 Subject: [PATCH 06/26] Further satisfy linter --- config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/__init__.py b/config/__init__.py index 5ce889f4..25acc41a 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -139,7 +139,7 @@ def appversion() -> semantic_version.Version: else: # Running from source. For Linux, check to see if .gitversion file exists # If so, use it. This is also required for the Flatpak - if pathlib.Path("./" + GITVERSION_FILE).is_file: + if pathlib.Path("./" + GITVERSION_FILE).is_file(): with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv: shorthash = gitv.read() else: From 16f584b519a4ede5b7e2a86f51bc26bc91c56b45 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 10:25:44 -0500 Subject: [PATCH 07/26] Rename for testing --- .github/workflows/{build-on-release.yml => windows-build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-on-release.yml => windows-build.yml} (100%) diff --git a/.github/workflows/build-on-release.yml b/.github/workflows/windows-build.yml similarity index 100% rename from .github/workflows/build-on-release.yml rename to .github/workflows/windows-build.yml From ffecae17a713fe23d39404f22e57465b8c62cf88 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 10:28:50 -0500 Subject: [PATCH 08/26] Need 8 characters --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 3839a734..55c63d90 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -20,7 +20,7 @@ jobs: with: script: | core.setOutput('sem_ver', '${{ github.ref_name }}'.replaceAll('Release\/', '')) - core.setOutput('short_sha', '${{ github.sha }}'.substring(0, 7)) + core.setOutput('short_sha', '${{ github.sha }}'.substring(0, 8)) linux_build: needs: [variables] From 4ae516677e5299e4c7e3c9edd811578cddf715fb Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 10:34:35 -0500 Subject: [PATCH 09/26] More excludes, change path for .gitversion --- .github/workflows/windows-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 55c63d90..b6883d25 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,7 +32,7 @@ jobs: submodules: true - name: Create .gitversion run: | - echo "${{ needs.variables.outputs.short_sha }}" > ../.gitversion + echo "${{ needs.variables.outputs.short_sha }}" > .gitversion - name: Make tar archive run: | @@ -44,10 +44,11 @@ jobs: --exclude=EDMarketConnector-release-*.* \ --exclude=.editorconfig \ --exclude=.flake8 \ - --exclude=.gitattribues \ + --exclude=.gitattributes \ --exclude=.gitignore \ --exclude=.gitmodules \ --exclude=.git \ + --exclude=.github \ --exclude=.mypy.ini \ --exclude=.pre-commit-config.yaml \ --exclude=build.py \ From 6f84e39a4a675512d115aba153a70cefed231770 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 11:25:37 -0500 Subject: [PATCH 10/26] Proper check for .gitversion --- config/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/__init__.py b/config/__init__.py index 25acc41a..860e9750 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -139,10 +139,12 @@ def appversion() -> semantic_version.Version: else: # Running from source. For Linux, check to see if .gitversion file exists # If so, use it. This is also required for the Flatpak - if pathlib.Path("./" + GITVERSION_FILE).is_file(): - with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv: + if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists(): + print("Found .gitversion") + with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv: shorthash = gitv.read() else: + print("Did not find .gitversion in " + sys.path[0] + "/" + GITVERSION_FILE) shorthash = git_shorthash_from_head() if shorthash is None: shorthash = 'UNKNOWN' From 35ff88b83b20be659657a517602d4a099d10163d Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 15:58:06 -0500 Subject: [PATCH 11/26] Remove debug prints --- config/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/__init__.py b/config/__init__.py index 860e9750..acd6bbb6 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -140,11 +140,9 @@ def appversion() -> semantic_version.Version: # Running from source. For Linux, check to see if .gitversion file exists # If so, use it. This is also required for the Flatpak if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists(): - print("Found .gitversion") with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv: shorthash = gitv.read() else: - print("Did not find .gitversion in " + sys.path[0] + "/" + GITVERSION_FILE) shorthash = git_shorthash_from_head() if shorthash is None: shorthash = 'UNKNOWN' From 3947c6af63fd90d644e90ebf0c06238f0cf89129 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 24 Dec 2023 21:42:00 -0500 Subject: [PATCH 12/26] Reorder cases --- config/__init__.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/config/__init__.py b/config/__init__.py index acd6bbb6..33d531e9 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -137,14 +137,15 @@ def appversion() -> semantic_version.Version: shorthash = gitv.read() else: - # Running from source. For Linux, check to see if .gitversion file exists - # If so, use it. This is also required for the Flatpak - if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists(): - with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv: - shorthash = gitv.read() - else: - shorthash = git_shorthash_from_head() - if shorthash is None: + # Running from source. Use git rev-parse --short HEAD + # or fall back to .gitversion file if it exists. + # This is also required for the Flatpak + shorthash = git_shorthash_from_head() + if shorthash is None: + if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists(): + with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv: + shorthash = gitv.read() + else: shorthash = 'UNKNOWN' _cached_version = semantic_version.Version(f'{_static_appversion}+{shorthash}') From b7633fa6e39b38f6ba0430b8602bd69aef510767 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 27 Dec 2023 00:29:35 -0500 Subject: [PATCH 13/26] Handover a number of Lists to Tuples Tuples are (slightly) more efficient for comparing if x in y. Not that it'll really matter at this scale, but it's technically better and simple to implement. Applying to all files except theme.py, because theme.py is scary. --- EDMarketConnector.py | 4 ++-- hotkey/darwin.py | 4 ++-- hotkey/windows.py | 8 ++++---- outfitting.py | 8 ++++---- plug.py | 4 ++-- plugins/inara.py | 10 +++++----- tests/config/_old_config.py | 2 +- ttkHyperlinkLabel.py | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 87ba6814..4b73f9f3 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1547,7 +1547,7 @@ class AppWindow: self.w.update_idletasks() # Companion login - if entry['event'] in [None, 'StartUp', 'NewCommander', 'LoadGame'] and monitor.cmdr: + if entry['event'] in (None, 'StartUp', 'NewCommander', 'LoadGame') and monitor.cmdr: if not config.get_list('cmdrs') or monitor.cmdr not in config.get_list('cmdrs'): config.set('cmdrs', config.get_list('cmdrs', default=[]) + [monitor.cmdr]) self.login() @@ -1565,7 +1565,7 @@ class AppWindow: logger.trace_if('journal.queue', 'Startup, returning') return # Startup - if entry['event'] in ['StartUp', 'LoadGame'] and monitor.started: + if entry['event'] in ('StartUp', 'LoadGame') and monitor.started: logger.info('StartUp or LoadGame event') # Disable WinSparkle automatic update checks, IFF configured to do so when in-game diff --git a/hotkey/darwin.py b/hotkey/darwin.py index 63f9d132..6afd0239 100644 --- a/hotkey/darwin.py +++ b/hotkey/darwin.py @@ -211,12 +211,12 @@ class MacHotkeyMgr(AbstractHotkeyMgr): return False # BkSp, Del, Clear = clear hotkey - if keycode in [0x7f, ord(NSDeleteFunctionKey), ord(NSClearLineFunctionKey)]: + if keycode in (0x7f, ord(NSDeleteFunctionKey), ord(NSClearLineFunctionKey)): self.acquire_state = MacHotkeyMgr.ACQUIRE_INACTIVE return None # don't allow keys needed for typing in System Map - if keycode in [0x13, 0x20, 0x2d] or 0x61 <= keycode <= 0x7a: + if keycode in (0x13, 0x20, 0x2d) or 0x61 <= keycode <= 0x7a: NSBeep() self.acquire_state = MacHotkeyMgr.ACQUIRE_INACTIVE return None diff --git a/hotkey/windows.py b/hotkey/windows.py index f21a24b2..fa4cb3a6 100644 --- a/hotkey/windows.py +++ b/hotkey/windows.py @@ -284,23 +284,23 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): | ((GetKeyState(VK_RWIN) & 0x8000) and MOD_WIN) keycode = event.keycode - if keycode in [VK_SHIFT, VK_CONTROL, VK_MENU, VK_LWIN, VK_RWIN]: + if keycode in (VK_SHIFT, VK_CONTROL, VK_MENU, VK_LWIN, VK_RWIN): return 0, modifiers if not modifiers: if keycode == VK_ESCAPE: # Esc = retain previous return False - if keycode in [VK_BACK, VK_DELETE, VK_CLEAR, VK_OEM_CLEAR]: # BkSp, Del, Clear = clear hotkey + if keycode in (VK_BACK, VK_DELETE, VK_CLEAR, VK_OEM_CLEAR): # BkSp, Del, Clear = clear hotkey return None if ( - keycode in [VK_RETURN, VK_SPACE, VK_OEM_MINUS] or ord('A') <= keycode <= ord('Z') + keycode in (VK_RETURN, VK_SPACE, VK_OEM_MINUS) or ord('A') <= keycode <= ord('Z') ): # don't allow keys needed for typing in System Map winsound.MessageBeep() return None - if (keycode in [VK_NUMLOCK, VK_SCROLL, VK_PROCESSKEY] + if (keycode in (VK_NUMLOCK, VK_SCROLL, VK_PROCESSKEY) or VK_CAPITAL <= keycode <= VK_MODECHANGE): # ignore unmodified mode switch keys return 0, modifiers diff --git a/outfitting.py b/outfitting.py index 07e8ae76..3305929c 100644 --- a/outfitting.py +++ b/outfitting.py @@ -79,7 +79,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['rating'] = 'I' # Skip uninteresting stuff - some no longer present in ED 3.1 cAPI data - elif (name[0] in [ + elif (name[0] in ( 'bobble', 'decal', 'nameplate', @@ -87,7 +87,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 'enginecustomisation', 'voicepack', 'weaponcustomisation' - ] + ) or name[1].startswith('shipkit')): return None @@ -205,10 +205,10 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 elif len(name) < 4 and name[1] == 'resourcesiphon': # Hack! 128066402 has no size or class. (new['class'], new['rating']) = ('1', 'I') - elif len(name) < 4 and name[1] in ['guardianpowerdistributor', 'guardianpowerplant']: # Hack! No class. + elif len(name) < 4 and name[1] in ('guardianpowerdistributor', 'guardianpowerplant'): # Hack! No class. (new['class'], new['rating']) = (str(name[2][4:]), 'A') - elif len(name) < 4 and name[1] in ['guardianfsdbooster']: # Hack! No class. + elif len(name) < 4 and name[1] == 'guardianfsdbooster': # Hack! No class. (new['class'], new['rating']) = (str(name[2][4:]), 'H') else: diff --git a/plug.py b/plug.py index aa34ce77..15e7cfaa 100644 --- a/plug.py +++ b/plug.py @@ -165,7 +165,7 @@ def load_plugins(master: tk.Tk) -> None: def _load_internal_plugins(): internal = [] for name in sorted(os.listdir(config.internal_plugin_dir_path)): - if name.endswith('.py') and name[0] not in ['.', '_']: + if name.endswith('.py') and name[0] not in ('.', '_'): try: plugin = Plugin(name[:-3], os.path.join(config.internal_plugin_dir_path, name), logger) plugin.folder = None @@ -184,7 +184,7 @@ def _load_found_plugins(): for name in sorted(os.listdir(config.plugin_dir_path), key=lambda n: ( not os.path.isfile(os.path.join(config.plugin_dir_path, n, '__init__.py')), n.lower())): - if not os.path.isdir(os.path.join(config.plugin_dir_path, name)) or name[0] in ['.', '_']: + if not os.path.isdir(os.path.join(config.plugin_dir_path, name)) or name[0] in ('.', '_'): pass elif name.endswith('.disabled'): name, discard = name.rsplit('.', 1) diff --git a/plugins/inara.py b/plugins/inara.py index 199e6a1c..d523bb2e 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -918,7 +918,7 @@ def journal_entry( # noqa: C901, CCR001 ]) # optional mission-specific properties - for (iprop, prop) in [ + for (iprop, prop) in ( ('missionExpiry', 'Expiry'), # Listed as optional in the docs, but always seems to be present ('starsystemNameTarget', 'DestinationSystem'), ('stationNameTarget', 'DestinationStation'), @@ -932,7 +932,7 @@ def journal_entry( # noqa: C901, CCR001 ('passengerCount', 'PassengerCount'), ('passengerIsVIP', 'PassengerVIPs'), ('passengerIsWanted', 'PassengerWanted'), - ]: + ): if prop in entry: data[iprop] = entry[prop] @@ -1295,7 +1295,7 @@ def journal_entry( # noqa: C901, CCR001 # Friends if event_name == 'Friends': - if entry['Status'] in ['Added', 'Online']: + if entry['Status'] in ('Added', 'Online'): new_add_event( 'addCommanderFriend', entry['timestamp'], @@ -1305,7 +1305,7 @@ def journal_entry( # noqa: C901, CCR001 } ) - elif entry['Status'] in ['Declined', 'Lost']: + elif entry['Status'] in ('Declined', 'Lost'): new_add_event( 'delCommanderFriend', entry['timestamp'], @@ -1666,7 +1666,7 @@ def handle_special_events(data_event: dict[str, Any], reply_event: dict[str, Any this.lastlocation = reply_event.get('eventData', {}) if not config.shutting_down: this.system_link.event_generate('<>', when="tail") - elif data_event['eventName'] in ['addCommanderShip', 'setCommanderShip']: + elif data_event['eventName'] in ('addCommanderShip', 'setCommanderShip'): this.lastship = reply_event.get('eventData', {}) if not config.shutting_down: this.system_link.event_generate('<>', when="tail") diff --git a/tests/config/_old_config.py b/tests/config/_old_config.py index 22f0b18f..690c75eb 100644 --- a/tests/config/_old_config.py +++ b/tests/config/_old_config.py @@ -296,7 +296,7 @@ class OldConfig: None, ctypes.byref(key_size) ) - or key_type.value not in [REG_SZ, REG_MULTI_SZ] + or key_type.value not in (REG_SZ, REG_MULTI_SZ) ): return default diff --git a/ttkHyperlinkLabel.py b/ttkHyperlinkLabel.py index 24470a93..d3858bad 100644 --- a/ttkHyperlinkLabel.py +++ b/ttkHyperlinkLabel.py @@ -80,10 +80,10 @@ class HyperlinkLabel(sys.platform == 'darwin' and tk.Label or ttk.Label): # typ ) -> dict[str, tuple[str, str, str, Any, Any]] | None: """Change cursor and appearance depending on state and text.""" # This class' state - for thing in ['url', 'popup_copy', 'underline']: + for thing in ('url', 'popup_copy', 'underline'): if thing in kw: setattr(self, thing, kw.pop(thing)) - for thing in ['foreground', 'disabledforeground']: + for thing in ('foreground', 'disabledforeground'): if thing in kw: setattr(self, thing, kw[thing]) From 2e7c9ef38b8d44c3972fd0c0e88802f66ce1987e Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 30 Dec 2023 11:31:36 -0500 Subject: [PATCH 14/26] [2125] Updates Exception Check We removed a general exception check and didn't cover all edge cases here. Add back the proper edge case. --- config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/__init__.py b/config/__init__.py index 33d531e9..d3ba3d3d 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -99,7 +99,7 @@ def git_shorthash_from_head() -> str: ) out, err = git_cmd.communicate() - except subprocess.CalledProcessError as e: + except (subprocess.CalledProcessError, FileNotFoundError) as e: logger.info(f"Couldn't run git command for short hash: {e!r}") else: From d333450bef6696f791b7fdbf47d321e4bf11b1ee Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 30 Dec 2023 12:21:35 -0500 Subject: [PATCH 15/26] [Nit] Clarify Shorthash Type It can be None. Declare it can be None. --- config/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/__init__.py b/config/__init__.py index d3ba3d3d..046e7599 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -81,15 +81,15 @@ else: _T = TypeVar('_T') -def git_shorthash_from_head() -> str: +def git_shorthash_from_head() -> str | None: """ Determine short hash for current git HEAD. Includes `.DIRTY` if any changes have been made from HEAD - :return: str - None if we couldn't determine the short hash. + :return: str | None: None if we couldn't determine the short hash. """ - shorthash: str = None # type: ignore + shorthash: str | None = None try: git_cmd = subprocess.Popen( @@ -106,7 +106,7 @@ def git_shorthash_from_head() -> str: shorthash = out.decode().rstrip('\n') if re.match(r'^[0-9a-f]{7,}$', shorthash) is None: logger.error(f"'{shorthash}' doesn't look like a valid git short hash, forcing to None") - shorthash = None # type: ignore + shorthash = None if shorthash is not None: with contextlib.suppress(Exception): @@ -134,7 +134,7 @@ def appversion() -> semantic_version.Version: # Running frozen, so we should have a .gitversion file # Yes, .parent because if frozen we're inside library.zip with open(pathlib.Path(sys.path[0]).parent / GITVERSION_FILE, encoding='utf-8') as gitv: - shorthash = gitv.read() + shorthash: str | None = gitv.read() else: # Running from source. Use git rev-parse --short HEAD From 66ea2d3886a1f170f7c51bdf0924819ff333f4ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:54:03 +0000 Subject: [PATCH 16/26] build(deps): bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b6883d25..1058136d 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -142,7 +142,7 @@ jobs: steps: - name: Download binary - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: Built files path: ./ From 42c63b37e99fdbc6154d56eef4d3490a4f4b8013 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:54:09 +0000 Subject: [PATCH 17/26] build(deps): bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pr-checks.yml | 2 +- .github/workflows/push-checks.yml | 2 +- .github/workflows/windows-build.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index ea9a3093..32deb018 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -53,7 +53,7 @@ jobs: # Get Python set up #################################################################### - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version-file: '.python-version' - name: Install dependencies diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index 803bfe95..31ecfd6d 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -26,7 +26,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version-file: '.python-version' - name: Install dependencies diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b6883d25..1c3c4118 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -101,7 +101,7 @@ jobs: # presumably due to a Windows CL length limit. exclusions: 'EDMarketConnector/EDMarketConnector-release-*.* EDMarketConnector/.editorconfig EDMarketConnector/.flake8 EDMarketConnector/.git* EDMarketConnector/.mypy.ini EDMarketConnector/.pre-commit-config.yaml EDMarketConnector/build.py EDMarketConnector/*.manifest EDMarketConnector/coriolis-data/ EDMarketConnector/img/ EDMarketConnector/pyproject.toml EDMarketConnector/scripts/ EDMarketConnector/tests/' - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version-file: '.python-version' architecture: "x86" From f2297698f2ee550874f163ffaf755a6a6e04c3f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:54:14 +0000 Subject: [PATCH 18/26] build(deps): bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b6883d25..994fefe1 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -62,7 +62,7 @@ jobs: mv ../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz . - name: Upload build files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Built files path: | @@ -127,7 +127,7 @@ jobs: filepath: './EDMC_Installer_Config.iss' - name: Upload build files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Built files path: | From df7d449c9b161a73b393b488603aacebfb64fe80 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 18:02:29 -0500 Subject: [PATCH 19/26] [Fix] Correct Type Hint --- ttkHyperlinkLabel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttkHyperlinkLabel.py b/ttkHyperlinkLabel.py index fcb973ec..042e83ce 100644 --- a/ttkHyperlinkLabel.py +++ b/ttkHyperlinkLabel.py @@ -36,7 +36,7 @@ if TYPE_CHECKING: class HyperlinkLabel(sys.platform == 'darwin' and tk.Label or ttk.Label): # type: ignore """Clickable label for HTTP links.""" - def __init__(self, master: ttk.Frame | None = None, **kw: Any) -> None: + def __init__(self, master: ttk.Frame | tk.Frame | None = None, **kw: Any) -> None: """ Initialize the HyperlinkLabel. From e0f687a334f086adf11c27ef241880d87378df4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 23:04:10 +0000 Subject: [PATCH 20/26] build(deps-dev): bump types-requests from 2.31.0.10 to 2.31.0.20231231 Bumps [types-requests](https://github.com/python/typeshed) from 2.31.0.10 to 2.31.0.20231231. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-requests dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 331a117b..f8d701ff 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -21,7 +21,7 @@ flake8-use-fstring==1.4 mypy==1.8.0 pep8-naming==0.13.3 safety==2.3.5 -types-requests==2.31.0.10 +types-requests==2.31.0.20231231 types-pkg-resources==0.1.3 # Code formatting tools From 620188a9f086251b9996c43f20f913afb020bb0c Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 18:41:21 -0500 Subject: [PATCH 21/26] [Fix] Reunify Resource File Locations Running from source and built had these json files in different locations. Fixing to the intended unified spot. --- build.py | 4 ++-- coriolis-update-files.py | 4 ++-- resources/modules.json => modules.json | 0 resources/ships.json => ships.json | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename resources/modules.json => modules.json (100%) rename resources/ships.json => ships.json (100%) diff --git a/build.py b/build.py index e1d37f49..a86689a7 100644 --- a/build.py +++ b/build.py @@ -77,8 +77,8 @@ def generate_data_files( "snd_good.wav", "snd_bad.wav", "modules.p", # TODO: Remove in 6.0 - "resources/modules.json", - "resources/ships.json", + "modules.json", + "ships.json", "ships.p", # TODO: Remove in 6.0 f"{app_name}.VisualElementsManifest.xml", f"{app_name}.ico", diff --git a/coriolis-update-files.py b/coriolis-update-files.py index b68d9647..9c1d7ecc 100755 --- a/coriolis-update-files.py +++ b/coriolis-update-files.py @@ -57,7 +57,7 @@ if __name__ == "__main__": modules['_'.join([reverse_ship_map[name], 'armour', bulkhead])] = {'mass': m['bulkheads'][i]['mass']} ships = OrderedDict([(k, ships[k]) for k in sorted(ships)]) # sort for easier diffing - with open("resources/ships.json", "w") as ships_file: + with open("ships.json", "w") as ships_file: json.dump(ships, ships_file, indent=4) # Module masses @@ -92,5 +92,5 @@ if __name__ == "__main__": add(modules, 'hpt_multicannon_fixed_medium_advanced', {'mass': 4}) modules = OrderedDict([(k, modules[k]) for k in sorted(modules)]) # sort for easier diffing - with open("resources/modules.json", "w") as modules_file: + with open("modules.json", "w") as modules_file: json.dump(modules, modules_file, indent=4) diff --git a/resources/modules.json b/modules.json similarity index 100% rename from resources/modules.json rename to modules.json diff --git a/resources/ships.json b/ships.json similarity index 100% rename from resources/ships.json rename to ships.json From bcb8a4a999afad5ca9766b8b08429f2cd4a9a12b Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 19:02:15 -0500 Subject: [PATCH 22/26] [Fix] Unify Resources Folder --- edshipyard.py | 2 +- outfitting.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edshipyard.py b/edshipyard.py index 5d14009c..1660ad7e 100644 --- a/edshipyard.py +++ b/edshipyard.py @@ -24,7 +24,7 @@ __Module = dict[str, Union[str, list[str]]] # Have to keep old-style here for c ship_map = ship_name_map.copy() # Ship masses -ships_file = config.respath_path / "resources" / "ships.json" +ships_file = config.respath_path / "ships.json" with open(ships_file, encoding="utf-8") as ships_file_handle: ships = json.load(ships_file_handle) diff --git a/outfitting.py b/outfitting.py index 3305929c..2bb47c6d 100644 --- a/outfitting.py +++ b/outfitting.py @@ -57,7 +57,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 """ # Lazily populate if not moduledata: - modules_path = config.respath_path / "resources" / "modules.json" + modules_path = config.respath_path / "modules.json" moduledata.update(json.loads(modules_path.read_text())) if not module.get('name'): From 7cf78a5075f861475879498405e9763a4cea7ae6 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 19:15:39 -0500 Subject: [PATCH 23/26] [Minor] Update Winsparkle Version --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 1e07fa96..ed9ef874 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -113,9 +113,9 @@ jobs: - name: Download winsparkle run: | - Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.0/WinSparkle-0.8.0.zip -OutFile out.zip + Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.1/WinSparkle-0.8.1.zip -OutFile out.zip Expand-Archive out.zip - Move-Item 'out\WinSparkle-0.8.0\Release\*' '.\' + Move-Item 'out\WinSparkle-0.8.1\Release\*' '.\' - name: Build EDMC run: | From cba3cbea93a0e9726e498a54e3276751f651716f Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 19:28:28 -0500 Subject: [PATCH 24/26] [RELEASE] 5.10.1 --- ChangeLog.md | 31 ++++++++++++++++++++++++++++++- config/__init__.py | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 719c6b16..f81e43e2 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.11.1, 32-bit. +* We now test against, and package with, Python 3.11.7, 32-bit. **As a consequence of this we no longer support Windows 7. This is due to @@ -33,6 +33,35 @@ produce the Windows executables and installer. currently used version in a given branch. --- +Release 5.10.1 +=== +This release contains a number of bugfixes, minor performance enhancements, +workflow and dependency updates, and a function deprecation. + +Note to plugin developers: modules.p and ships.p are deprecated, and slated +for removal in the next major release! Please look for that change coming soon. + +Note to plugin developers: The `openurl()` function in ttkHyperlinkLabel has been deprecated, +and slated for removal in the next major release! Please migrate to `webbrowser.open()`. + +**Changes and Enhancements** +* Deprecated `openurl()`. Please migrate to `webbrowser.open()` +* Updated a number of list comparisons to use more efficient tuple comparisons +* Updated a few type hints +* Updated a few binary comparitors to be more efficient +* Moved `resources.json` and `modules.json` back to the top level for all users +* Updated several dependencies +* Updated Python version to 3.11.7 + +**Bug Fixes** +* Fixed an issue where resources files could be in different locations for different users. + * These files are now in the same location (top level) for all users on all distributions. +* Fixed an issue where CMDRs without the Git application installed would crash on start if running from Source. + * Thanks to the Flatpak team for pointing this one out! +* Fixed a bug where CMDRs running from source would have their git hash version displayed as UNKNOWN. + * We're now more failure tolerant and use the bundled .gitversion if no true git hash is provided. +* Fixed a bug where starting two copies of EDMC with a valid install would not generate a duplicate warning. + Release 5.10.0 === This release contains a number of under-the-hood changes to EDMC designed to improve performance, code diff --git a/config/__init__.py b/config/__init__.py index 046e7599..7e5025a6 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -54,7 +54,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.10.0' +_static_appversion = '5.10.1' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' From 7f8d54667ff6d19dac6e2233244eaff31c8688ff Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 19:38:37 -0500 Subject: [PATCH 25/26] [Revert] Revert Bad upload-artifact Update https://github.com/actions/upload-artifact/issues/478 --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index ed9ef874..3a27f691 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -62,7 +62,7 @@ jobs: mv ../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz . - name: Upload build files - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: Built files path: | @@ -127,7 +127,7 @@ jobs: filepath: './EDMC_Installer_Config.iss' - name: Upload build files - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: Built files path: | From 5419e2e47f30c4dbcfc22b53308187d0c033d286 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 3 Jan 2024 19:48:51 -0500 Subject: [PATCH 26/26] [Workflow] Revert Bad Workflow Update --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 3a27f691..163e904f 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -142,7 +142,7 @@ jobs: steps: - name: Download binary - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: Built files path: ./