From bbd220e9a5ef73632a43fc433f40dc5030a54005 Mon Sep 17 00:00:00 2001 From: Jeremy Goh <30731072+thatlittleboy@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:07:03 +0800 Subject: [PATCH] feat: remove support for python 3.8 (#108) --- .github/workflows/tests.yml | 2 +- .pre-commit-config.yaml | 11 +++++------ LICENSE | 2 +- README.md | 2 +- lgtm_db/__init__.py | 6 +----- pyproject.toml | 5 +++-- setup.cfg | 3 +-- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e8de390..fcc05d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] experimental: [false] # include: # - python-version: "3.13-dev" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee517ac..c3afc0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ # pre-commit autoupdate repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files args: ["--maxkb=3000"] @@ -17,16 +17,15 @@ repos: - id: check-yaml - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.19.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/asottile/add-trailing-comma rev: v3.1.0 hooks: - id: add-trailing-comma - args: [--py36-plus] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 @@ -34,7 +33,7 @@ repos: - id: python-check-blanket-noqa - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.10.0 hooks: - id: black args: ["--config", "pyproject.toml"] @@ -51,7 +50,7 @@ repos: - id: isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.8.0 hooks: - id: ruff types: [python] diff --git a/LICENSE b/LICENSE index 841b7d6..5103dbe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Jeremy Goh +Copyright (c) 2022-2024 Jeremy Goh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 737441c..92b7367 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ View all the available images and gifs in the [gallery page](https://thatlittleb This project is just for personal use, so it is not published on PyPI. -Using [pipx](https://pypa.github.io/pipx/) (Python 3.8+ only) to install directly from github: +Using [pipx](https://pypa.github.io/pipx/) (Python 3.9+ only) to install directly from github: ```shell $ pipx install git+https://github.com/thatlittleboy/lgtm-db diff --git a/lgtm_db/__init__.py b/lgtm_db/__init__.py index 17a5816..bae24ab 100644 --- a/lgtm_db/__init__.py +++ b/lgtm_db/__init__.py @@ -1,6 +1,7 @@ import argparse import enum import sys +from importlib.resources import files from typing import Optional import markupsafe @@ -8,11 +9,6 @@ from .__version__ import __version__ from .loader import EmptyGifLoaderError, GifLoader -if sys.version_info >= (3, 9): - from importlib.resources import files -else: - from importlib_resources import files - @enum.unique class StringOutputFormat(str, enum.Enum): diff --git a/pyproject.toml b/pyproject.toml index a4e45d5..0c5b92f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,9 @@ use_parentheses = true [tool.ruff] line-length = 110 +force-exclude = true +target-version = "py39" +[tool.ruff.lint] select = [ # pycodestyle "E", @@ -51,8 +54,6 @@ select = [ "RET505", "RET506", "RET507", "RET508", ] ignore = ["E501", "F403"] -force-exclude = true -target-version = "py38" [build-system] requires = [ diff --git a/setup.cfg b/setup.cfg index 2bf7e98..070016c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,11 +12,10 @@ license_files = LICENSE [options] packages = find: include_package_data = True -python_requires = >=3.8 +python_requires = >=3.9 install_requires = markupsafe pyyaml - importlib_resources;python_version<"3.9" [options.entry_points] console_scripts =