Skip to content

Commit

Permalink
add support for Python 3.9 and 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
taleinat committed Jul 27, 2022
1 parent cd9e252 commit 3071c79
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 245 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ matrix:
- python: "3.8"
env:
- TOXENV=py38-with_coverage
- python: "3.9"
env:
- TOXENV=py39-without_coverage
- python: "3.9"
env:
- TOXENV=py39-with_coverage
- python: "3.10"
env:
- TOXENV=py310-without_coverage
- python: "3.10"
env:
- TOXENV=py310-with_coverage
- python: "pypy"
env:
- TOXENV=pypy-without_coverage
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
History
-------

?.?.? (????-??-??)
++++++++++++++++++

* Added support for Python 3.9, 3.10 and 3.11.

0.7.3 (2020-06-27)
++++++++++++++++++

Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

===========
fuzzysearch
===========
Expand Down
15 changes: 14 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ environment:
- PYTHON: 'C:\Python38-x64'
TOX_ENV: 'py38'
PYTHON_APPDATA_DIR: 'C:\Users\appveyor\AppData\Roaming\Python\Python38'
- PYTHON: 'C:\Python39'
TOX_ENV: 'py39'
PYTHON_APPDATA_DIR: 'C:\Users\appveyor\AppData\Roaming\Python\Python39'
- PYTHON: 'C:\Python39-x64'
TOX_ENV: 'py39'
PYTHON_APPDATA_DIR: 'C:\Users\appveyor\AppData\Roaming\Python\Python39'
- PYTHON: 'C:\Python310'
TOX_ENV: 'py310'
PYTHON_APPDATA_DIR: 'C:\Users\appveyor\AppData\Roaming\Python\Python310'
- PYTHON: 'C:\Python310-x64'
TOX_ENV: 'py310'
PYTHON_APPDATA_DIR: 'C:\Users\appveyor\AppData\Roaming\Python\Python310'
# TODO: Also test with PyPy

install:
Expand All @@ -45,7 +57,8 @@ install:
# We need wheel installed to build wheels
- 'pip install --user wheel'

build: off
build_script:
- 'call' # Do nothing.

test_script:
- 'build.cmd tox -e %TOX_ENV%-without_coverage-appveyor -v'
Expand Down
23 changes: 16 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
import sys

from setuptools import setup, Extension
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
if sys.version_info < (3, 8):
from distutils.command.build_ext import build_ext
from distutils.errors import (
CCompilerError,
DistutilsExecError as ExecError,
DistutilsPlatformError as PlatformError,
)
else:
from setuptools.command.build_ext import build_ext
from setuptools.errors import CCompilerError, ExecError, PlatformError

# --noexts: don't try building the C extensions
if '--noexts' in sys.argv[1:]:
Expand All @@ -33,7 +40,7 @@ def readfile(file_path):
is_jython = 'java' in sys.platform
is_pypy = hasattr(sys, 'pypy_version_info')

ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
ext_errors = (CCompilerError, ExecError, PlatformError)
if sys.platform == 'win32' and sys.version_info > (2, 6):
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
Expand All @@ -51,7 +58,7 @@ class ve_build_ext(build_ext):
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
except PlatformError:
raise BuildFailed()

def build_extension(self, ext):
Expand Down Expand Up @@ -102,8 +109,8 @@ def run_setup(with_binary=True):
ext_modules = [
_substitutions_only_module,
_common_module,
_generic_search_module,
_levenshtein_ngrams_module,
# _generic_search_module,
# _levenshtein_ngrams_module,
# pymemmem_module,
]
if not with_binary:
Expand Down Expand Up @@ -135,6 +142,8 @@ def run_setup(with_binary=True):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand Down
Loading

0 comments on commit 3071c79

Please sign in to comment.