Skip to content

Commit

Permalink
Upgrade tested versions. (#774)
Browse files Browse the repository at this point in the history
* Run tests on Ubuntu 24.04.
* Drop Ubuntu 22.04 tests.
* Upgrade linter versions.
* Remove tests for macOS 12.
  • Loading branch information
jendrikseipp authored Sep 22, 2024
1 parent 80939db commit f0e05c5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on: [push, pull_request]
jobs:
build-deb-package:

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: build
uses: dawidd6/action-debian-package@v1.4.4
uses: dawidd6/action-debian-package@v1.6.0
with:
# Optional, relative to workspace directory
source_directory: .
# Optional, relative to workspace directory
artifacts_directory: output
# Optional, value from `debian/changelog` is used if not defined
os_distribution: jammy
os_distribution: noble
# Optional, target architecture, defaults to amd64
cpu_architecture: amd64
16 changes: 8 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
os: [macos-12, macos-13, ubuntu-20.04, ubuntu-22.04]
os: [macos-13, ubuntu-22.04, ubuntu-24.04]

steps:
- uses: actions/checkout@v4
Expand All @@ -35,8 +35,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install -qq gettext gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-gtksource-4 gir1.2-pango-1.0 gir1.2-webkit2-4.0 python3 python3-enchant python3-gi python3-yaml
python3 -m pip install setuptools tox
sudo apt-get -y install -qq gettext gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-gtksource-4 gir1.2-pango-1.0 gir1.2-webkit2-4.1 python3 python3-enchant python3-gi python3-setuptools python3-yaml tox
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
Expand All @@ -58,13 +57,14 @@ jobs:
HOMEBREW_NO_INSTALL_UPGRADE: on

- name: Check style
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
python3 -m tox -v -e style
tox -v -e style
- name: Run tests
if: matrix.os == 'ubuntu-22.04' # pip on macOS needs --break-system-packages
if: matrix.os == 'ubuntu-24.04' # pip on macOS needs --break-system-packages
run: |
python3 -c "import gi"
python3 -m tox -v -e py
python3 -m pip install .
tox -v -e py
python3 -m venv .venv
./.venv/bin/pip install .
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files

# Static analysis for Python code
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
# E203: whitespace before ':' (not compliant with PEP 8)
Expand All @@ -21,29 +21,29 @@ repos:

# Python code formatter
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black
exclude: ^rednotebook/external/

# Imports sorter
- repo: https://github.com/pycqa/isort
rev: 5.11.5
rev: 5.13.2
hooks:
- id: isort
exclude: ^rednotebook/journal.py

# Upgrades Python code to a target version
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: ['--py36-plus', '--exit-zero']
exclude: ^rednotebook/external/

# Finds unused Python code
- repo: https://github.com/jendrikseipp/vulture
rev: v2.7
rev: v2.12
hooks:
- id: vulture
exclude: ^rednotebook/external/
2 changes: 1 addition & 1 deletion rednotebook/gui/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def add_category(self, category):
self.categories.sort(key=utils.sort_asc)

def node_on_top_level(self, iter):
if type(iter) != Gtk.TreeIter:
if isinstance(iter, Gtk.TreeIter):
# iter is a path -> convert to iter
iter = self.tree_store.get_iter(iter)
assert self.tree_store.iter_is_valid(iter)
Expand Down
2 changes: 1 addition & 1 deletion rednotebook/gui/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def insert(self, text, iter=None, overwrite=False, undoing=False):
if iter is None:
self.day_text_buffer.insert_at_cursor(text)
else:
if type(iter) == Gtk.TextMark:
if isinstance(iter, Gtk.TextMark):
iter = self.day_text_buffer.get_iter_at_mark(iter)
self.day_text_buffer.insert(iter, text)

Expand Down

0 comments on commit f0e05c5

Please sign in to comment.