Skip to content

Commit

Permalink
Merge 2e583ee into df46d9b
Browse files Browse the repository at this point in the history
  • Loading branch information
tych0 committed Nov 29, 2022
2 parents df46d9b + 2e583ee commit 2840dd1
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
# - /libqtile/scripts/check.py mypy argument
# If adding new python versions, consider also updating
# python version in .readthedocs.yaml
python-version: [pypy-3.9, 3.8, 3.9, '3.10', '3.11']
python-version: [pypy-3.9, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
container: quay.io/pypa/manylinux_2_24_x86_64
strategy:
matrix:
python-version: ["cp3.8", "cp3.9", "cp3.10", "cp3.11", "pp3.9"]
python-version: ["cp3.9", "cp3.10", "cp3.11", "pp3.9"]
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
needs: build-wheel
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
include:
- python-version: "pypy-3.9"
manual-version: "pp3.9"
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
needs: [test-wheel, build-source]
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
include:
- python-version: "pypy-3.9"
manual-version: "pp3.9"
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG
Expand Up @@ -31,7 +31,7 @@ Qtile x.xx.x, released XXXX-XX-XX:
- Fix `Notify` bug when apps close notifications.
* python version support
- We have added support for python 3.11 and pypy 3.9.
- python 3.7 and pypy 3.7 are not longer supported.
- python 3.7, 3.8 and pypy 3.7 are not longer supported.
- Fix bug where `StatusNotifier` does not update icons

Qtile 0.22.0, released 2022-09-22:
Expand Down
4 changes: 2 additions & 2 deletions libqtile/extension/base.py
Expand Up @@ -95,13 +95,13 @@ class RunCommand(_Extension):
`client <http://docs.qtile.org/en/latest/manual/commands/scripting.html>`_.
"""

defaults = [
defaults: list[tuple[str, Any, str]] = [
# NOTE: Do not use a list as a default value, since it would be shared
# among all the objects inheriting this class, and if one of them
# modified it, all the other objects would see the modified list;
# use a string or a tuple instead, which are immutable
("command", None, "the command to be launched (string or list with arguments)"),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, **config):
_Extension.__init__(self, **config)
Expand Down
2 changes: 1 addition & 1 deletion libqtile/layout/base.py
Expand Up @@ -37,7 +37,7 @@
class Layout(CommandObject, configurable.Configurable, metaclass=ABCMeta):
"""This class defines the API that should be exposed by all layouts"""

defaults = [] # type: list[tuple[str, Any, str]]
defaults: list[tuple[str, Any, str]] = []

def __init__(self, **config):
# name is a little odd; we can't resolve it until the class is defined
Expand Down
7 changes: 0 additions & 7 deletions libqtile/scripts/check.py
Expand Up @@ -97,13 +97,6 @@ def type_check_config_args(config_file):
def check_deps() -> None:
ok = True

if sys.version_info.minor < 8: # < 3.8
print(
"mypy check is not supported for the current version of Python, "
"please update to at least 3.8 and try again."
)
ok = False

for dep in ["mypy", "stubtest"]:
if shutil.which(dep) is None:
print(f"{dep} was not found. Please install it and try again.")
Expand Down
6 changes: 3 additions & 3 deletions libqtile/widget/base.py
Expand Up @@ -138,14 +138,14 @@ def open_calendar():

offsetx: int = 0
offsety: int = 0
defaults = [
defaults: list[tuple[str, Any, str]] = [
("background", None, "Widget background color"),
(
"mouse_callbacks",
{},
"Dict of mouse button press callback functions. Accepts functions and ``lazy`` calls.",
),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, length, **config):
"""
Expand Down Expand Up @@ -800,7 +800,7 @@ def on_done(future):
except Exception:
logger.exception("Failed to reschedule.")
else:
logger.warning("poll() returned None, not rescheduling")
logger.warning("%s's poll() returned None, not rescheduling", self.name)

self.future = self.qtile.run_in_executor(self.poll)
self.future.add_done_callback(on_done)
Expand Down
10 changes: 5 additions & 5 deletions libqtile/widget/battery.py
Expand Up @@ -192,7 +192,7 @@ class _LinuxBattery(_Battery, configurable.Configurable):
),
]

filenames = {} # type: dict
filenames: dict = {}

BAT_DIR = "/sys/class/power_supply"

Expand Down Expand Up @@ -451,12 +451,12 @@ class BatteryIcon(base._Widget):
"""Battery life indicator widget."""

orientations = base.ORIENTATION_HORIZONTAL
defaults = [
defaults: list[tuple[str, Any, str]] = [
("battery", 0, "Which battery should be monitored"),
("update_interval", 60, "Seconds between status updates"),
("theme_path", default_icon_path(), "Path of the icons"),
("scale", 1, "Scale factor relative to the bar height. " "Defaults to 1"),
] # type: list[tuple[str, Any, str]]
]

