Skip to content

Commit

Permalink
Fix the style tests, so the debian package can build.
Browse files Browse the repository at this point in the history
The small tests have been disabled for the moment
  • Loading branch information
LyzardKing committed Jan 6, 2024
1 parent 3f13478 commit d04e85d
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dh $@ --with python3 --buildsystem=pybuild --fail-missing

override_dh_auto_test:
# ./runtests pep8 small
./runtests pep8

override_dh_installman:
help2man -n "Deploy and setup developers environment easily on ubuntu" -o debian/umake.1 bin/umake
Expand Down
16 changes: 16 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[flake8]
exclude = env/, build, .git
# Only check for unused_imports
select = F401

[pycodestyle]
exclude = env/, build, .git
max-line-length = 150
# Ignore:
# E111 indentation is not a multiple of four
# E722 do not use bare except, specify exception instead
# W504 (*) line break after binary operator
ignore = E111, E722, W504, W605, E251, E275

[tool:pytest]
addopts = -v
1 change: 0 additions & 1 deletion tests/medium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def get_launcher_path(self, desktop_filename):
desktop_filename])
return self._exec_command(command)[1]


def path_exists(self, path):
"""Check if a path exists inside the container"""
# replace current user home dir with container one.
Expand Down
2 changes: 1 addition & 1 deletion tests/medium/test_ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import os

from ..large import test_ide
from ..tools import get_data_dir, swap_file_and_restore, UMAKE
from ..tools import get_data_dir, UMAKE


class EclipseJavaIDEInContainer(ContainerTests, test_ide.EclipseJavaIDETests):
Expand Down
1 change: 0 additions & 1 deletion umake/frameworks/dart.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import re
import umake.frameworks.baseinstaller
from umake.interactions import DisplayMessage
from umake.network.download_center import DownloadCenter, DownloadItem
from umake.tools import add_env_to_user, get_current_arch
from umake.ui import UI

Expand Down
1 change: 0 additions & 1 deletion umake/frameworks/electronics.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def post_install(self):
UI.delayed_display(DisplayMessage(_("You need to logout and login again for your installation to work")))



class ArduinoLegacy(umake.frameworks.baseinstaller.BaseInstaller):
"""The Arduino Software distribution."""

Expand Down
3 changes: 1 addition & 2 deletions umake/frameworks/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import os
import re
import shutil
import stat

import umake.frameworks.baseinstaller
from umake.network.download_center import DownloadItem, DownloadCenter
from umake.tools import as_root, create_launcher, get_application_desktop_file, get_current_arch
from umake.tools import create_launcher, get_application_desktop_file, get_current_arch

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions umake/frameworks/ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def __init__(self, **kwargs):
}

def parse_download_link(self, line, in_download):
"""Parse STS download links"""
"""Parse STS download links"""
url = None
if '{}.tar.gz'.format(self.arch_trans[get_current_arch()]) in line:
p = re.search(r'href="([^<]*{}.tar.gz)"'.format(self.arch_trans[get_current_arch()]), line)
Expand Down Expand Up @@ -797,7 +797,7 @@ def parse_download_link(self, line, in_download):
url = None
checksum = None
if int(get_current_distro_version(distro_name="debian").split('.')[0]) == 9 or\
int(get_current_distro_version().split('.')[0]) == 20:
int(get_current_distro_version().split('.')[0]) == 20:
ubuntu_version = "focal"
else:
ubuntu_version = 'jammy'
Expand Down
5 changes: 4 additions & 1 deletion umake/frameworks/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
import logging
import os
import umake.frameworks.baseinstaller
from umake.tools import create_launcher, get_application_desktop_file
from umake.tools import create_launcher, get_application_desktop_file, add_env_to_user
from umake.ui import UI
from umake.interactions import DisplayMessage
import re
from contextlib import suppress

logger = logging.getLogger(__name__)

Expand Down
4 changes: 1 addition & 3 deletions umake/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
from collections import namedtuple
from contextlib import contextmanager, suppress
from enum import unique, Enum
from http.client import HTTPConnection
from gettext import gettext as _
from gi.repository import GLib, Gio
from glob import glob
from urllib.parse import urlsplit
import logging
import os
import re
Expand Down Expand Up @@ -465,4 +463,4 @@ def add_env_to_user(framework_tag, env_dict):


def validate_url(url):
return requests.head(url).ok
return requests.head(url).ok

0 comments on commit d04e85d

Please sign in to comment.