Skip to content

Commit

Permalink
Drop support for Python 3.8 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Aug 31, 2024
2 parents a4d368d + 4f5b26e commit 90fadde
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.6.3
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black

Expand All @@ -27,7 +27,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
rev: 0.29.2
hooks:
- id: check-github-workflows
- id: check-renovate
Expand All @@ -38,12 +38,12 @@ repos:
- id: actionlint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
rev: 2.2.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.19
hooks:
- id: validate-pyproject

Expand All @@ -52,8 +52,8 @@ repos:
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
34 changes: 17 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@ keywords = [
"search",
]
license = { text = "ISC" }
maintainers = [
{ name = "Hugo van Kemenade" },
]
authors = [
{ name = "Kenneth Reitz", email = "me@kennethreitz.org" },
]
requires-python = ">=3.8"
maintainers = [ { name = "Hugo van Kemenade" } ]
authors = [ { name = "Kenneth Reitz", email = "me@kennethreitz.org" } ]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
"Natural Language :: English",
"Programming Language :: Python",
"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 @@ -39,9 +34,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = [
"version",
]
dynamic = [ "version" ]
dependencies = [
"pyperclip; platform_system=='Windows'",
]
Expand Down Expand Up @@ -72,9 +65,11 @@ lint.select = [
"EM", # flake8-errmsg
"F", # pyflakes errors
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"PYI", # flake8-pyi
"RUF022", # unsorted-dunder-all
"RUF100", # unused noqa (yesqa)
Expand All @@ -88,12 +83,17 @@ lint.ignore = [
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]
lint.isort.known-first-party = [
"em_keyboard",
]
lint.isort.required-imports = [
"from __future__ import annotations",
]
lint.flake8-import-conventions.aliases.datetime = "dt"
lint.flake8-import-conventions.banned-from = [ "datetime" ]
lint.isort.known-first-party = [ "em_keyboard" ]
lint.isort.required-imports = [ "from __future__ import annotations" ]

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.pytest.ini_options]
filterwarnings = [
# Python <= 3.11
"ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning",
]
testpaths = [ "tests" ]
15 changes: 4 additions & 11 deletions src/em_keyboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,14 @@

__version__ = _version.__version__

try:
from importlib.resources import as_file, files

with as_file(files("em_keyboard").joinpath("emojis.json")) as em_json:
EMOJI_PATH = em_json
except ImportError:
from importlib.resources import path
from importlib.resources import as_file, files

with path("em_keyboard", "emojis.json") as em_json:
EMOJI_PATH = em_json
with as_file(files("em_keyboard").joinpath("emojis.json")) as em_json:
EMOJI_PATH = em_json

CUSTOM_EMOJI_PATH = os.path.join(os.path.expanduser("~/.emojis.json"))

# TODO Remove quotes when dropping Python 3.8
EmojiDict = "dict[str, list[str]]"
EmojiDict = dict[str, list[str]]


def parse_emojis(filename: str | os.PathLike[str] = EMOJI_PATH) -> EmojiDict:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires =
env_list =
cli
lint
py{py3, 313, 312, 311, 310, 39, 38}
py{py3, 313, 312, 311, 310, 39}

[testenv]
extras =
Expand Down

0 comments on commit 90fadde

Please sign in to comment.