icon_names = (
"battery-missing",
Expand All @@ -481,12 +481,12 @@ def __init__(self, **config) -> None:

base._Widget.__init__(self, length=bar.CALCULATED, **config)
self.add_defaults(self.defaults)
self.scale = 1.0 / self.scale # type: float
self.scale: float = 1.0 / self.scale

self.length_type = bar.STATIC
self.length = 0
self.image_padding = 0
self.surfaces = {} # type: dict[str, Img]
self.surfaces: dict[str, Img] = {}
self.current_icon = "battery-missing"

self._battery = self._load_battery(**config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/generic_poll_text.py
Expand Up @@ -40,15 +40,15 @@ def poll(self):
class GenPollUrl(base.ThreadPoolText):
"""A generic text widget that polls an url and parses it using parse function"""

defaults = [
defaults: list[tuple[str, Any, str]] = [
("url", None, "Url"),
("data", None, "Post Data"),
("parse", None, "Parse Function"),
("json", True, "Is Json?"),
("user_agent", "Qtile", "Set the user agent"),
("headers", {}, "Extra Headers"),
("xml", False, "Is XML?"),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, **config):
base.ThreadPoolText.__init__(self, "", **config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/groupbox.py
Expand Up @@ -39,10 +39,10 @@


class _GroupBase(base._TextBox, base.PaddingMixin, base.MarginMixin):
defaults = [
defaults: list[tuple[str, Any, str]] = [
("borderwidth", 3, "Current group border width"),
("center_aligned", True, "center-aligned group box"),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, **config):
base._TextBox.__init__(self, **config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/idlerpg.py
Expand Up @@ -40,13 +40,13 @@ class IdleRPG(GenPollUrl):

defaults = [
("format", "IdleRPG: {online} TTL: {ttl}", "Display format"),
("json", False, "Not json :)"),
("xml", True, "Is XML :)"),
]

def __init__(self, **config):
GenPollUrl.__init__(self, **config)
self.add_defaults(IdleRPG.defaults)
self.json = False
self.xml = True

def parse(self, body):
formatted = {}
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/open_weather.py
Expand Up @@ -188,7 +188,7 @@ class OpenWeather(GenPollUrl):
"50n": "🌫",
}

defaults = [
defaults: list[tuple[str, Any, str]] = [
# One of (cityid, location, zip, coordinates) must be set.
(
"app_key",
Expand Down Expand Up @@ -255,7 +255,7 @@ class OpenWeather(GenPollUrl):
dict(),
"Dictionary of weather symbols. Can be used to override default symbols.",
),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, **config):
GenPollUrl.__init__(self, **config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/textbox.py
Expand Up @@ -33,13 +33,13 @@
class TextBox(base._TextBox):
"""A flexible textbox that can be updated from bound keys, scripts, and qshell."""

defaults = [
defaults: list[tuple[str, Any, str]] = [
("font", "sans", "Text font"),
("fontsize", None, "Font pixel size. Calculated if None."),
("fontshadow", None, "font shadow color, default is None(no shadow)"),
("padding", None, "Padding left and right. Calculated if None."),
("foreground", "#ffffff", "Foreground colour."),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, text=" ", width=bar.CALCULATED, **config):
base._TextBox.__init__(self, text=text, width=width, **config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/widgetbox.py
Expand Up @@ -55,7 +55,7 @@ class WidgetBox(base._Widget):
"""

orientations = base.ORIENTATION_HORIZONTAL
defaults = [
defaults: list[tuple[str, Any, str]] = [
("font", "sans", "Text font"),
("fontsize", None, "Font pixel size. Calculated if None."),
("fontshadow", None, "font shadow color, default is None(no shadow)"),
Expand All @@ -68,7 +68,7 @@ class WidgetBox(base._Widget):
("text_closed", "[<]", "Text when box is closed"),
("text_open", "[>]", "Text when box is open"),
("widgets", list(), "A list of widgets to include in the box"),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, _widgets: list[base._Widget] | None = None, **config):
base._Widget.__init__(self, bar.CALCULATED, **config)
Expand Down
4 changes: 2 additions & 2 deletions libqtile/widget/window_count.py
Expand Up @@ -33,15 +33,15 @@ class WindowCount(base._TextBox):
current group of the screen on which the widget is.
"""

defaults = [
defaults: list[tuple[str, Any, str]] = [
("font", "sans", "Text font"),
("fontsize", None, "Font pixel size. Calculated if None."),
("fontshadow", None, "font shadow color, default is None(no shadow)"),
("padding", None, "Padding left and right. Calculated if None."),
("foreground", "#ffffff", "Foreground colour."),
("text_format", "{num}", "Format for message"),
("show_zero", False, "Show window count when no windows"),
] # type: list[tuple[str, Any, str]]
]

def __init__(self, width=bar.CALCULATED, **config):
base._TextBox.__init__(self, width=width, **config)
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Expand Up @@ -21,7 +21,6 @@ classifiers =
Operating System :: POSIX :: BSD :: FreeBSD
Operating System :: POSIX :: Linux
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -36,7 +35,7 @@ project_urls =

[options]
packages = find:
python_requires >= 3.8
python_requires >= 3.9
setup_requires =
cffi >= 1.1.0
cairocffi[xcb] >= 0.9.0
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Expand Up @@ -4,7 +4,6 @@ skipsdist=True
minversion = 1.8
envlist =
pypy3,
py38,
py39,
py310,
py311,
Expand Down Expand Up @@ -49,7 +48,7 @@ commands =
# py310 currently fails with -W error, see: https://gitlab.gnome.org/GNOME/pygobject/-/issues/476
# pypy3 is very slow when running coverage reports so we skip it
pypy3: python3 -m pytest -W error --backend=x11 --backend=wayland {posargs}
py{38,39}: coverage run -m pytest -W error --backend=x11 --backend=wayland {posargs}
py39: coverage run -m pytest -W error --backend=x11 --backend=wayland {posargs}
py310: coverage run -m pytest --backend=x11 --backend=wayland {posargs}

# dbus-next 0.2.3 causes a segfault when run in GLib's mainloop in python 3.11
Expand Down Expand Up @@ -135,7 +134,6 @@ commands =
[gh-actions]
python =
pypy-3.9: pypy3
3.8: py38, mypy
3.9: py39, mypy
3.10: py310, mypy
3.11: py311, mypy, packaging, pep8, codestyle, docstyle, vulture

0 comments on commit 2840dd1

Please sign in to comment.