Skip to content

Commit 9268f55

Browse files
authored
Support Python 3.8 - 3.12 (#80)
1 parent 1b6fd0c commit 9268f55

File tree

7 files changed

+35
-29
lines changed

7 files changed

+35
-29
lines changed

.github/workflows/ci.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python: ['3.7', '3.8', '3.9', '3.10']
12+
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: Setup python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python }}
2121
cache: pip
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
37+
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
3838
check_formatting: ['0']
3939
extra_name: ['']
4040
include:
@@ -43,19 +43,14 @@ jobs:
4343
extra_name: ', check formatting'
4444
steps:
4545
- name: Checkout
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v4
4747
- name: Setup python
48-
uses: actions/setup-python@v2
49-
if: "!endsWith(matrix.python, '-dev')"
48+
uses: actions/setup-python@v5
5049
with:
5150
python-version: ${{ matrix.python }}
51+
allow-prereleases: true
5252
cache: pip
5353
cache-dependency-path: test-requirements.txt
54-
- name: Setup python (dev)
55-
uses: deadsnakes/[email protected]
56-
if: endsWith(matrix.python, '-dev')
57-
with:
58-
python-version: '${{ matrix.python }}'
5954
- name: Run tests
6055
run: ./ci.sh
6156
env:
@@ -70,12 +65,12 @@ jobs:
7065
strategy:
7166
fail-fast: false
7267
matrix:
73-
python: ['3.7', '3.8', '3.9', '3.10']
68+
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
7469
steps:
7570
- name: Checkout
76-
uses: actions/checkout@v2
71+
uses: actions/checkout@v4
7772
- name: Setup python
78-
uses: actions/setup-python@v2
73+
uses: actions/setup-python@v5
7974
with:
8075
python-version: ${{ matrix.python }}
8176
cache: pip

.readthedocs.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# https://docs.readthedocs.io/en/latest/yaml-config.html
2-
formats:
3-
- htmlzip
4-
- epub
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
57

6-
requirements_file: ci/rtd-requirements.txt
78

89
python:
9-
version: 3
10-
pip_install: True
10+
install:
11+
- requirements: ci/rtd-requirements.txt
12+
- path: .

ci.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -ex
44

5-
BLACK_VERSION=22.6.0
5+
BLACK_VERSION=24.4.2
66

77
python -m pip install -U pip setuptools wheel
88

@@ -55,6 +55,4 @@ fi
5555
# Actual tests
5656
pip install -Ur test-requirements.txt
5757

58-
pytest -W error -ra -v tests --cov --cov-config=.coveragerc
59-
60-
bash <(curl -s https://codecov.io/bash)
58+
pytest -W error -ra -v tests --cov --cov-config=.coveragerc --cov-fail-under=93

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
include_package_data=True,
1818
packages=find_packages("src"),
1919
package_dir={"": "src"},
20-
install_requires=["tokenize_rt"],
20+
install_requires=["tokenize_rt", "setuptools"],
2121
keywords=["async"],
2222
python_requires=">=3.7",
2323
classifiers=[
@@ -27,10 +27,11 @@
2727
"Operating System :: POSIX :: Linux",
2828
"Operating System :: MacOS :: MacOS X",
2929
"Operating System :: Microsoft :: Windows",
30-
"Programming Language :: Python :: 3.7",
3130
"Programming Language :: Python :: 3.8",
3231
"Programming Language :: Python :: 3.9",
3332
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
3435
"Programming Language :: Python :: Implementation :: CPython",
3536
"Programming Language :: Python :: Implementation :: PyPy",
3637
],

src/unasync/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def _unasync_file(self, filepath):
6767
with open(filepath, "rb") as f:
6868
encoding, _ = std_tokenize.detect_encoding(f.readline)
6969

70-
with open(filepath, "rt", encoding=encoding) as f:
70+
with open(filepath, encoding=encoding) as f:
7171
tokens = tokenize_rt.src_to_tokens(f.read())
7272
tokens = self._unasync_tokens(tokens)
7373
result = tokenize_rt.tokens_to_src(tokens)

tests/data/async/fstring.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
similarity_algo = f"""
2+
if (dotProduct < 0) {{
3+
return 1;
4+
}}
5+
"""

tests/data/sync/fstring.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
similarity_algo = f"""
2+
if (dotProduct < 0) {{
3+
return 1;
4+
}}
5+
"""

0 commit comments

Comments
 (0)