Commit Graph

106 Commits

Author SHA1 Message Date
Jeff Ramnani 634f984e78
Improve metered connection detection for macOS. By @jramnani (#1902)
* Add dependency for pyobjc-CoreWLAN on darwin

* Rename existing implementation with Android

The current implementation was tested with Android, but does not work
with iOS.

Move the existing implementation and include android in the name to make
room for adding a new iOS metered connection detection strategy.

* get_current_wifi works with objc

Switch from using command line tools to using the Objective-C Cocoa API
to get the Wi-Fi status information.

Cocoa has an API to specifically check whether a Wi-Fi connection is
using a Personal Hotspot on iOS.

I'm using a private method to get the Wi-Fi interface object in Cocoa.
The reason for this is that cleaning up mocks on PyObjC/ObjC objects is
much harder than mocking out methods on objects in our control. Using
test doubles also let's me check for different states the Wi-Fi network
could be in.

* get_known_wifis works on darwin

Use the networksetup command on macOS to get the list of the user's
Wi-Fi networks.

  networksetup -listpreferredwirelessnetworks bsd_device

It looks like this command and option has existed on macOS since at
least 2013.

Also add some type annotations around the PyObjC return values to help
the reader know what they're dealing with at each step.

* Add test for get_current_wifi when wifi is off

The user might have Wi-Fi turned off. Account for that use case.

* Add iOS Personal Hotspot support to is_network_metered

The DarwinNetworkManager can now determine if the user is connected to
a Personal Hotspot Wi-Fi network from iOS.

Account for whether the user has Wi-Fi turned on and off.

* Refactor to avoid deprecated API in Cocoa

According to Apple's developer documentation, creating CWInterface
objects directly are discouraged. Instead, they prefer to use
CWInterface objects created by CWWiFiClient.

This also happens to be more compliant with Apple's application sandbox.
Creating CWInterface objects directly accesses raw BSD sockets which is
not allowed in the sandbox.

More details here:
https://developer.apple.com/documentation/corewlan/cwinterface

* Add test case for blank Wi-Fi network name

I have one of these in my list of networks in Vorta. And this also
covers a missing branch in get_known_wifis.

* Move private method below public methods

This is to provide a little more clarity. Especially since this class is
subclassing another one.

* Account for when there is no wifi interface

When a Mac does not have a Wi-Fi interface, CWWiFiClient.interface() can
return None.

Update the type annotation to mark it as Optional, and account for the
null condition in the other methods.

* Fix type annotation error

The CI tests failed on python 3.8.

I used the wrong type annotation to describe a list of SystemWifiInfo's.

The tests now pass for me when I run 'make test-unit' using a python 3.8
interpreter.

* Fix linter issue with imports
2024-02-02 12:05:47 +00:00
Stefano Rivera 98b64621c2
Loosen platformdirs dependency (#1843)
4.x is backwards compatible with 3.x except that site_cache_dir has
moved to /var/cache. Vorta doesn't use this.

https://github.com/platformdirs/platformdirs/releases/tag/4.0.0
2023-11-14 15:54:20 +00:00
Divyansh Singh f0a5a36275
ci: Add ruff including print checks
Adds ruff replacing isort. Ruff comes with all flake8 rules and additional rules for print statements.

* .github/workflows/test.yml : Replace isort with ruff in comment

* .editorconfig : Update `yml` config to apply to all yaml files.

* Makefile (lint): Run ruff, remove isort

* .pre-commit-config.yaml : Remove isort, run ruff

* pyproject.toml : Configure ruff. Remove isort config.

* requirements.d/dev.txt : Add ruff, remove isort

* setup.cfg : Extend flake8 file ignore

* src/vorta/__main__.py : Add *noqa* for print statement.
2023-05-01 10:25:14 +02:00
Manu 4d65912d65
Fix pyobjc imports, bump minimum Python version (#1698) 2023-04-29 12:26:01 +01:00
i1sm3ky 7535f92ac8
PyQt6 Upgrade (#1685)
This puts Vorta on PyQt6 and starts a new main branch 0.9.

---------

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2023-04-17 11:17:01 +01:00
Hofer-Julian 8571ef6cb8 Remove paramiko from dependencies 2023-04-09 16:00:55 +01:00
Vamp 961e0b5057
Migrate from appdirs to platformdirs (#1617)
Fixes #1610. Replace deprecated `appdirs` with fork `platformdirs`. Use the new `*_path` api of set fork. This changes the type of the constants defined in `vorta.config` holding locations to `pathlib.Path`.

* setup.cfg : Replace dep `appdirs` with `platformdirs`.

* src/vorta/config.py : Migrate. Simplify code for ensuring that the directories exist.

* src/vorta/log.py
* src/vorta/autostart.py
* src/vorta/application.py
* src/vorta/__main__.py
2023-03-10 16:00:39 +00:00
Alan Barros de Oliveira 78863544ae
Remove pip install dependency. By @abdeoliveira (#1578) 2023-02-04 14:43:21 +00:00
Manu ef297bbf4b
Avoid autostart warning when autostart disabled (#1549) 2023-01-20 12:25:58 +01:00
Manu 7550ae5b29 Pin pyobjc to v8 branch 2022-11-05 20:07:02 +01:00
Manu 7c97f79b31 Add config files for autmatic formatting 2022-08-15 15:23:55 +02:00
Manu 8b763a9af9
Remove unused setuptools-git dependency (#1147)
* Remove unused setuptools-git dependency
* Exclude macOS and pip temp files
2021-12-24 14:16:52 +04:00
Manu 896d84415e
Remove unused pytest-runner dependency. Fixes #1136 (#1137) 2021-12-17 20:04:40 +04:00
Manu c7a1077fec
Remove APScheduler dependency, Python 3.10 support (#1086) 2021-10-27 08:37:28 +04:00
Manu c963aaf3f2
Pin tzlocal version required for apscheduler (#1085) 2021-10-23 08:33:21 +04:00
Manu 5d5415035a
Remove PyQt5 pinning. Fixes #1011 (#1022)
* Remove PyQt5 pinning. Fixes #1011
* Bump Borg version in GH workflow.
2021-06-21 09:30:01 +04:00
Manu eb037dd41b Build fixes 2021-06-08 18:50:56 +04:00
Manu 848bcc57ba
Give option to break repository lock. By @samuel-w (#863) 2021-02-17 09:58:42 +08:00
Manu aa04d72252
Add QTimer to ensure background jobs are scheduled correctly. (#780)
* Add QTimer to ensure background jobs are scheduled correctly.
* Exclude from App Nap to keep timer enabled.
* Remove notifications for schedule changes, since we do it very often now.
2021-02-11 14:09:22 +08:00
Manu 6493e1798c
Clean up supporting files (#771) 2021-01-20 12:59:37 +08:00
Samuel 97dad34df0
Ignore flake8 W503 (#706)
Patches https://gitlab.com/pycqa/flake8/-/issues/139, 
since W503 will not be removed https://gitlab.com/pycqa/flake8/-/issues/539
2020-11-08 08:56:39 +08:00
Manu 2f47c388ce
Keep version number in one place only. Clean up Makefile vars (#642) 2020-09-10 13:26:38 +08:00
Manu fcb11b4830 Bump version 2020-09-06 14:45:41 +08:00
Manu 2f68b2795c
Fix tests for PyQt 5.15 on Linux. By @samuel-w (#573) 2020-08-10 15:57:13 +08:00
Manu 09b697e395
Add error message when Borg binary is missing. Fixes #333 (#480)
* Add error message when Borg binary is missing. Fixes #333
* Test failures. Stick with PyQt 5.14 for now.
* Clarify exclude file placeholder text. Fixes #314
2020-06-01 16:02:38 +08:00
Manu 79ef4717d7
Proper dark style support and removal of style hacks (#475)
* Remove qtdarkstyle and custom fusion style.
* Support instant changes from light to dark style
* Adjust SVG icon colors on-the-fly, adjust to dark theme in real time (macOS)
* Add OS-independent dark mode detection. Fix QToolbox style after theme changes.
* Remove some unnecessary style options, like `uses_light_icon` and `use_dark_style`.
2020-05-31 19:29:26 +08:00
Manu 0b44d00f47 Bump version 2020-05-26 11:30:06 +08:00
Manu 4c0c2450bd Bump version 2020-05-26 11:09:20 +08:00
Manu facfbf29f4 Bump version to 0.6.24 2020-03-03 13:29:20 +08:00
Manu 82844a17b4
Add macOS notarization, use Github Workflows for testing (#407)
* Improve macOS packaging, add notarization.
* Properly use QApplication while testing, remove workarounds.
* Use Github Workflows instead of Travis.
* Remove outdated test workaround.
2020-03-03 13:19:36 +08:00
Manu 2e21fff768 Bump version 2019-10-10 13:17:37 +08:00
Manu 0e24bc00c2 Bump version 2019-08-03 14:13:01 +08:00
Manu 850274d0cd Bump version 2019-06-20 20:02:08 +08:00
Manu 0e25ee95d0 Bump version: 0.6.19 → 0.6.20 2019-05-16 12:20:44 +08:00
Manu 893cbc0d5c Bump version: 0.6.18 → 0.6.19 2019-04-22 15:41:53 +08:00
Manu dc9b23f911 Bump version: 0.6.17 → 0.6.18 2019-04-19 13:29:26 +08:00
Manu cfe5526a56 Bump version: 0.6.16 → 0.6.17 2019-04-14 14:48:19 +08:00
Manuel Riel b9486d003c
Add helper class to manage Borg version and supported features. (#250)
* Add helper class to manage Borg version and supported features. Fixes #205

* Add setuptools as dependency to ensure pkg_resources is available.

* Review fixes, check for ZStd support, refactor some relative imports.

* Repo-add dialog: Disable Blake2 options if not available.

* When disabling compression algos, select by value, not index.
2019-04-14 14:40:29 +08:00
Manu 13e84775bb Bump version: 0.6.15 → 0.6.16 2019-04-07 15:53:26 +08:00
Manu 3e65f451c7 Bump version: 0.6.14 → 0.6.15 2019-03-25 23:27:57 +08:00
Manu bf12aca2fb Bump version: 0.6.13 → 0.6.14 2019-03-24 18:47:31 +08:00
Manu e40f571b5e Bump version: 0.6.12 → 0.6.13 2019-03-23 19:08:08 +08:00
Manu 59f836d84c Bump version: 0.6.11 → 0.6.12 2019-03-20 18:41:17 +08:00
Manu 77c5a22ebd Bump version: 0.6.10 → 0.6.11 2019-03-19 22:25:47 +08:00
Manuel Riel a1d41612b1
Remove keyring dependency. Fixes #190. By @Hofer-Julian
* Implement secretstorage backend for DBus connection
* Use newer Ubuntu version for Travis CI testing
2019-03-06 09:37:12 +08:00
Manu 3e836d2d95 Bump version: 0.6.9 → 0.6.10 2019-02-20 17:21:04 +08:00
Manu 0294289e8f Bump version: 0.6.8 → 0.6.9 2019-02-20 17:10:17 +08:00
TW 3efecd71f3 compressor selection: add zlib, add zstd,8, descriptions, fixes #145 (#184) 2019-02-13 15:21:41 +08:00
Manu 1587acbad6 Bump version: 0.6.7 → 0.6.8 2019-02-08 12:45:00 +08:00
Manu 58383c5d62 Bump version: 0.6.6 → 0.6.7 2019-02-02 12:35:22 +08:00