Skip to content

Commit

Permalink
Bump pyinstaller from 5.0 to 5.13.2 in /tools/deps (#4111)
Browse files Browse the repository at this point in the history
* Bump pyinstaller from 5.0 to 5.13.2 in /tools/deps

* Bump pywin32-ctypes from 0.2.0 to 0.2.2 in /tools/deps (#4112)

* Bump pefile from 2021.5.24 to 2023.2.7 in /tools/deps (#3783)

* Bump pyinstaller-hooks-contrib from 2021.2 to 2023.8 in /tools/deps (#4098)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: swetayadav1 <[email protected]>
Co-authored-by: Sweta Yadav <[email protected]>
  • Loading branch information
4 people authored Feb 19, 2024
1 parent 7a2b7c5 commit d8f93b1
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 28 deletions.
8 changes: 7 additions & 1 deletion docs/changes/5.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ Release date: `2024-xx-xx`
- Upgraded `junitparser` from 3.1.0 to 3.1.1
- Upgraded `more-itertools` from 10.1.0 to 10.2.0
- Upgraded `pathspec` from 0.11.2 to 0.12.1
- Upgraded `pefile` from 2021.5.24 to 2023.2.7
- Upgraded `pycodestyle` from 2.11.0 to 2.11.1
- Upgraded `pyfakefs` from 5.2.4 to 5.3.4
- Upgraded `pyinstaller` from 5.0 to 5.13.2
- Upgraded `pyinstaller-hooks-contrib` from 2021.2 to 2023.8
- Upgraded `pyobjc-core` from 7.3 to 10.1
- Upgraded `pyobjc-framework-cocoa` from 7.3 to 10.1
- Upgraded `pyobjc-framework-coreservices` from 7.3 to 10.1
Expand All @@ -65,13 +68,16 @@ Release date: `2024-xx-xx`
- Upgraded `pyobjc-framework-systemconfiguration` from 7.3 to 10.1
- Upgraded `pytest` from 7.4.0 to 7.4.4
- Upgraded `pytest-timeout` from 2.0.2 to 2.2.0
- Upgraded `pywin32-ctypes` from 0.2.0 to 0.2.2
- Upgraded `pyyaml` from 5.4.1 to 6.0.1
- Upgraded `regex` from 2023.8.8 to 2023.12.25
- Upgraded `responses` from 0.23.3 to 0.24.1
- Upgraded `s3transfer` from 0.6.0 to 0.10.0
- Upgraded `types-python-dateutil` from 2.8.19.2 to 2.8.19.20240106
- Upgraded `typing-extensions` from 4.7.1 to 4.9.0
- Upgraded `vulture` from 2.9.1 to 2.10

## Technical Changes

-
- Replaced `distutils.version` with `packaging.version`
- Check Drive version in Windows `ndrive.exe --version > version.txt` and then run `type version.txt`
5 changes: 3 additions & 2 deletions nxdrive/fatal_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ def check_os_version() -> bool:
"""Check that the current OS version is supported."""

if MAC:
from distutils.version import StrictVersion
from platform import mac_ver

from packaging.version import parse

version = mac_ver()[0]
if StrictVersion(version) < StrictVersion("10.13"):
if parse(version) < parse("10.13"):
fatal_error_mac(
f"macOS 10.13 (High Sierra) or newer is required (your version is {version})."
)
Expand Down
4 changes: 2 additions & 2 deletions nxdrive/updater/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import re
from distutils.version import LooseVersion
from logging import getLogger
from typing import Any, Dict, Optional, Tuple

from nuxeo.utils import version_le, version_lt
from packaging.version import parse

from ..feature import Feature
from ..options import Options
Expand Down Expand Up @@ -116,7 +116,7 @@ def get_latest_version(versions: Versions, channel: str, /) -> str:
log.debug(f"No version found in {channel} channel.")
return ""

highest = str(max(map(LooseVersion, versions_list)))
highest = str(max(map(parse, versions_list)))
return highest # ᕦ(ò_óˇ)ᕤ


Expand Down
17 changes: 15 additions & 2 deletions tests/integration/windows/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import subprocess
from logging import getLogger

import pytest
Expand Down Expand Up @@ -67,8 +68,6 @@ def test_invalid_argument_value(exe, arg):
"--timeout=42",
"--update-check-delay=42",
"--update-site-url='https://example.org'",
"--version",
"-v",
],
)
def test_valid_argument_value(exe, arg):
Expand All @@ -78,6 +77,20 @@ def test_valid_argument_value(exe, arg):
share_metrics_dlg(app)


@pytest.mark.parametrize(
"arg",
["-v", "--version"],
)
def test_check_drive_version(final_exe, tmp_path, version, arg):
"""Test the Drive version"""
file = tmp_path / "version.txt"
cmd = [final_exe, arg, ">", file]
subprocess.run(cmd, shell=True)
with open(file, "r") as file:
version_num = file.read().strip()
assert version_num == version


@pytest.mark.parametrize(
"file", ["azerty.log", "$alice.log", "léa.log", "mi Kaël.log", "こん ツリ ^^.log"]
)
Expand Down
20 changes: 20 additions & 0 deletions tests/unit/test_fatal_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import platform
from unittest.mock import Mock

from nxdrive import fatal_error
from nxdrive.constants import MAC


def test_check_os_version(monkeypatch):
"""Check the OS version compatibility for Nuxeo Drive"""
assert fatal_error.check_os_version()

if MAC:
# Test for lower version of MacOS. It will pop-up a Fatal error screen
def mac_ver():
return ["10.2.1"]

monkeypatch.setattr(platform, "mac_ver", mac_ver)

fatal_error.fatal_error_mac = Mock()
assert not fatal_error.check_os_version()
41 changes: 22 additions & 19 deletions tools/deps/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ macholib==1.14 ; sys_platform == "darwin" \
--hash=sha256:c500f02867515e6c60a27875b408920d18332ddf96b4035ef03beddd782d4281 \
--hash=sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432
# via pyinstaller
pefile==2021.5.24 ; sys_platform == "win32" \
--hash=sha256:ed79b2353daa58421459abf4d685953bde0adf9f6e188944f97ba9795f100246
pefile==2023.2.7 ; sys_platform == "win32" \
--hash=sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc \
--hash=sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6
# via pyinstaller
pyinstaller==5.0 \
--hash=sha256:00a982387c69d101fb1ae680689ec88301466eda96928fdc3ba087f7e58ced70 \
--hash=sha256:050f91ddf78a6b25c578c9d206740fd2401ddc5123665d4633c06e0825de8738 \
--hash=sha256:0b7f1a09e1ae617867d4e9b56285dd670bcf0b1362b272c96a933b0195fce226 \
--hash=sha256:0e58b86e126a076ab912cefa57aa057baa8ad51ffdfcb8decab30712c0f0c698 \
--hash=sha256:16c6d5ee6cbba2835572e2b33b300775e597ad7ece60647e8b5b0de90fff27a5 \
--hash=sha256:478a205a13c1c9fa0ef1fe55bdfff5ffc8946d612a6a6d093b2e599d69a26e55 \
--hash=sha256:5d9bf534b9d24c32549bd0b36a4b15d80adf57773addc065e5c68d9bd5144450 \
--hash=sha256:a4259e924e8ca0a2b73f9b602f056548be3547dff2869fc7329a21831e493f7e \
--hash=sha256:bc9430b04e0e38a29b08fac10f45fc3a1c71f0f5de9ca5d9996f7cfe6a4cc5bf \
--hash=sha256:c71d94fa7b1feeeca8d41f638560b1165202c594f7f79c70e38f8034a8318888 \
--hash=sha256:c72128088b8670fa2b16264395d3fe6546cd3679f43e53f8077deda58c06cfc0
pyinstaller-hooks-contrib==2021.2 \
--hash=sha256:57964f93eb69255c49159ffdf052aae893feed223b0f69773dfd010ca6c569d9 \
--hash=sha256:7f5d0689b30da3092149fc536a835a94045ac8c9f0e6dfb23ac171890f5ea8f2
pyinstaller==5.13.2 \
--hash=sha256:16cbd66b59a37f4ee59373a003608d15df180a0d9eb1a29ff3bfbfae64b23d0f \
--hash=sha256:27cd64e7cc6b74c5b1066cbf47d75f940b71356166031deb9778a2579bb874c6 \
--hash=sha256:2c2fe9c52cb4577a3ac39626b84cf16cf30c2792f785502661286184f162ae0d \
--hash=sha256:421cd24f26144f19b66d3868b49ed673176765f92fa9f7914cd2158d25b6d17e \
--hash=sha256:65133ed89467edb2862036b35d7c5ebd381670412e1e4361215e289c786dd4e6 \
--hash=sha256:7d51734423685ab2a4324ab2981d9781b203dcae42839161a9ee98bfeaabdade \
--hash=sha256:8f6dd0e797ae7efdd79226f78f35eb6a4981db16c13325e962a83395c0ec7420 \
--hash=sha256:aadafb6f213549a5906829bb252e586e2cf72a7fbdb5731810695e6516f0ab30 \
--hash=sha256:b2e1c7f5cceb5e9800927ddd51acf9cc78fbaa9e79e822c48b0ee52d9ce3c892 \
--hash=sha256:c63ef6133eefe36c4b2f4daf4cfea3d6412ece2ca218f77aaf967e52a95ac9b8 \
--hash=sha256:c8e5d3489c3a7cc5f8401c2d1f48a70e588f9967e391c3b06ddac1f685f8d5d2 \
--hash=sha256:ddcc2b36052a70052479a9e5da1af067b4496f43686ca3cdda99f8367d0627e4
pyinstaller-hooks-contrib==2023.8 \
--hash=sha256:318ccc316fb2b8c0bbdff2456b444bf1ce0e94cb3948a0f4dd48f6fc33d41c01 \
--hash=sha256:d091a52fbeed71cde0359aa9ad66288521a8441cfba163d9446606c5136c72a8
# via pyinstaller
pywin32-ctypes==0.2.0 ; sys_platform == "win32" \
--hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98
pywin32-ctypes==0.2.2 ; sys_platform == "win32" \
--hash=sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60 \
--hash=sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7
# via pyinstaller
4 changes: 2 additions & 2 deletions tools/scripts/check_update_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
It __must__ be launched before any new release to validate the update process.
"""

import distutils.version
import hashlib
import http.server
import os
Expand All @@ -36,6 +35,7 @@
from os.path import expanduser, expandvars
from pathlib import Path

import packaging.version
import requests
import yaml

Expand Down Expand Up @@ -270,7 +270,7 @@ def set_options():
def tests():
"""Simple tests before doing anything."""

version_checker = distutils.version.StrictVersion
version_checker = packaging.version.parse
assert version_decrement("1.0.0") == "0.9.9"
assert version_decrement("2.5.0") == "2.4.9"
assert version_decrement("1.2.3") == "1.2.2"
Expand Down

0 comments on commit d8f93b1

Please sign in to comment.