mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
Use python-Levenshtein-wheels (#2393)
This removes the compiler detection logic in setup.py. python-Levenshtein-wheels includes pre-built wheels for virtually all operating systems and architectures we support. Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
23
setup.py
23
setup.py
@@ -1,8 +1,5 @@
|
||||
import distutils.ccompiler as ccompiler
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
from distutils.errors import CCompilerError, DistutilsPlatformError
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
install_requires = [
|
||||
@@ -18,7 +15,7 @@ install_requires = [
|
||||
"idna-ssl==1.1.0",
|
||||
"idna==2.8",
|
||||
"multidict==4.5.2",
|
||||
"python-levenshtein==0.12.0",
|
||||
"python-levenshtein-wheels==0.13.1",
|
||||
"pyyaml==3.13",
|
||||
"raven==6.10.0",
|
||||
"raven-aiohttp==0.7.0",
|
||||
@@ -67,19 +64,6 @@ extras_require = {
|
||||
python_requires = ">=3.7,<3.8"
|
||||
|
||||
|
||||
def check_compiler_available():
|
||||
m = ccompiler.new_compiler()
|
||||
|
||||
with tempfile.TemporaryDirectory() as tdir:
|
||||
with open(os.path.join(tdir, "dummy.c"), "w") as tfile:
|
||||
tfile.write("int main(int argc, char** argv) {return 0;}")
|
||||
try:
|
||||
m.compile([tfile.name], output_dir=tdir)
|
||||
except (CCompilerError, DistutilsPlatformError):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def get_version():
|
||||
with open("redbot/core/__init__.py") as f:
|
||||
version = re.search(
|
||||
@@ -89,11 +73,6 @@ def get_version():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not check_compiler_available():
|
||||
install_requires.remove(
|
||||
next(r for r in install_requires if r.lower().startswith("python-levenshtein"))
|
||||
)
|
||||
|
||||
setup(
|
||||
name="Red-DiscordBot",
|
||||
version=get_version(),
|
||||
|
||||
Reference in New Issue
Block a user