2022-06-30 22:32:10 +00:00
|
|
|
import os
|
|
|
|
|
2022-10-02 08:06:27 +00:00
|
|
|
|
2022-06-30 22:32:10 +00:00
|
|
|
def show_message(*lines):
|
|
|
|
print("=" * 74)
|
|
|
|
for line in lines:
|
|
|
|
print(line)
|
|
|
|
print("=" * 74)
|
2021-08-31 22:09:36 +00:00
|
|
|
|
2022-10-02 08:24:00 +00:00
|
|
|
|
|
|
|
with open("README.md", 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-11-05 22:15:44 +00:00
|
|
|
"version": "2.13.2",
|
2022-10-02 08:24:00 +00:00
|
|
|
"extras_require": {"full": ["numpy"]},
|
2022-06-30 22:32:10 +00:00
|
|
|
"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.7",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
2022-08-12 15:34:12 +00:00
|
|
|
"Programming Language :: Python :: 3.11",
|
2022-10-02 08:24:00 +00:00
|
|
|
"License :: OSI Approved :: MIT License",
|
2021-12-19 14:50:40 +00:00
|
|
|
],
|
2022-10-24 17:49:52 +00:00
|
|
|
"packages": ["rapidfuzz", "rapidfuzz.distance", "rapidfuzz.__pyinstaller"],
|
|
|
|
"entry_points": {
|
|
|
|
"pyinstaller40": [
|
|
|
|
"hook-dirs = rapidfuzz.__pyinstaller:get_hook_dirs",
|
|
|
|
"tests = rapidfuzz.__pyinstaller:get_PyInstaller_tests",
|
|
|
|
],
|
|
|
|
},
|
2022-07-04 17:53:28 +00:00
|
|
|
"package_dir": {
|
2022-10-02 08:24:00 +00:00
|
|
|
"": "src",
|
2022-07-04 17:53:28 +00:00
|
|
|
},
|
2022-06-30 22:32:10 +00:00
|
|
|
"package_data": {
|
2022-10-29 18:07:19 +00:00
|
|
|
"rapidfuzz": ["*.pyi", "py.typed", "__init__.pxd", "rapidfuzz.h"],
|
2022-10-02 08:24:00 +00:00
|
|
|
"rapidfuzz.distance": ["*.pyi"],
|
2022-03-06 17:57:34 +00:00
|
|
|
},
|
2022-10-06 19:32:12 +00:00
|
|
|
"python_requires": ">=3.7",
|
2022-06-30 22:32:10 +00:00
|
|
|
}
|
|
|
|
|
2022-10-02 08:24:00 +00:00
|
|
|
|
2022-06-30 22:32:10 +00:00
|
|
|
def run_setup(with_binary):
|
|
|
|
if with_binary:
|
2022-10-02 08:06:27 +00:00
|
|
|
from skbuild import setup
|
2022-06-30 22:32:10 +00:00
|
|
|
|
2022-10-29 18:07:19 +00:00
|
|
|
setup(**setup_args)
|
2022-06-30 22:32:10 +00:00
|
|
|
else:
|
|
|
|
from setuptools import setup
|
2022-10-02 08:24:00 +00:00
|
|
|
|
2022-06-30 22:32:10 +00:00
|
|
|
setup(**setup_args)
|
2022-01-06 22:37:58 +00:00
|
|
|
|
2022-10-02 08:24:00 +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"),
|
2022-10-23 23:48:05 +00:00
|
|
|
os.environ.get("PIWHEELS_BUILD", "0"),
|
2022-10-02 08:24:00 +00:00
|
|
|
os.environ.get("RAPIDFUZZ_BUILD_EXTENSION", "0"),
|
2022-06-30 22:32:10 +00:00
|
|
|
}
|
|
|
|
if packaging:
|
|
|
|
run_setup(True)
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
run_setup(True)
|
2022-10-06 20:59:04 +00:00
|
|
|
except BaseException:
|
2022-06-30 22:32:10 +00:00
|
|
|
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.",
|
|
|
|
)
|