Compare commits

...

2 commits

Author SHA1 Message Date
Hans-Christoph Steiner
d594a683ab Merge branch 'isort' into 'master'
Sort import

See merge request fdroid/fdroidserver!1689
2025-07-26 15:47:48 +00:00
linsui
7a98650ed3 Sort import
ruff check --fix --select I
2025-07-26 15:35:19 +00:00
68 changed files with 342 additions and 291 deletions

View file

@ -12,6 +12,7 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../fdroidserver'))
# -- Project information -----------------------------------------------------

View file

@ -6,7 +6,6 @@ import argparse
import logging
from fdroidserver import _, common, metadata
from fdroidserver.exception import VCSException
fdroid_summary = 'reset app VCSs to the latest version'

View file

@ -4,6 +4,7 @@
import os
from argparse import ArgumentParser
from fdroidserver import common
from fdroidserver.common import FDroidPopen
from fdroidserver.exception import BuildException

View file

@ -4,6 +4,7 @@
import os
from argparse import ArgumentParser
from fdroidserver import common
from fdroidserver.common import FDroidPopen
from fdroidserver.exception import BuildException

View file

@ -4,6 +4,7 @@
#
from argparse import ArgumentParser
from fdroidserver import common, index
fdroid_summary = 'export the keystore in standard PEM format'

View file

@ -8,6 +8,7 @@
import argparse
import os
import pprint
from fdroidserver import _, common, metadata
fdroid_summary = 'prepare the srclibs for `fdroid build --on-server`'

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python3
from argparse import ArgumentParser
from fdroidserver import common
from fdroidserver.common import FDroidPopen
from fdroidserver.exception import BuildException

View file

