Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to CI #2272

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ ignore =
E402,
C901,
E722,
W503, # line break before binary operator
E231, # missing whitespace after ','
W503,
# line break before binary operator
E231,
# missing whitespace after ','
max-line-length = 100
exclude = env,.direnv,docs
max-complexity = 25
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -49,7 +49,6 @@ jobs:
virtualenv test-rtd
. ./test-rtd/bin/activate
pip install -r requirements-dev.txt
rm -rf test-rtd

# for dev
make dev-actions
Expand All @@ -60,6 +59,7 @@ jobs:
make test-actions
# prepare for deployment
make generate-paths
rm -rf test-rtd

- uses: Thog/action-equals@v1
id: isLatest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11

- name: Checkout the current branch
run: |
Expand Down
12 changes: 2 additions & 10 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ confidence=
disable=
arguments-differ,
attribute-defined-outside-init,
bad-continuation,
broad-except,
consider-using-ternary,
deprecated-method,
Expand All @@ -73,24 +72,24 @@ disable=
import-error, # needed for travis build
inconsistent-return-statements,
invalid-name,
locally-enabled,
missing-docstring,
no-member,
no-method-argument,
no-name-in-module,
no-self-use,
no-value-for-parameter,
pointless-string-statement,
protected-access,
redefined-builtin,
too-few-public-methods,
too-many-arguments,
too-many-boolean-expressions,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-positional-arguments,
too-many-statements,
undefined-variable,
ungrouped-imports,
Expand Down Expand Up @@ -307,13 +306,6 @@ max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ update:
lock: pipenv-lock requirements

requirements:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv run pipenv_to_requirements
PIPENV_IGNORE_VIRTUALENVS=1 pipenv requirements > requirements.txt
PIPENV_IGNORE_VIRTUALENVS=1 pipenv requirements --dev > requirements-dev.txt

pipenv-lock:
PIPENV_IGNORE_VIRTUALENVS=1 pipenv lock
Expand Down
19 changes: 9 additions & 10 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ python_version = "3"

[dev-packages]
"autopep8" = "*"
"flake8" = ">=3.8.0,<4.0.0"
"flake8" = "==7.1.1"
"pep8" = "*"
pylint = "*"
typed-ast = "*"
pylint = "==3.3.2"
astroid = "*"
fiximports = ">=0.1.18"
mock = ">=2.0.0"
Expand All @@ -20,24 +19,24 @@ pyflakes = "*"
pytest = "*"
yapf = "*"
reno = {version = ">=2.8.0",extras = ["sphinx"]}
pipenv-to-requirements = "*"
colorlog = "*"
sphinx-rtd-theme = "*"
sphinxcontrib-programoutput = "*"
e1839a8 = {editable = true,path = "."}
twine = "*"
pathlib2 = "*"
scandir = {markers = "python_version > '3.5'"}
pathlib2 = {markers = "python_version < '3.8'"}
scandir = {markers = "python_version < '3.5'"}
pyfakefs = "*"
pytest-cov = "*"
pew = "*"
black = "==21.8b0"
flakehell = "*"
black = "==24.10.0"
typing-extensions = "*"
toml = "*"
tomli = "*"
pre-commit = "==2.17.0"

[packages]
pbr = "*"
wheel = "*"
typing = {markers = "python_version > '3.5'"}
typing = {markers = "python_version < '3.5'"}
cython = "*"
pyyaml = "*"
1,849 changes: 959 additions & 890 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions docs/source/user/gtk3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ integration scripts accordingly.
Guake now uses ``Pipfile`` to store it Python dependencies (except the system dependencies such as
PyGTK3). It is maintained and used by `pipenv` CLI tool. It is a system more advanced than using
``requirements.txt``, but this file is still generated for backward compatibility (for example:
ReadTheDocs only support ``requirements.txt`` for the moment), by a tool I've developed, named
``pipenv_to_requirements`` (makefile target ``make requirements``).
It does generate ``requirements.txt`` (running dependencies), and ``requirements-dev.txt`` (build,
checks and test only). From then, Guake is now a classic, canon Python package (with setup.py,
building distrubution packages, ...).
ReadTheDocs only support ``requirements.txt`` for the moment), by the command ``pipenv
requirements``. From then, Guake is now a classic, canon Python package (with setup.py, building
distrubution packages, ...).

It however requires system libraries, so cannot work isolated inside a virtualenv. If you look
closer to the virtualenv used with ``make dev ; make run``, you will see it is configured to use
Expand Down
1 change: 0 additions & 1 deletion guake/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@


class AboutDialog(SimpleGladeApp):

"""The About Guake dialog class"""

def __init__(self):
Expand Down
17 changes: 5 additions & 12 deletions guake/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ def get_terminals(self):

def iter_terminals(self):
if self.get_child() is not None:
for t in self.get_child().iter_terminals():
yield t
yield from self.get_child().iter_terminals()

def replace_child(self, old, new):
self.remove(old)
Expand Down Expand Up @@ -221,17 +220,14 @@ def save_box_layout(self, box, panes: list):

def restore_box_layout(self, box, panes: list):
"""Restore box layout by `panes`"""
if not panes or not isinstance(panes, list):
return
if not box or not isinstance(box, TerminalBox):
# Should only called on TerminalBox
if not panes or not isinstance(panes, list) or not box or not isinstance(box, TerminalBox):
return

