Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nuxeo/nuxeo-drive into te…
Browse files Browse the repository at this point in the history
…st_datetime_adapter_new
  • Loading branch information
gitofanindya committed Nov 19, 2024
2 parents b4b5d33 + 9805a47 commit d898aa3
Show file tree
Hide file tree
Showing 43 changed files with 239 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
if: matrix.os == 'macos-latest'
run: |
wget https://www.apple.com/appleca/AppleIncRootCertificate.cer
echo "${{ secrets.CERT_APP_MACOS }}" | base64 --decode > developerID_application.cer
echo "${{ secrets.CERT_APP_MACOS }}" | base64 --decode > developerID_application.p12
echo "${{ secrets.PRIV_APP_MACOS }}" | base64 --decode > nuxeo-drive.priv
#- name: "[macOS] Downloading Python"
Expand Down
24 changes: 24 additions & 0 deletions docs/changes/5.5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Release date: `2024-xx-xx`

- [NXDRIVE-2909](https://jira.nuxeo.com/browse/NXDRIVE-2909): Set container title when defining the Folder type from Document Type Selection using Direct Transfer
- [NXDRIVE-2915](https://jira.nuxeo.com/browse/NXDRIVE-2915): Translate "Document type" and "container type" labels on Direct Transfer popup
- [NXDRIVE-2925](https://jira.nuxeo.com/browse/NXDRIVE-2925): Ignore zero-byte files

### Task Management
- [NXDRIVE-2](https://jira.nuxeo.com/browse/NXDRIVE-2):
Expand All @@ -27,6 +28,8 @@ Release date: `2024-xx-xx`

- [NXDRIVE-2970](https://jira.nuxeo.com/browse/NXDRIVE-2970): Fix security issue: urllib3's Proxy-Authorization request header isn't stripped during cross-origin redirects
- [NXDRIVE-2971](https://jira.nuxeo.com/browse/NXDRIVE-2971): Fix security issue: pyca/cryptography has a vulnerable OpenSSL included in cryptography wheels
- [NXDRIVE-2954](https://jira.nuxeo.com/browse/NXDRIVE-2954): [Mac] Certificate needs to be renewed
- [NXDRIVE-2976](https://hyland.atlassian.net/browse/NXDRIVE-2976): Fix security issue: Black vulnerable to Regular Expression Denial of Service (ReDoS)

## Tests

Expand All @@ -38,23 +41,44 @@ Release date: `2024-xx-xx`

## Minor Changes

- Upgraded `altgraph` from 0.17 to 0.17.4
- Upgraded `authlib` from 1.3.0 to 1.3.1
- Upgraded `black` from 23.12.1 to 24.10.0
- Upgraded `boto3` from 1.34.17 to 1.35.21
- Upgraded `botocore` from 1.34.17 to 1.35.21
- Upgraded `build` from 1.2.1 to 1.2.2
- Upgraded `cachetools` from 5.3.3 to 5.5.0
- Upgraded `certifi` from 2023.7.22 to 2024.7.4
- Upgraded `cryptography` from 42.0.5 to 43.0.1
- Upgraded `docutils` from 0.20.1 to 0.21.2
- Upgraded `faker` from 22.0.0 to 29.0.0
- Upgraded `filelock` from 3.14.0 to 3.16.1
- Upgraded `flake8` from 6.1.0 to 7.1.1
- Upgraded `future` from 0.18.3 to 1.0.0
- Upgraded `mypy` from 1.10.0 to 1.11.2
- Upgraded `types-python-dateutil` from 2.8.19.20240106 to 2.9.0.20240906
- Upgraded `typing-extensions` from 4.9.0 to 4.12.2
- Upgraded `pefile` from 2023.2.7 to 2024.8.26
- Upgraded `platformdirs` from 4.2.2 to 4.3.6
- Upgraded `pre-commit` from 2.16.0 to 3.8.0
- Upgraded `pycodestyle` from 2.11.1 to 2.12.1
- Upgraded `pycparser` from 2.21 to 2.22
- Upgraded `py-cpuinfo` from 8.0.0 to 9.0.0
- Upgraded `pyflakes` from 3.1.0 to 3.2.0
- Upgraded `pyobjc-core` from 10.1 to 10.3.1
- Upgraded `pyobjc-framework-cocoa` from 10.1 to 10.3.1
- Upgraded `pyobjc-framework-coreservices` from 10.1 to 10.3.1
- Upgraded `pyobjc-framework-scriptingbridge` from 10.1 to 10.3.1
- Upgraded `pyobjc-framework-fsevents` from 10.1 to 10.3.1
- Upgraded `pyobjc-framework-systemconfiguration` from 10.1 to 10.3.1
- Upgraded `pytest-benchmark` from 3.4.1 to 4.0.0
- Upgraded `python-dateutil` from 2.8.2 to 2.9.0.post0
- Upgraded `responses` from 0.24.1 to 0.25.3
- Upgraded `requests` from 2.31.0 to 2.32.3
- Upgraded `send2trash` from 1.7.1 to 1.8.3
- Upgraded `setuptools` from 69.5.1 to 72.1.0
- Upgraded `urllib3` from 1.26.12 to 1.26.19
- Upgraded `watchdog` from 3.0.0 to 5.0.2
- Upgraded `zipp` from 3.18.0 to 3.20.0

## Technical Changes
Expand Down
1 change: 1 addition & 0 deletions nxdrive/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
In this file we cannot use a relative import here, else Drive will not start when packaged.
See https://github.com/pyinstaller/pyinstaller/issues/2560
"""

import locale
import platform
import signal
Expand Down
1 change: 1 addition & 0 deletions nxdrive/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Allow or disallow server deletions.
"""

from types import SimpleNamespace

Behavior = SimpleNamespace(server_deletion=True)
1 change: 1 addition & 0 deletions nxdrive/client/local/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" API to access local resources for synchronization. """

from .base import FileInfo, get

# Get the local client related to the current OS
Expand Down
1 change: 1 addition & 0 deletions nxdrive/client/uploader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Uploader used by the Remote client for all upload stuff.
"""

import json
from abc import abstractmethod
from logging import getLogger
Expand Down
1 change: 1 addition & 0 deletions nxdrive/client/uploader/direct_transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Uploader used by the Direct Transfer feature.
"""

import json
from logging import getLogger
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions nxdrive/client/uploader/sync.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Uploader used by the synchronization engine.
"""

from pathlib import Path
from typing import Any, Dict, Optional

Expand Down
1 change: 1 addition & 0 deletions nxdrive/dao/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Query formatting in this file is based on http://www.sqlstyle.guide/
"""

from datetime import datetime, timezone
import sys
from contextlib import suppress
Expand Down
1 change: 1 addition & 0 deletions nxdrive/dao/engine.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Query formatting in this file is based on http://www.sqlstyle.guide/
"""

import json
import os
import shutil
Expand Down
1 change: 1 addition & 0 deletions nxdrive/dao/manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Query formatting in this file is based on http://www.sqlstyle.guide/
"""

from logging import getLogger
from pathlib import Path
from sqlite3 import Cursor, IntegrityError, Row
Expand Down
4 changes: 1 addition & 3 deletions nxdrive/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,7 @@ def resume_transfer(
meth = (
self.dao.get_download
if nature == "download"
else self.dao.get_dt_upload
if is_direct_transfer
else self.dao.get_upload
else self.dao.get_dt_upload if is_direct_transfer else self.dao.get_upload
)
func = partial(meth, uid=uid) # type: ignore
self._resume_transfers(nature, func, is_direct_transfer=is_direct_transfer)
Expand Down
1 change: 1 addition & 0 deletions nxdrive/fatal_error.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Fatal error screen management using either Qt or OS-specific dialogs.
"""

import sys
from contextlib import suppress
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions nxdrive/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Enable or disable the synchronization features.
"""

from types import SimpleNamespace
from typing import List

Expand Down
1 change: 1 addition & 0 deletions nxdrive/gui/application.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Main Qt application handling OS events and system tray UI. """

import os
import webbrowser
from contextlib import suppress
Expand Down
12 changes: 11 additions & 1 deletion nxdrive/gui/folders_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ def _files_display(self) -> str:
txt += f" (+{self.overall_count - 1:,})"
return txt

def get_size(self, file_path: Path) -> bool:
return file_path.stat().st_size

Check warning on line 628 in nxdrive/gui/folders_dialog.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/folders_dialog.py#L628

Added line #L628 was not covered by tests

def _process_additionnal_local_paths(self, paths: List[str], /) -> None:
"""Append more local paths to the upload queue."""
for local_path in paths:
Expand All @@ -647,10 +650,17 @@ def _process_additionnal_local_paths(self, paths: List[str], /) -> None:
# Save the path
if path.is_dir():
for file_path, size in get_tree_list(path):
if self.get_size(file_path) == 0:

Check warning on line 653 in nxdrive/gui/folders_dialog.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/folders_dialog.py#L653

Added line #L653 was not covered by tests
# ignoring zero byte files [NXDRIVE-2925]
continue

Check warning on line 655 in nxdrive/gui/folders_dialog.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/folders_dialog.py#L655

Added line #L655 was not covered by tests
self.paths[file_path] = size
else:
try:
self.paths[path] = path.stat().st_size
file_size = self.get_size(path)
if file_size == 0:

Check warning on line 660 in nxdrive/gui/folders_dialog.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/folders_dialog.py#L659-L660

Added lines #L659 - L660 were not covered by tests
# ignoring zero byte files [NXDRIVE-2925]
continue
self.paths[path] = file_size

Check warning on line 663 in nxdrive/gui/folders_dialog.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/folders_dialog.py#L662-L663

Added lines #L662 - L663 were not covered by tests
except OSError:
log.warning(f"Error calling stat() on {path!r}", exc_info=True)
continue
Expand Down
1 change: 1 addition & 0 deletions nxdrive/osi/darwin/pyNotificationCenter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Python integration macOS notification center. """

from typing import TYPE_CHECKING, Dict

from CoreServices import (
Expand Down
1 change: 1 addition & 0 deletions nxdrive/qt/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Put here all PyQt constants used across the project.
"""

from .imports import (
QAbstractSocket,
QDialogButtonBox,
Expand Down
1 change: 1 addition & 0 deletions nxdrive/qt/imports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Put here all PyQt imports used across the project.
"""

from PyQt5.QtCore import (
QT_VERSION_STR,
QAbstractListModel,
Expand Down
1 change: 1 addition & 0 deletions nxdrive/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
This state is set at the start of the application to know if it has crashed at the previous run.
"""

from types import SimpleNamespace

State = SimpleNamespace(about_to_quit=False, crash_details="", has_crashed=False)
1 change: 1 addition & 0 deletions nxdrive/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Most of functions are pure enough to be decorated with a LRU cache.
Each *maxsize* is adjusted depending of the heavy use of the decorated function.
"""

import os
import os.path
import re
Expand Down
1 change: 1 addition & 0 deletions tests/benchmarks/test_safe_filename.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
If is not the most efficient for small ASCII-only filenames,
but it is the best when there are non-ASCII characters.
"""

import pytest

FILENAMES = [
Expand Down
1 change: 1 addition & 0 deletions tests/cleanup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cleanup old test users and workspaces."""

import env
from nuxeo.client import Nuxeo

Expand Down
4 changes: 3 additions & 1 deletion tests/integration/windows/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def test_argument_log_filename(exe, tmp, file):
assert log.is_file()


@pytest.mark.parametrize("folder", ["azerty", "$alice", "léa", "mi Kaël", "こん ツリ ^^"])
@pytest.mark.parametrize(
"folder", ["azerty", "$alice", "léa", "mi Kaël", "こん ツリ ^^"]
)
def test_argument_nxdrive_home(exe, tmp, folder):
path = tmp()
path.mkdir(parents=True, exist_ok=True)
Expand Down
1 change: 1 addition & 0 deletions tests/markers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of pytest markers to ease test filtering."""

import os

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Common test utilities. """

import os
import sys
import tempfile
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_behavior.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test application Behavior.
"""

from nxdrive.behavior import Behavior

from .. import ensure_no_exception
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_direct_transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test the Direct Transfer feature in different scenarii.
"""

import logging
import re
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_local_changes_when_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test if changes made to local file system when Drive is offline sync's back
later when Drive becomes online.
"""

import pytest

from nxdrive.constants import WINDOWS
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
See NXDRIVE-742.
"""

import hashlib
import os
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_synchronization_dedup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test behaviors when the server allows duplicates and not the client.
"""

from pathlib import Path

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/old_functional/test_transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test pause/resume transfers in different scenarii.
"""

import re
from unittest.mock import patch

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_autolock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test the Auto-Lock feature used heavily by Direct Edit.
"""

from pathlib import Path
from typing import List, Tuple
from unittest.mock import Mock, patch
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_pytest_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Tests for pytests_random: a pytest plugin to mitigate random failures.
Adapted from github.com/pytest-dev/pytest-rerunfailures
"""

import pytest

pytest_plugins = "pytester"
Expand Down
1 change: 1 addition & 0 deletions tools/cleanup_application_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Remove files from the package that are not needed and too big.
This script can be launched after PyInstaller and before installers creation.
"""

import os
import shutil
import sys
Expand Down
17 changes: 9 additions & 8 deletions tools/deps/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
# Modules needed by the application.
# This file is used to build fresh binaries.
#
altgraph==0.17 \
--hash=sha256:c623e5f3408ca61d4016f23a681b9adb100802ca3e3da5e718915a9e4052cebe \
--hash=sha256:1f05a47122542f97028caf78775a095fbe6a2699b5089de8477eb583167d69aa
altgraph==0.17.4 \
--hash=sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406 \
--hash=sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff
# via pyinstaller
future==0.18.3; sys_platform == "win32" \
--hash=sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307
future==1.0.0; sys_platform == "win32" \
--hash=sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216 \
--hash=sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05
# via pefile
macholib==1.14 ; sys_platform == "darwin" \
--hash=sha256:c500f02867515e6c60a27875b408920d18332ddf96b4035ef03beddd782d4281 \
--hash=sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432
# via pyinstaller
pefile==2023.2.7 ; sys_platform == "win32" \
--hash=sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc \
--hash=sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6
pefile==2024.8.26 ; sys_platform == "win32" \
--hash=sha256:3ff6c5d8b43e8c37bb6e6dd5085658d658a7a0bdcd20b6a07b1fcfc1c4e9d632 \
--hash=sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f
# via pyinstaller
pyinstaller==5.13.2 \
--hash=sha256:16cbd66b59a37f4ee59373a003608d15df180a0d9eb1a29ff3bfbfae64b23d0f \
Expand Down
6 changes: 3 additions & 3 deletions tools/deps/requirements-pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Modules needed by every developers.
# This file is used to create build and test environments.
#
build==1.2.1 \
--hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \
--hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4
build==1.2.2 \
--hash=sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c \
--hash=sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613
# via pip-tools
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
Expand Down
Loading

0 comments on commit d898aa3

Please sign in to comment.