@ -3,7 +3,6 @@ import glob
import os
import sys
# support running straight from git and standard installs
rootpaths = [
os.path.realpath(os.path.join(os.path.dirname(__file__), '..')),
@ -24,39 +23,52 @@ gettext.textdomain('fdroidserver')
_ = gettext.gettext
from fdroidserver.exception import (FDroidException,
from fdroidserver.exception import (
FDroidException,
MetaDataException,
VerificationException) # NOQA: E402
VerificationException, # NOQA: E402
)
FDroidException # NOQA: B101
MetaDataException # NOQA: B101
VerificationException # NOQA: B101
from fdroidserver.common import (verify_apk_signature,
genkeystore as generate_keystore) # NOQA: E402
from fdroidserver.common import genkeystore as generate_keystore # NOQA: E402
from fdroidserver.common import verify_apk_signature
verify_apk_signature # NOQA: B101
generate_keystore # NOQA: B101
from fdroidserver.index import (download_repo_index,
from fdroidserver.index import (
download_repo_index,
download_repo_index_v1,
download_repo_index_v2,
get_mirror_service_urls,
make as make_index) # NOQA: E402
)
from fdroidserver.index import make as make_index # NOQA: E402
download_repo_index # NOQA: B101
download_repo_index_v1 # NOQA: B101
download_repo_index_v2 # NOQA: B101
get_mirror_service_urls # NOQA: B101
make_index # NOQA: B101
from fdroidserver.update import (process_apk,
from fdroidserver.update import (
process_apk,
process_apks,
scan_apk,
scan_repo_files) # NOQA: E402
scan_repo_files, # NOQA: E402
)
process_apk # NOQA: B101
process_apks # NOQA: B101
scan_apk # NOQA: B101
scan_repo_files # NOQA: B101
from fdroidserver.deploy import (update_awsbucket,
from fdroidserver.deploy import (
update_awsbucket,
update_servergitmirrors,
update_serverwebroot, # NOQA: E402
update_serverwebroots,
update_serverwebroot) # NOQA: E402
)
update_awsbucket # NOQA: B101
update_servergitmirrors # NOQA: B101
update_serverwebroots # NOQA: B101

View file

@ -18,20 +18,20 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
import sys
import importlib.metadata
import logging
import os
import pkgutil
import logging
import importlib.metadata
import git
import fdroidserver.common
import fdroidserver.metadata
from fdroidserver import _
import re
import sys
from argparse import ArgumentError
from collections import OrderedDict
import git
import fdroidserver.common
import fdroidserver.metadata
from fdroidserver import _
COMMANDS = OrderedDict([
("build", _("Build a package from source")),

View file

@ -68,9 +68,18 @@ import struct
import sys
import zipfile
import zlib
from collections import namedtuple
from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, Optional, Tuple, Union
from typing import (
Any,
BinaryIO,
Callable,
Dict,
Iterable,
Iterator,
Optional,
Tuple,
Union,
)
__version__ = "1.1.1"
NAME = "apksigcopier"

View file

@ -28,22 +28,21 @@
# the F-Droid client.
import collections
import defusedxml.minidom
import git
import glob
import os
import json
import logging
import requests
import os
import shutil
import tempfile
import zipfile
from argparse import ArgumentParser
from typing import Optional
from . import _
from . import common
from . import deploy
import defusedxml.minidom
import git
import requests
from . import _, common, deploy
from .exception import FDroidException

View file

@ -18,31 +18,27 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import shutil
import argparse
import glob
import subprocess
import logging
import os
import posixpath
import re
import shutil
import subprocess
import tarfile
import threading
import traceback
import time
import requests
import tempfile
import argparse
import logging
import threading
import time
import traceback
from gettext import ngettext
from pathlib import Path
from . import _
from . import common
from . import net
from . import metadata
from . import scanner
from . import vmtools
import requests
from . import _, common, metadata, net, scanner, vmtools
from .common import FDroidPopen
from .exception import FDroidException, BuildException, VCSException
from .exception import BuildException, FDroidException, VCSException
try:
import paramiko

View file

@ -19,28 +19,30 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import configparser
import git
import copy
import logging
import os
import re
import urllib.request
import urllib.error
import time
import subprocess
import sys
from argparse import ArgumentParser
import time
import traceback
import logging
import copy
import urllib.error
import urllib.parse
import urllib.request
from argparse import ArgumentParser
from pathlib import Path
from typing import Optional
from . import _
from . import common
from . import metadata
from . import net
from .exception import VCSException, NoSubmodulesException, FDroidException, MetaDataException
import git
from . import _, common, metadata, net
from .exception import (
FDroidException,
MetaDataException,
NoSubmodulesException,
VCSException,
)
# https://gitlab.com/fdroid/checkupdates-runner/-/blob/1861899262a62a4ed08fa24e5449c0368dfb7617/.gitlab-ci.yml#L36
BOT_EMAIL = 'fdroidci@bubu1.eu'

View file

@ -52,54 +52,58 @@ environment variable to include.
"""
import ast
import base64
import copy
import difflib
from typing import List
import filecmp
import git
import glob
import gzip
import hashlib
import io
import itertools
import json
import logging
import operator
import os
import sys
import re
import ast
import gzip
import shutil
import socket
import stat
import subprocess
import time
import operator
import logging
import hashlib
import socket
import base64
import zipfile
import sys
import tempfile
import json
from pathlib import Path
import defusedxml.ElementTree as XMLElementTree
import time
import zipfile
from argparse import BooleanOptionalAction
from asn1crypto import cms
from base64 import urlsafe_b64encode
from binascii import hexlify
from datetime import datetime, timedelta, timezone
from pathlib import Path
from queue import Queue
from typing import List
from urllib.parse import urlparse, urlsplit, urlunparse
from zipfile import ZipFile
import defusedxml.ElementTree as XMLElementTree
import git
from asn1crypto import cms
import fdroidserver.metadata
from fdroidserver import _
from fdroidserver._yaml import yaml, config_dump
from fdroidserver.exception import FDroidException, VCSException, NoSubmodulesException, \
BuildException, VerificationException, MetaDataException
from .asynchronousfilereader import AsynchronousFileReader
from .looseversion import LooseVersion
from fdroidserver._yaml import config_dump, yaml
from fdroidserver.exception import (
BuildException,
FDroidException,
MetaDataException,
NoSubmodulesException,
VCSException,
VerificationException,
)
from . import apksigcopier, common
from .asynchronousfilereader import AsynchronousFileReader
from .looseversion import LooseVersion
# The path to this fdroidserver distribution
FDROID_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
@ -2904,9 +2908,9 @@ def is_debuggable_or_testOnly(apkfile):
return False
try:
# these were moved in androguard 4.0
from androguard.core.axml import AXMLParser, format_value, START_TAG
from androguard.core.axml import START_TAG, AXMLParser, format_value
except ImportError:
from androguard.core.bytecodes.axml import AXMLParser, format_value, START_TAG
from androguard.core.bytecodes.axml import START_TAG, AXMLParser, format_value
_androguard_logging_level()
with ZipFile(apkfile) as apk:
@ -2978,9 +2982,23 @@ def get_apk_id_androguard(apkfile):
try:
# these were moved in androguard 4.0
from androguard.core.axml import AXMLParser, format_value, START_TAG, END_TAG, TEXT, END_DOCUMENT
from androguard.core.axml import (
END_DOCUMENT,
END_TAG,
START_TAG,
TEXT,
AXMLParser,
format_value,
)
except ImportError:
from androguard.core.bytecodes.axml import AXMLParser, format_value, START_TAG, END_TAG, TEXT, END_DOCUMENT
from androguard.core.bytecodes.axml import (
END_DOCUMENT,
END_TAG,
START_TAG,
TEXT,
AXMLParser,
format_value,
)
_androguard_logging_level()
appid = None

View file

@ -16,28 +16,28 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import glob
import hashlib
import json
import logging
import os
import pathlib
import re
import shutil
import subprocess
import sys
import time
import urllib
from typing import Dict, List
from git import Repo
import yaml
from argparse import ArgumentParser
import logging
import pathlib
import shutil
from typing import Dict, List
import git
import yaml
from git import Repo
import fdroidserver.github
from . import _
from . import common
from . import index
from . import _, common, index
from .exception import FDroidException
config = None
@ -349,8 +349,8 @@ def update_awsbucket_libcloud(repo_section, is_index_only=False):
import libcloud.security
libcloud.security.VERIFY_SSL_CERT = True
from libcloud.storage.types import Provider, ContainerDoesNotExistError
from libcloud.storage.providers import get_driver
from libcloud.storage.types import ContainerDoesNotExistError, Provider
if not config.get('awsaccesskeyid') or not config.get('awssecretkey'):
raise FDroidException(
@ -854,9 +854,10 @@ def upload_to_android_observatory(repo_section):
def upload_apk_to_android_observatory(path):
# depend on requests and lxml only if users enable AO
import requests
from . import net
from lxml.html import fromstring
from . import net
apkfilename = os.path.basename(path)
r = requests.post(
'https://androidobservatory.org/',

View file

@ -18,8 +18,8 @@
import json
import pathlib
import urllib.request
import urllib.parse
import urllib.request
class GithubApi:

View file

@ -16,14 +16,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import glob
from argparse import ArgumentParser
import logging
import os
import time
from argparse import ArgumentParser
from . import _
from . import common
from . import _, common
from .common import FDroidPopen
from .exception import FDroidException

View file

@ -30,6 +30,7 @@ these installed on the signing server.
"""
import calendar
import collections
import hashlib
import json
@ -41,20 +42,27 @@ import sys
import tempfile
import urllib.parse
import zipfile
import calendar
from binascii import hexlify, unhexlify
from datetime import datetime, timezone
from pathlib import Path
from xml.dom.minidom import Document
from . import _
from . import common
from . import metadata
from . import signindex
from fdroidserver.common import ANTIFEATURES_CONFIG_NAME, CATEGORIES_CONFIG_NAME, CONFIG_CONFIG_NAME, MIRRORS_CONFIG_NAME, RELEASECHANNELS_CONFIG_NAME, DEFAULT_LOCALE, FDroidPopen, FDroidPopenBytes, load_publish_signer_fingerprints
from fdroidserver._yaml import yaml
from fdroidserver.common import (
ANTIFEATURES_CONFIG_NAME,
CATEGORIES_CONFIG_NAME,
CONFIG_CONFIG_NAME,
DEFAULT_LOCALE,
MIRRORS_CONFIG_NAME,
RELEASECHANNELS_CONFIG_NAME,
FDroidPopen,
FDroidPopenBytes,
load_publish_signer_fingerprints,
)
from fdroidserver.exception import FDroidException, VerificationException
from . import _, common, metadata, signindex
def make(apps, apks, repodir, archive):
"""Generate the repo index files.

View file

@ -19,16 +19,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import glob
import logging
import os
import re
import shutil
import socket
import sys
from argparse import ArgumentParser
import logging
from . import _
from . import common
from . import _, common
from .exception import FDroidException
config = {}

View file

@ -17,24 +17,21 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
import glob
import locale
import logging
import os
import sys
import termios
import tty
import defusedxml.ElementTree as XMLElementTree
from argparse import ArgumentParser, BooleanOptionalAction
from pathlib import Path
from urllib.parse import urlencode, urlparse, urlunparse
from . import _
from . import common, github, index, net
from .exception import FDroidException
import defusedxml.ElementTree as XMLElementTree
from . import _, common, github, index, net
from .exception import FDroidException
DEFAULT_IPFS_GATEWAYS = ("https://gateway.ipfs.io/ipfs/",)
MAVEN_CENTRAL_MIRRORS = [

View file

@ -24,9 +24,10 @@ import urllib.parse
from argparse import ArgumentParser
from pathlib import Path
from . import _, common, metadata, rewritemeta
from fdroidserver._yaml import yaml
from . import _, common, metadata, rewritemeta
config = None

View file

@ -18,19 +18,19 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pathlib import Path
import math
import platform
import os
import re
import logging
import ruamel.yaml
import math
import os
import platform
import re
from collections import OrderedDict
from pathlib import Path
from . import common
from . import _
from .exception import MetaDataException
import ruamel.yaml
from . import _, common
from ._yaml import yaml
from .exception import MetaDataException
srclibs = None
warnings_action = None

View file

@ -7,13 +7,10 @@ import posixpath
import socket
import subprocess
import sys
from argparse import ArgumentParser
import urllib.parse
from argparse import ArgumentParser
from . import _
from . import common
from . import index
from . import update
from . import _, common, index, update
def _run_wget(path, urls, verbose=False):
@ -133,6 +130,7 @@ def main():
import io
import json
import zipfile
from . import net
url = _append_to_url_path(section, 'index-v1.jar')

View file

@ -21,10 +21,11 @@ import copy
import logging
import os
import random
import requests
import tempfile
import time
import urllib
import requests
import urllib3
from requests.adapters import HTTPAdapter, Retry

View file

@ -19,25 +19,25 @@
import base64
import datetime
import git
import hashlib
import inspect
import logging
import os
import paramiko
import platform
import shutil
import ssl
import subprocess
import sys
import tempfile
import yaml
from urllib.parse import urlparse
from argparse import ArgumentParser
from typing import Optional
from urllib.parse import urlparse
from . import _
from . import common
import git
import paramiko
import yaml
from . import _, common
from .exception import VCSException
# hard coded defaults for Android ~/.android/debug.keystore files

View file

@ -28,23 +28,21 @@ mostly reports success by moving an APK from unsigned/ to repo/
"""
import sys
import glob
import hashlib
import json
import logging
import os
import re
import shutil
import glob
import hashlib
from argparse import ArgumentParser
from collections import OrderedDict
import logging
from gettext import ngettext
import json
import sys
import time
import zipfile
from argparse import ArgumentParser
from collections import OrderedDict
from gettext import ngettext
from . import _
from . import common
from . import metadata
from . import _, common, metadata
from .common import FDroidPopen
from .exception import BuildException, FDroidException

View file

@ -17,8 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from argparse import ArgumentParser
from . import common
from . import metadata
from . import common, metadata
def main():

View file

@ -17,16 +17,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from argparse import ArgumentParser
import logging
import io
import tempfile
import logging
import shutil
import tempfile
from argparse import ArgumentParser
from pathlib import Path
from . import _
from . import common
from . import metadata
from . import _, common, metadata
config = None

View file

@ -15,15 +15,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import logging
import os
import re
import sys
from argparse import ArgumentParser
import re
import os
import sys
import logging
from . import _
from . import common
from . import _, common
from .exception import FDroidException

View file

@ -17,15 +17,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import logging
import os
import time
import zipfile
from argparse import ArgumentParser
import logging
from . import _
from . import common
from . import metadata
from . import _, common, metadata
from .exception import FDroidException
config = None

View file

@ -28,8 +28,8 @@ Example
import os
import sys
import time
import threading
import time
class Tail(object):

View file

@ -20,26 +20,27 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import copy
import filecmp
import sys
import os
import shutil
import glob
import logging
import re
import socket
import warnings
import zipfile
import hashlib
import json
import logging
import os
import re
import shutil
import socket
import sys
import time
import yaml
import copy
import warnings
import zipfile
from argparse import ArgumentParser
from datetime import datetime, timezone
from pathlib import Path
import asn1crypto.cms
import defusedxml.ElementTree as ElementTree
from datetime import datetime, timezone
from argparse import ArgumentParser
from pathlib import Path
import yaml
try:
from yaml import CSafeLoader as SafeLoader
@ -49,14 +50,13 @@ except ImportError:
import collections
from binascii import hexlify
from . import _
from . import common
from . import metadata
from .common import DEFAULT_LOCALE
from .exception import BuildException, FDroidException, VerificationException
from PIL import Image, PngImagePlugin
import fdroidserver.index
from PIL import Image, PngImagePlugin
from . import _, common, metadata
from .common import DEFAULT_LOCALE
from .exception import BuildException, FDroidException, VerificationException
if hasattr(Image, 'DecompressionBombWarning'):
warnings.simplefilter('error', Image.DecompressionBombWarning)

View file

@ -16,18 +16,17 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
import glob
import json
import logging
import requests
import os
import sys
from argparse import ArgumentParser
from collections import OrderedDict
from . import _
from . import common
from . import net
import requests
from . import _, common, net
from .exception import FDroidException
config = None
@ -58,8 +57,8 @@ def _add_diffoscope_info(d):
]
d['diffoscope']['External-Tools-Required'] = external_tools
from diffoscope.tools import OS_NAMES, get_current_os
from diffoscope.external_tools import EXTERNAL_TOOLS
from diffoscope.tools import OS_NAMES, get_current_os
current_os = get_current_os()
os_list = [current_os] if (current_os in OS_NAMES) else iter(OS_NAMES)

View file

@ -16,16 +16,16 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from os.path import isdir, isfile, basename, abspath, expanduser
import os
import json
import logging
import os
import shutil
import subprocess
import textwrap
import logging
from .common import FDroidException
import threading
from os.path import abspath, basename, expanduser, isdir, isfile
from .common import FDroidException
lock = threading.Lock()

View file

@ -2,13 +2,13 @@
#
# add completed translations from weblate to MANIFEST.in
import git
import json
import os
import re
import requests
import subprocess
import git
import requests
projectbasedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
localedir = os.path.join(projectbasedir, 'locale')

View file

@ -25,7 +25,6 @@ import sys
from argparse import ArgumentParser
import git
import yaml
localmodule = os.path.realpath(

View file

@ -4,12 +4,12 @@
# that run in the buildserver setup. It is not really maintained, but
# is still here as a kind of reference.
import inspect
import logging
import os
import sys
import logging
import textwrap
import tempfile
import inspect
import textwrap
from argparse import ArgumentParser
localmodule = os.path.realpath(

View file

@ -5,11 +5,12 @@
import collections
import os
import re
import requests
import requests_cache
import sys
import tempfile
import requests
import requests_cache
def main():
# we want all the data

View file

@ -2,13 +2,13 @@
import os
import re
import requests
import subprocess
import sys
import requests
from colorama import Fore, Style
from packaging.version import Version
checksums = None
versions = dict()

View file

@ -1,9 +1,10 @@
#!/usr/bin/env python3
import os
import fdroidserver
import shutil
import sys
import fdroidserver
from fdroidserver import common, nightly
if os.getenv('CI') is None:

View file

@ -6,6 +6,7 @@
# This is used in update.has_known_vulnerability()
import re
import requests
# this list was generated using:

View file

@ -20,10 +20,8 @@ import sys
import tempfile
import unittest
import unittest.mock
from pathlib import Path
GP_FINGERPRINT = 'B7C2EEFD8DAC7806AF67DFCD92EB18126BC08312A7F2D6F3862E46013C7A6135'

View file

@ -8,8 +8,8 @@ from unittest import mock
import fdroidserver
from fdroidserver import common, signindex
from .shared_test_code import GP_FINGERPRINT, mkdtemp
from .shared_test_code import GP_FINGERPRINT, mkdtemp
basedir = Path(__file__).parent

View file

@ -6,15 +6,16 @@ import sys
import tempfile
import textwrap
import unittest
import yaml
from pathlib import Path
from unittest import mock
from .shared_test_code import TmpCwd, mkdtemp
import yaml
import fdroidserver.build
import fdroidserver.common
from .shared_test_code import TmpCwd, mkdtemp
class FakeProcess:
output = 'fake output'

View file

@ -1,19 +1,19 @@
#!/usr/bin/env python3
import git
import os
import platform
import shutil
import tempfile
import time
import unittest
from unittest import mock
from pathlib import Path
from unittest import mock
import git
import fdroidserver
import fdroidserver.checkupdates
basedir = Path(__file__).parent

View file

@ -1,40 +1,44 @@
#!/usr/bin/env python3
import difflib
import git
import glob
import gzip
import importlib
import json
import logging
import os
import re
import ruamel.yaml
import shutil
import subprocess
import sys
import tempfile
import textwrap
import time
import unittest
import textwrap
import gzip
from argparse import ArgumentParser
from datetime import datetime, timezone
from zipfile import BadZipFile, ZipFile
from unittest import mock
from pathlib import Path
from unittest import mock
from zipfile import BadZipFile, ZipFile
import git
import ruamel.yaml
import fdroidserver
import fdroidserver.signindex
import fdroidserver.common
import fdroidserver.metadata
from .shared_test_code import TmpCwd, mkdtemp, mkdir_testfiles
import fdroidserver.signindex
from fdroidserver._yaml import config_dump, yaml, yaml_dumper
from fdroidserver.common import ANTIFEATURES_CONFIG_NAME, CATEGORIES_CONFIG_NAME
from fdroidserver._yaml import yaml, yaml_dumper, config_dump
from fdroidserver.exception import FDroidException, VCSException,\
MetaDataException, VerificationException
from fdroidserver.exception import (
FDroidException,
MetaDataException,
VCSException,
VerificationException,
)
from fdroidserver.looseversion import LooseVersion
from .shared_test_code import TmpCwd, mkdir_testfiles, mkdtemp
basedir = Path(__file__).parent
@ -2415,9 +2419,10 @@ class CommonTest(SetUpTearDownMixin, unittest.TestCase):
@mock.patch('sdkmanager._generate_package_xml', lambda a, b, c: None)
def test_auto_install_ndk_mock_dl(self):
"""Test NDK installs by actually calling sdkmanager"""
import sdkmanager
import importlib.metadata
import sdkmanager
sdkmanager_version = LooseVersion(importlib.metadata.version('sdkmanager'))
if sdkmanager_version < LooseVersion('0.6.4'):
raise unittest.SkipTest('needs fdroid sdkmanager >= 0.6.4')

View file

@ -11,7 +11,8 @@ from unittest import mock
import git
import fdroidserver
from .shared_test_code import TmpCwd, mkdtemp, VerboseFalseOptions
from .shared_test_code import TmpCwd, VerboseFalseOptions, mkdtemp
basedir = Path(__file__).parent

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import unittest
import fdroidserver

View file

@ -3,9 +3,10 @@
import unittest
import unittest.mock
from .shared_test_code import mock_urlopen
import fdroidserver
from .shared_test_code import mock_urlopen
class GithubApiTest(unittest.TestCase):
def test__init(self):

View file

@ -5,11 +5,11 @@ import os
import shutil
import tempfile
import unittest
from fdroidserver import common, gpgsign
from pathlib import Path
from unittest.mock import MagicMock, patch
from fdroidserver import common, gpgsign
basedir = Path(__file__).parent

View file

@ -13,11 +13,11 @@ import git
import requests
import yaml
from .shared_test_code import TmpCwd, mkdtemp, VerboseFalseOptions
import fdroidserver
import fdroidserver.import_subcommand
from .shared_test_code import TmpCwd, VerboseFalseOptions, mkdtemp
basedir = Path(__file__).parent
logging.basicConfig(level=logging.DEBUG)

View file

@ -3,21 +3,22 @@
import copy
import datetime
import glob
import os
import unittest
from pathlib import Path
import yaml
import zipfile
from unittest.mock import patch
import requests
import tempfile
import json
import os
import shutil
import tempfile
import unittest
import zipfile
from pathlib import Path
from unittest.mock import patch
import requests
import yaml
import fdroidserver
from fdroidserver import common, index, publish, signindex, update
from .shared_test_code import GP_FINGERPRINT, TmpCwd, mkdtemp
from .shared_test_code import GP_FINGERPRINT, TmpCwd, mkdtemp
basedir = Path(__file__).parent

View file

@ -8,6 +8,7 @@ import unittest
import fdroidserver.common
import fdroidserver.init
from .shared_test_code import mkdtemp
basedir = pathlib.Path(__file__).parent

View file

@ -3,7 +3,6 @@
import os
import textwrap
import unittest
from pathlib import Path
from unittest.mock import Mock, patch

View file

@ -18,6 +18,7 @@ except ModuleNotFoundError:
from androguard.core.apk import get_apkid
from fdroidserver._yaml import yaml, yaml_dumper
from .shared_test_code import mkdir_testfiles
# TODO: port generic tests that use index.xml to index-v2 (test that

View file

@ -9,13 +9,13 @@ import unittest
from pathlib import Path
from unittest import mock
from .shared_test_code import mkdtemp
import fdroidserver.common
import fdroidserver.lint
import fdroidserver.metadata
from fdroidserver._yaml import config_dump
from .shared_test_code import mkdtemp
basedir = Path(__file__).parent

View file

@ -2,12 +2,13 @@
import os
import pkgutil
import tempfile
import textwrap
import unittest
import tempfile
from unittest import mock
import fdroidserver.__main__
from .shared_test_code import TmpCwd, TmpPyPath

View file

@ -4,22 +4,23 @@ import copy
import io
import os
import random
import ruamel.yaml
import shutil
import unittest
import tempfile
import textwrap
import unittest
from collections import OrderedDict
from pathlib import Path
from unittest import mock
import ruamel.yaml
import fdroidserver
from fdroidserver import metadata
from fdroidserver.exception import MetaDataException
from fdroidserver.common import DEFAULT_LOCALE
from fdroidserver._yaml import yaml
from .shared_test_code import TmpCwd, mkdtemp
from fdroidserver.common import DEFAULT_LOCALE
from fdroidserver.exception import MetaDataException
from .shared_test_code import TmpCwd, mkdtemp
basedir = Path(__file__).parent

View file

@ -2,16 +2,17 @@
import os
import random
import requests
import socket
import tempfile
import threading
import time
import unittest
from pathlib import Path
from unittest.mock import MagicMock, patch
import requests
from fdroidserver import net
from pathlib import Path
class RetryServer:

View file

@ -2,19 +2,18 @@
import os
import platform
import requests
import shutil
import subprocess
import tempfile
import time
import unittest
import yaml
from pathlib import Path
from unittest.mock import patch
from fdroidserver import common, exception, index, nightly
import requests
import yaml
from fdroidserver import common, exception, index, nightly
DEBUG_KEYSTORE = '/u3+7QAAAAIAAAABAAAAAQAPYW5kcm9pZGRlYnVna2V5AAABNYhAuskAAAK8MIICuDAOBgorBgEEASoCEQEBBQAEggKkqRnFlhidQmVff83bsAeewXPIsF0jiymzJnvrnUAQtCK0MV9uZonu37Mrj/qKLn56mf6QcvEoKvpCstZxzftgYYpAHWMVLM+hy2Z707QZEHlY7Ukppt8DItj+dXkeqGt7f8KzOb2AQwDbt9lm1fJb+MefLowTaubtvrLMcKIne43CbCu2D8HyN7RPWpEkVetA2Qgr5W4sa3tIUT80afqo9jzwJjKCspuxY9A1M8EIM3/kvyLo2B9r0cuWwRjYZXJ6gmTYI2ARNz0KQnCZUok14NDg+mZTb1B7AzRfb0lfjbA6grbzuAL+WaEpO8/LgGfuOh7QBZBT498TElOaFfQ9toQWA79wAmrQCm4OoFukpPIy2m/l6VjJSmlK5Q+CMOl/Au7OG1sUUCTvPaIr0XKnsiwDJ7a71n9garnPWHkvuWapSRCzCNgaUoGQjB+fTMJFFrwT8P1aLfM6onc3KNrDStoQZuYe5ngCLlNS56bENkVGvJBfdkboxtHZjqDXXON9jWGSOI527J3o2D5sjSVyx3T9XPrsL4TA/nBtdU+c/+M6aoASZR2VymzAKdMrGfj9kE5GXp8vv2vkJj9+OJ4Jm5yeczocc/Idtojjb1yg+sq1yY8kAQxgezpY1rpgi2jF3tSN01c23DNvAaSJLJX2ZuH8sD40ACc80Y1Qp1nUTdpwBZUeaeNruBwx4PHU8GnC71FwtiUpwNs0OoSl0pgDUJ3ODC5bs8B5QmW1wu1eg7I4mMSmCsNGW6VN3sFcu+WEqnmTxPoZombdFZKxsr2oq359Nn4bJ6Uc9PBz/sXsns7Zx1vND/oK/Jv5Y269UVAMeKX/eGpfnxzagW3tqGbOu12C2p9Azo5VxiU2fG/tmk2PjaG5hV/ywReco7I6C1p8OWM2fwAAAAEABVguNTA5AAAB6TCCAeUwggFOoAMCAQICBE89gTUwDQYJKoZIhvcNAQEFBQAwNzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0FuZHJvaWQxFjAUBgNVBAMTDUFuZHJvaWQgRGVidWcwHhcNMTIwMjE2MjIyMDM3WhcNNDIwMjA4MjIyMDM3WjA3MQswCQYDVQQGEwJVUzEQMA4GA1UEChMHQW5kcm9pZDEWMBQGA1UEAxMNQW5kcm9pZCBEZWJ1ZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3AKU7S7JXhUjEwxWP1/LPHXieh61SaA/+xbpqsPA+yjGz1sAcGAyuG6bjNAVm56pq7nkjJzicX7Wi83nUBo58DEC/quxOLdy0C4PEOSAeTnTT1RJIwMDvOgiL1GFCErvQ7gCH6zuAID/JRFbN6nIkhDjs2DYnSBl7aJJf8wCLc0CAwEAATANBgkqhkiG9w0BAQUFAAOBgQAoq/TJffA0l+ZGf89xndmHdxrO6qi+TzSlByvLZ4eFfCovTh1iO+Edrd5V1yXGLxyyvdsadMAFZT8SaxMrP5xxhJ0nra0APWYLpA96M//auMhQBWPgqPntwgvEZuEH7f0kdItjBJ39yijbG8xfgwid6XqNUo0TDDkp/wNWKpJ9tJe+2PrGw1NAvrgSydoH2j8DI1Eq'
DEBUG_KEYSTORE_KEY_FILE_NAME = (

View file

@ -15,17 +15,15 @@ import os
import pathlib
import shutil
import sys
import unittest
import tempfile
import unittest
from unittest import mock
from fdroidserver import publish
from fdroidserver import common
from fdroidserver import metadata
from fdroidserver import signatures
from fdroidserver import common, metadata, publish, signatures
from fdroidserver._yaml import yaml
from fdroidserver.exception import FDroidException
from .shared_test_code import mkdtemp, VerboseFalseOptions
from .shared_test_code import VerboseFalseOptions, mkdtemp
basedir = pathlib.Path(__file__).parent

View file

@ -1,13 +1,14 @@
#!/usr/bin/env python3
import os
import unittest
import tempfile
import textwrap
import unittest
from pathlib import Path
from unittest import mock
from fdroidserver import metadata, rewritemeta
from .shared_test_code import TmpCwd, mkdtemp
basedir = Path(__file__).parent

View file

@ -26,6 +26,7 @@ import fdroidserver.common
import fdroidserver.exception
import fdroidserver.metadata
import fdroidserver.scanner
from .shared_test_code import TmpCwd, mkdtemp, mock_open_to_str
basedir = pathlib.Path(__file__).parent

View file

@ -6,9 +6,10 @@ import sys
import unittest
from tempfile import TemporaryDirectory
from .shared_test_code import TmpCwd
from fdroidserver import common, signatures
from .shared_test_code import TmpCwd
basedir = os.path.dirname(__file__)

View file

@ -6,11 +6,11 @@ import shutil
import subprocess
import tempfile
import unittest
from fdroidserver import apksigcopier, common, exception, signindex, update
from pathlib import Path
from unittest.mock import patch
from fdroidserver import apksigcopier, common, exception, signindex, update
class Options:
allow_disabled_algorithms = False

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import copy
import git
import glob
import hashlib
import json
@ -12,16 +11,18 @@ import shutil
import string
import subprocess
import sys
import textwrap
import time
import unittest
import yaml
import zipfile
import textwrap
from binascii import hexlify
from datetime import datetime
from pathlib import Path
from unittest import mock
import git
import yaml
try:
# these were moved in androguard 4.0
from androguard.core.apk import APK
@ -44,15 +45,16 @@ except ImportError:
except ImportError:
from yaml import Loader as FullLoader
from PIL import PngImagePlugin
import fdroidserver.common
import fdroidserver.exception
import fdroidserver.metadata
import fdroidserver.update
from fdroidserver.common import CATEGORIES_CONFIG_NAME
from fdroidserver.looseversion import LooseVersion
from .shared_test_code import TmpCwd, mkdtemp
from PIL import PngImagePlugin
from .shared_test_code import TmpCwd, mkdtemp
DONATION_FIELDS = ('Donate', 'Liberapay', 'OpenCollective')

View file

@ -7,7 +7,8 @@ from git import Repo
import fdroidserver.common
import fdroidserver.metadata
from .shared_test_code import mkdtemp, VerboseFalseOptions
from .shared_test_code import VerboseFalseOptions, mkdtemp
class VCSTest(unittest.TestCase):

View file

@ -6,13 +6,11 @@ import shutil
import sys
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
from fdroidserver import verify
TEST_APP_ENTRY = {
"1539780240.3885746": {
"local": {