Skip to content

Commit

Permalink
Removing deprecated cruft from setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanDunfield committed Nov 26, 2024
1 parent 056faf5 commit 1c0acfc
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"""

no_wheel_message = """
You need to have wheel installed to pip_install snappy, e.g.,
You need to have wheel installed to install snappy, e.g.,
sudo python -m pip install "wheel"
Expand All @@ -51,10 +51,15 @@
except ImportError:
raise ImportError(no_setuptools_message)

try:
import wheel
except ImportError:
raise ImportError(no_wheel_message)

import os, platform, shutil, site, subprocess, sys, sysconfig, re
from os.path import getmtime, exists
from distutils.ccompiler import get_default_compiler
from glob import glob
import importlib.metadata

if sys.platform == 'darwin':
# On macOS, the C and C++ code generated by Cython produces lots of these.
Expand All @@ -76,7 +81,6 @@

from setuptools.extension import Extension
from setuptools import setup, Command
from pkg_resources import load_entry_point

# A real clean

Expand Down Expand Up @@ -124,7 +128,8 @@ def run(self):
import sphinx_rtd_theme
except ImportError:
raise ImportError(no_sphinx_theme_message)
sphinx_cmd = load_entry_point('sphinx>=1.7', 'console_scripts', 'sphinx-build')
sphinx_dist = importlib.metadata.Distribution.from_name('sphinx')
sphinx_cmd = sphinx_dist.entry_points['sphinx-build'].load()
sphinx_args = ['-a', '-E', '-d', 'doc_src/_build/doctrees',
'doc_src', 'python/doc']
sys.path.insert(0, build_lib_dir())
Expand Down Expand Up @@ -367,12 +372,13 @@ def add(self, source_file, dependency_mod_time=0.0):
for hp_file in hp_qd_code:
hp_snappy_ext_files.add(hp_file)

# The compiler we will be using
# For Windows, check the compiler we will be using.

cc = get_default_compiler()
for arg in sys.argv:
if arg.startswith('--compiler='):
cc = arg.split('=')[1]
if sys.platform == 'win32':
cc = 'msvc'
for arg in sys.argv:
if arg.startswith('--compiler='):
cc = arg.split('=')[1]

# The SnapPy extension
snappy_extra_compile_args = []
Expand Down

0 comments on commit 1c0acfc

Please sign in to comment.