Skip to content

Commit

Permalink
Support Python 3.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed May 3, 2024
1 parent 1b6fd0c commit bddd19b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout
Expand All @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
check_formatting: ['0']
extra_name: ['']
include:
Expand All @@ -49,6 +49,7 @@ jobs:
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
cache: pip
cache-dependency-path: test-requirements.txt
- name: Setup python (dev)
Expand All @@ -70,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

BLACK_VERSION=22.6.0
BLACK_VERSION=24.4.2

python -m pip install -U pip setuptools wheel

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
include_package_data=True,
packages=find_packages("src"),
package_dir={"": "src"},
install_requires=["tokenize_rt"],
install_requires=["tokenize_rt", "setuptools"],
keywords=["async"],
python_requires=">=3.7",
classifiers=[
Expand All @@ -27,10 +27,11 @@
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
2 changes: 1 addition & 1 deletion src/unasync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _unasync_file(self, filepath):
with open(filepath, "rb") as f:
encoding, _ = std_tokenize.detect_encoding(f.readline)

with open(filepath, "rt", encoding=encoding) as f:
with open(filepath, encoding=encoding) as f:
tokens = tokenize_rt.src_to_tokens(f.read())
tokens = self._unasync_tokens(tokens)
result = tokenize_rt.tokens_to_src(tokens)
Expand Down
5 changes: 5 additions & 0 deletions tests/data/async/fstring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
similarity_algo = f"""
if (dotProduct < 0) {{
return 1;
}}
"""
5 changes: 5 additions & 0 deletions tests/data/sync/fstring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
similarity_algo = f"""
if (dotProduct < 0) {
return 1;
}
"""

0 comments on commit bddd19b

Please sign in to comment.