Skip to content

Commit d54b2f0

Browse files
committed
Remove Python 3.7, Add Python 3.13 and 3.14
* Update all dependencies * Remove any code that was specific to Python 3.7 and is no longer necessary * Fix some pyright lint issues in the test files
1 parent 5c4b915 commit d54b2f0

File tree

14 files changed

+54
-59
lines changed

14 files changed

+54
-59
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1313
with:
1414
fetch-depth: 0
1515

@@ -27,14 +27,17 @@ jobs:
2727
max-parallel: 4
2828
matrix:
2929
python-version:
30+
- "3.8"
31+
- "3.9"
3032
- "3.10"
3133
- "3.11"
3234
- "3.12"
33-
- "3.13-dev"
35+
- "3.13"
36+
- "3.14-dev"
3437
steps:
3538

3639
- name: Download pre-built packages
37-
uses: actions/download-artifact@v4
40+
uses: actions/download-artifact@v5
3841
with:
3942
name: Packages
4043
path: dist
@@ -43,10 +46,18 @@ jobs:
4346
- name: Remove source code
4447
run: rm -R emoji
4548
- name: Set up Python ${{ matrix.python-version }}
46-
uses: actions/setup-python@v5
49+
uses: actions/setup-python@v6
4750
with:
4851
python-version: ${{ matrix.python-version }}
49-
- name: Install tox
52+
- name: Install tox (for Python < 3.10)
53+
if: ${{ !(startsWith(matrix.python-version, '3.8') || startsWith(matrix.python-version, '3.9')) }}
5054
run: python -Im pip install tox
51-
- name: Run tox on wheel
52-
run: python -Im tox run --installpkg dist/*.whl
55+
- name: Run tox on wheel (for Python < 3.10)
56+
if: ${{ !(startsWith(matrix.python-version, '3.8') || startsWith(matrix.python-version, '3.9')) }}
57+
run: python -Im tox run --conf pyproject.toml --installpkg dist/*.whl
58+
- name: Install wheel
59+
run: python -Im pip install dist/*.whl
60+
- name: Install pytest
61+
run: python -Im pip install pytest
62+
- name: Test with pytest (if tox not used)
63+
run: python -Im pytest

.github/workflows/pypipublish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
id-token: write
1313
attestations: write
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
with:
1717
fetch-depth: 0
1818
- uses: hynek/build-and-inspect-python-package@v2
@@ -31,9 +31,9 @@ jobs:
3131
attestations: write
3232
steps:
3333
- name: Download package built by build-and-inspect-python-package
34-
uses: actions/download-artifact@v4
34+
uses: actions/download-artifact@v5
3535
with:
3636
name: Packages
3737
path: dist
3838
- name: Upload package to PyPI
39-
uses: pypa/gh-action-pypi-publish@v1.10.1
39+
uses: pypa/gh-action-pypi-publish@v1.13.0

.github/workflows/pythonTests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ on:
99
- 'gh-pages'
1010
jobs:
1111
pytest:
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
strategy:
1414
max-parallel: 8
1515
matrix:
1616
python-version:
17-
- "3.7"
1817
- "3.8"
1918
- "3.9"
2019
- "3.10"
2120
- "pypy-3.10"
2221
- "3.11"
2322
- "3.12"
24-
- "3.13-dev"
23+
- "3.13"
24+
- "3.14-dev"
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2727
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131
- name: Install dev dependencies
@@ -42,12 +42,12 @@ jobs:
4242
runs-on: ubuntu-latest
4343
strategy:
4444
matrix:
45-
python-version: ["3.13-dev"]
45+
python-version: ["3.13"]
4646

4747
steps:
48-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v5
4949
- name: Set up Python ${{ matrix.python-version }}
50-
uses: actions/setup-python@v5
50+
uses: actions/setup-python@v6
5151
with:
5252
python-version: ${{ matrix.python-version }}
5353

.github/workflows/updateGithubPages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
generateGHPages:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1313
- name: Set up Python
14-
uses: actions/setup-python@v5
14+
uses: actions/setup-python@v6
1515
with:
16-
python-version: '3.12'
16+
python-version: '3.13'
1717
- name: Install package
1818
run: |
1919
python -m pip install --upgrade pip setuptools

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ emoji
1818

1919
Release v\ |version|. (:ref:`Installation <install>`)
2020

21-
emoji supports Python 3.7+. The last version to support Python 2.7 and 3.5 was v2.4.0.
21+
emoji supports Python 3.8+. The last version to support Python 2.7 and 3.5 was v2.4.0.
2222

2323
.. contents:: Table of Contents
2424

emoji/core.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88

99
import re
1010
import unicodedata
11-
import sys
12-
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
13-
14-
if sys.version_info < (3, 9):
15-
from typing_extensions import Literal, Match, TypedDict # type: ignore
16-
else:
17-
from typing import Literal, Match, TypedDict
11+
from typing import Any, Callable, Dict, Iterator, List, Literal, Match, Optional, Tuple, TypedDict, Union
1812

1913
from emoji import unicode_codes
2014
from emoji.tokenizer import (

emoji/unicode_codes/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from functools import lru_cache
55
from warnings import warn
66

7-
from typing import Any, BinaryIO, Dict, Optional, Set
7+
from typing import IO, Any, Dict, Optional, Set
88

99
from emoji.unicode_codes.data_dict import STATUS, LANGUAGES
1010

@@ -76,7 +76,7 @@ def __missing__(self, key: str) -> str:
7676
EMOJI_DATA: Dict[str, Dict[str, Any]]
7777

7878

79-
def _open_file(name: str) -> BinaryIO:
79+
def _open_file(name: str) -> IO[bytes]:
8080
if sys.version_info >= (3, 9):
8181
return importlib.resources.files('emoji.unicode_codes').joinpath(name).open('rb')
8282
else:

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "emoji"
77
description = "Emoji for Python"
88
readme = "README.rst"
9-
requires-python = ">=3.7"
9+
requires-python = ">=3.8"
1010
authors = [
1111
{ name = "Taehoon Kim", email = "[email protected]" },
1212
{ name = "Kevin Wurster", email = "[email protected]" },
@@ -19,13 +19,13 @@ classifiers = [
1919
"License :: OSI Approved :: BSD License",
2020
"Operating System :: OS Independent",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
2726
"Programming Language :: Python :: 3.12",
2827
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2929
"Programming Language :: Python :: Implementation :: CPython",
3030
"Programming Language :: Python :: Implementation :: PyPy",
3131
"Programming Language :: Python",
@@ -34,7 +34,6 @@ classifiers = [
3434
"Topic :: Software Development :: Libraries :: Python Modules",
3535
"Typing :: Typed",
3636
]
37-
dependencies = ["typing_extensions >= 4.7.0; python_version < '3.9'"]
3837
dynamic = ["version"]
3938

4039
[project.urls]
@@ -58,7 +57,7 @@ pythonpath = [".", "utils"]
5857
testpaths = ["tests"]
5958

6059
[tool.pyright]
61-
pythonVersion = "3.7"
60+
pythonVersion = "3.8"
6261
pythonPlatform = "All"
6362
typeCheckingMode = "strict"
6463
extraPaths = ["utils"]
@@ -90,7 +89,8 @@ ignore = ["Q000", "Q003"]
9089
[tool.tox]
9190
legacy_tox_ini = """
9291
[tox]
93-
minversion = 4.15.0
92+
minversion = 4.30.0
93+
9494
9595
[testenv]
9696
description = Run the tests with pytest

tests/test_core.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
import random
44
import re
5-
import sys
65

7-
from typing import Any, Callable, Dict, List, Tuple, Union
8-
if sys.version_info < (3, 9):
9-
from typing_extensions import Literal # type: ignore
10-
else:
11-
from typing import Literal
6+
from typing import Any, Callable, Dict, List, Literal, Tuple, Union
127
import pytest
13-
import emoji.unicode_codes
8+
9+
import emoji
10+
1411
from testutils import (
1512
ascii,
1613
normalize,

tests/test_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import Any, Dict, List
44
import pytest
5-
import emoji.unicode_codes
5+
import emoji
66
from testutils import all_language_packs
77

88

0 commit comments

Comments
 (0)