Merge pull request #141 from MightyCreak/docs-add-dependencies
Add project dependencies and fix Python 3.8 compatibility
This commit is contained in:
commit
c224d17e9a
|
@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Linters can be run sooner (before installation)
|
||||
- Better messages when an error occurs while parsing the config file
|
||||
- Start converting the code to static types
|
||||
- Add more information about the dependencies in the documentation
|
||||
|
||||
### Fixed
|
||||
- Removed the lasting lint errors (i.e. in main.py)
|
||||
|
|
|
@ -2,6 +2,40 @@
|
|||
|
||||
## Requirements
|
||||
|
||||
Diffuse depends on these projects:
|
||||
* Python 3.8+
|
||||
* PyPi
|
||||
* Cairo and GObject Introspection development headers
|
||||
* Meson
|
||||
* Flatpak and Flatpak builder
|
||||
|
||||
### Install the distribution dependencies
|
||||
|
||||
It's a bit difficult to get the command lines for all the distributions and
|
||||
their releases, but it should be enough to find the packages on other
|
||||
distributions.
|
||||
|
||||
<details>
|
||||
<summary>Debian/Ubuntu</summary>
|
||||
|
||||
```sh
|
||||
sudo apt install python3-pip libcairo2-dev libgirepository1.0-dev meson flatpak flatpak-builder
|
||||
```
|
||||
|
||||
_Note: Tested on Debian 11 (Buster) and Ubuntu 20.04 (Focal)_
|
||||
</details>
|
||||
<details>
|
||||
<summary>Fedora</summary>
|
||||
|
||||
```sh
|
||||
sudo dnf install python-pip python3-cairo-devel python3-gobject-devel meson flatpak flatpak-builder
|
||||
```
|
||||
|
||||
_Note: Tested on Fedora 34_
|
||||
</details>
|
||||
|
||||
### Install the project dependencies
|
||||
|
||||
To install the requirements just to execute the binary, run:
|
||||
|
||||
```sh
|
||||
|
|
|
@ -24,6 +24,7 @@ import shlex
|
|||
import sys
|
||||
|
||||
from gettext import gettext as _
|
||||
from typing import List
|
||||
|
||||
from diffuse import constants
|
||||
from diffuse import utils
|
||||
|
@ -386,7 +387,7 @@ class Preferences:
|
|||
def getEncodings(self):
|
||||
return self.encodings
|
||||
|
||||
def _getDefaultEncodings(self) -> list[str]:
|
||||
def _getDefaultEncodings(self) -> List[str]:
|
||||
return self.string_prefs['encoding_auto_detect_codecs'].split()
|
||||
|
||||
def getDefaultEncoding(self) -> str:
|
||||
|
|
|
@ -25,7 +25,7 @@ import traceback
|
|||
|
||||
from enum import IntFlag
|
||||
from gettext import gettext as _
|
||||
from typing import Final, Optional, TextIO
|
||||
from typing import Final, List, Optional, TextIO
|
||||
|
||||
from diffuse import constants
|
||||
from diffuse.resources import theResources
|
||||
|
@ -106,7 +106,7 @@ def logErrorAndDialog(msg: str, parent: Gtk.Widget = None) -> None:
|
|||
dialog.destroy()
|
||||
|
||||
|
||||
def make_subdirs(p: str, ss: list[str]) -> str:
|
||||
def make_subdirs(p: str, ss: List[str]) -> str:
|
||||
'''Create nested subdirectories and return the complete path.'''
|
||||
for s in ss:
|
||||
p = os.path.join(p, s)
|
||||
|
@ -221,7 +221,7 @@ def strip_eol(s: str) -> str:
|
|||
return s
|
||||
|
||||
|
||||
def _strip_eols(ss: list[str]) -> list[str]:
|
||||
def _strip_eols(ss: List[str]) -> List[str]:
|
||||
'''Returns the list of strings without line ending characters.'''
|
||||
return [strip_eol(s) for s in ss]
|
||||
|
||||
|
@ -232,7 +232,7 @@ def popenReadLines(dn, cmd, prefs, bash_pref, success_results=None):
|
|||
dn, cmd, prefs, bash_pref, success_results).decode('utf-8', errors='ignore')))
|
||||
|
||||
|
||||
def readconfiglines(fd: TextIO) -> list[str]:
|
||||
def readconfiglines(fd: TextIO) -> List[str]:
|
||||
return fd.read().replace('\r', '').split('\n')
|
||||
|
||||
|
||||
|
@ -243,7 +243,7 @@ def globEscape(s: str) -> str:
|
|||
|
||||
|
||||
# split string into lines based upon DOS, Mac, and Unix line endings
|
||||
def splitlines(text: str) -> list[str]:
|
||||
def splitlines(text: str) -> List[str]:
|
||||
# split on new line characters
|
||||
temp, i, n = [], 0, len(text)
|
||||
while i < n:
|
||||
|
@ -272,7 +272,7 @@ def splitlines(text: str) -> list[str]:
|
|||
|
||||
|
||||
# also recognize old Mac OS line endings
|
||||
def readlines(fd: TextIO) -> list[str]:
|
||||
def readlines(fd: TextIO) -> List[str]:
|
||||
return _strip_eols(splitlines(fd.read()))
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
import os
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
from diffuse import utils
|
||||
from diffuse.vcs.svn import Svn
|
||||
|
||||
|
@ -33,7 +35,7 @@ class Svk(Svn):
|
|||
return 'Depot Path: '
|
||||
|
||||
@staticmethod
|
||||
def _parseStatusLine(s: str) -> tuple[str, str]:
|
||||
def _parseStatusLine(s: str) -> Tuple[str, str]:
|
||||
if len(s) < 4 or s[0] not in 'ACDMR':
|
||||
return '', ''
|
||||
return s[0], s[4:]
|
||||
|
|
|
@ -21,7 +21,7 @@ import os
|
|||
import glob
|
||||
|
||||
from gettext import gettext as _
|
||||
from typing import Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from diffuse import utils
|
||||
from diffuse.vcs.folder_set import FolderSet
|
||||
|
@ -44,7 +44,7 @@ class Svn(VcsInterface):
|
|||
return 'URL: '
|
||||
|
||||
@staticmethod
|
||||
def _parseStatusLine(s: str) -> tuple[str, str]:
|
||||
def _parseStatusLine(s: str) -> Tuple[str, str]:
|
||||
if len(s) < 8 or s[0] not in 'ACDMR':
|
||||
return '', ''
|
||||
# subversion 1.6 adds a new column
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import os
|
||||
|
||||
from gettext import gettext as _
|
||||
from typing import Optional
|
||||
from typing import List, Optional
|
||||
|
||||
from diffuse import utils
|
||||
from diffuse.preferences import Preferences
|
||||
|
@ -99,7 +99,7 @@ def _get_darcs_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]:
|
|||
def _get_git_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]:
|
||||
if 'GIT_DIR' in os.environ:
|
||||
try:
|
||||
ss: list[str] = utils.popenReadLines(
|
||||
ss: List[str] = utils.popenReadLines(
|
||||
path,
|
||||
[
|
||||
prefs.getString('git_bin'),
|
||||
|
@ -185,7 +185,7 @@ def _get_svk_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]:
|
|||
try:
|
||||
# find working copies by parsing the config file
|
||||
with open(svkconfig, 'r', encoding='utf-8') as f:
|
||||
ss: list[str] = utils.readlines(f)
|
||||
ss: List[str] = utils.readlines(f)
|
||||
projs, sep = [], os.sep
|
||||
# find the separator character
|
||||
for s in ss:
|
||||
|
|
Loading…
Reference in New Issue