cur = panes.pop(0)
if cur["type"].startswith("dual"):
while True:
if self.guake:
# If Guake are not visible, we should pending the restore, then do the
# If Guake is not visible, we should pending the restore, then do the
# restore when Guake is visible again.
#
# Otherwise we will stuck in the infinite loop, since new DualTerminalBox
Expand Down Expand Up @@ -384,7 +380,6 @@ def do_search(self, widget):


class TerminalBox(Gtk.Box, TerminalHolder):

"""A box to group the terminal and a scrollbar."""

def __init__(self):
Expand Down Expand Up @@ -588,10 +583,8 @@ def get_terminals(self):
return self.get_child1().get_terminals() + self.get_child2().get_terminals()

def iter_terminals(self):
for t in self.get_child1().iter_terminals():
yield t
for t in self.get_child2().iter_terminals():
yield t
yield from self.get_child1().iter_terminals()
yield from self.get_child2().iter_terminals()

def replace_child(self, old, new):
if self.get_child1() is old:
Expand Down
1 change: 0 additions & 1 deletion guake/customcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class CustomCommands:

"""
Example for a custom commands file
[
Expand Down
2 changes: 0 additions & 2 deletions guake/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def get_text(self):


class PromptQuitDialog(Gtk.MessageDialog):

"""Prompts the user whether to quit/close a tab."""

def __init__(self, parent, procs, tabs, notebooks):
Expand Down Expand Up @@ -99,7 +98,6 @@ def close_tab(self):


class PromptResetColorsDialog(Gtk.MessageDialog):

"""Prompts the user whether to reset tab colors."""

def __init__(self, parent):
Expand Down
1 change: 0 additions & 1 deletion guake/gsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class GSettingHandler:

"""Handles gconf changes, if any gconf variable is changed, a
different method is called to handle this change.
"""
Expand Down
5 changes: 1 addition & 4 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@


class Guake(SimpleGladeApp):

"""Guake main class. Handles specialy the main window."""

def __init__(self):
Expand Down Expand Up @@ -288,9 +287,7 @@ def window_event(*args):
filename = pixmapfile("guake-notification.png")
notifier.showMessage(
_("Guake Terminal"),
_("Guake is now running,\n" "press <b>{!s}</b> to use it.").format(
xml_escape(label)
),
_("Guake is now running,\npress <b>{!s}</b> to use it.").format(xml_escape(label)),
filename,
)

Expand Down
1 change: 0 additions & 1 deletion guake/keybindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@


class Keybindings:

"""Handles changes in keyboard shortcuts."""

def __init__(self, guake):
Expand Down
13 changes: 6 additions & 7 deletions guake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,31 +288,31 @@ def main():
dest="bgcolor",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) background color of " "the selected tab."),
help=_("Set the hexadecimal (#rrggbb) background color of the selected tab."),
)

parser.add_argument(
"--fgcolor",
dest="fgcolor",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) foreground color of the " "selected tab."),
help=_("Set the hexadecimal (#rrggbb) foreground color of the selected tab."),
)

parser.add_argument(
"--bgcolor-current",
dest="bgcolor_current",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) background color of " "the current terminal."),
help=_("Set the hexadecimal (#rrggbb) background color of the current terminal."),
)

parser.add_argument(
"--fgcolor-current",
dest="fgcolor_current",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) foreground color of " "the current terminal."),
help=_("Set the hexadecimal (#rrggbb) foreground color of the current terminal."),
)

parser.add_argument(
Expand Down Expand Up @@ -346,8 +346,7 @@ def main():
action="store",
default="",
help=_(
"Rename the specified tab by --tab-index. Reset to default if TITLE is "
'a single dash "-".'
'Rename tab specified by --tab-index. Reset to default if TITLE is a single dash "-".'
),
)

Expand All @@ -358,7 +357,7 @@ def main():
metavar="TITLE",
action="store",
default="",
help=_("Rename the current tab. Reset to default if TITLE is a " 'single dash "-".'),
help=_('Rename the current tab. Reset to default if TITLE is a single dash "-".'),
)

parser.add_argument(
Expand Down
9 changes: 3 additions & 6 deletions guake/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ def has_page(self):
def iter_terminals(self):
for page in self.iter_pages():
if page is not None:
for t in page.iter_terminals():
yield t
yield from page.iter_terminals()

def iter_tabs(self):
for page_num in range(self.get_n_pages()):
Expand Down Expand Up @@ -613,8 +612,7 @@ def get_terminals(self):

def iter_terminals(self):
for k in self.notebooks:
for t in self.notebooks[k].iter_terminals():
yield t
yield from self.notebooks[k].iter_terminals()

def get_terminal_by_uuid(self, terminal_uuid):
for t in self.iter_terminals():
Expand All @@ -624,8 +622,7 @@ def get_terminal_by_uuid(self, terminal_uuid):

def iter_pages(self):
for k in self.notebooks:
for t in self.notebooks[k].iter_pages():
yield t
yield from self.notebooks[k].iter_pages()

def iter_notebooks(self):
for k in self.notebooks:
Expand Down
Loading
Loading