2022-06-30 22:32:10 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
def show_message(*lines):
|
|
|
|
print("=" * 74)
|
|
|
|
for line in lines:
|
|
|
|
print(line)
|
|
|
|
print("=" * 74)
|
2021-08-31 22:09:36 +00:00
|
|
|
|
2021-12-30 21:57:40 +00:00
|
|
|
with open('README.md', 'rt', encoding="utf8") as f:
|
2021-12-19 14:50:40 +00:00
|
|
|
readme = f.read()
|
2020-02-29 17:17:00 +00:00
|
|
|
|
2022-06-30 22:32:10 +00:00
|
|
|
setup_args = {
|
|
|
|
"name": "rapidfuzz",
|
2022-08-08 18:53:47 +00:00
|
|
|
"version": "2.4.3",
|
2022-07-19 09:00:35 +00:00
|
|
|
"install_requires": ["jarowinkler >= 1.2.0, < 2.0.0"],
|
2022-06-30 22:32:10 +00:00
|
|
|
"extras_require": {'full': ['numpy']},
|
|
|
|
"url": "https://github.com/maxbachmann/RapidFuzz",
|
|
|
|
"author": "Max Bachmann",
|
|
|
|
"author_email": "pypi@maxbachmann.de",
|
|
|
|
"description": "rapid fuzzy string matching",
|
|
|
|
"long_description": readme,
|
|
|
|
"long_description_content_type": "text/markdown",
|
|
|
|
|
|
|
|
"license": "MIT",
|
|
|
|
"classifiers": [
|
2021-12-19 14:50:40 +00:00
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"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",
|
|
|
|
"License :: OSI Approved :: MIT License"
|
|
|
|
],
|
2021-08-31 22:09:36 +00:00
|
|
|
|
2022-07-09 10:12:27 +00:00
|
|
|
"packages": ["rapidfuzz", "rapidfuzz.distance"],
|
2022-07-04 17:53:28 +00:00
|
|
|
"package_dir": {
|
2022-07-09 10:12:27 +00:00
|
|
|
'': 'src',
|
2022-07-04 17:53:28 +00:00
|
|
|
},
|
2022-06-30 22:32:10 +00:00
|
|
|
"package_data": {
|
2022-07-09 10:12:27 +00:00
|
|
|
"rapidfuzz": ["*.pyi", "py.typed"],
|
|
|
|
"rapidfuzz.distance": ["*.pyi"]
|
2022-03-06 17:57:34 +00:00
|
|
|
},
|
2022-06-30 22:32:10 +00:00
|
|
|
"python_requires": ">=3.6"
|
|
|
|
}
|
|
|
|
|
|
|
|
def run_setup(with_binary):
|
|
|
|
if with_binary:
|
|
|
|
from skbuild import setup
|
|
|
|
import rapidfuzz_capi
|
|
|
|
|
|
|
|
setup(
|
|
|
|
**setup_args,
|
|
|
|
cmake_args=[
|
2022-07-17 04:25:40 +00:00
|
|
|
f'-DRF_CAPI_PATH:STRING={rapidfuzz_capi.get_include()}'
|
2022-06-30 22:32:10 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
from setuptools import setup
|
|
|
|
setup(**setup_args)
|
2022-01-06 22:37:58 +00:00
|
|
|
|
2022-06-30 22:32:10 +00:00
|
|
|
# when packaging only build wheels which include the C extension
|
|
|
|
packaging = "1" in {
|
|
|
|
os.environ.get("CIBUILDWHEEL", "0"),
|
|
|
|
os.environ.get("CONDA_BUILD", "0"),
|
|
|
|
os.environ.get("RAPIDFUZZ_BUILD_EXTENSION", "0")
|
|
|
|
}
|
|
|
|
if packaging:
|
|
|
|
run_setup(True)
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
run_setup(True)
|
|
|
|
except:
|
|
|
|
show_message(
|
|
|
|
"WARNING: The C extension could not be compiled, speedups"
|
|
|
|
" are not enabled.",
|
|
|
|
"Failure information, if any, is above.",
|
|
|
|
"Retrying the build without the C extension now.",
|
|
|
|
)
|
|
|
|
run_setup(False)
|
|
|
|
show_message(
|
|
|
|
"WARNING: The C extension could not be compiled, speedups"
|
|
|
|
" are not enabled.",
|
|
|
|
"Plain-Python build succeeded.",
|
|
|
|
)
|