Skip to content

Commit 87904c3

Browse files
authored
Merge pull request certifi#43 from jakirkham/use_distutils_fallback
Use `distutils` if `setuptools` is missing
2 parents 51191b7 + e24bc21 commit 87904c3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
import os
66
import sys
77

8-
from setuptools import setup
8+
# While I generally consider it an antipattern to try and support both
9+
# setuptools and distutils with a single setup.py, in this specific instance
10+
# where certifi is a dependency of setuptools, it can create a circular
11+
# dependency when projects attempt to unbundle stuff from setuptools and pip.
12+
# Though we don't really support that, it makes things easier if we do this and
13+
# should hopefully cause less issues for end users.
14+
try:
15+
from setuptools import setup
16+
except ImportError:
17+
from distutils.core import setup
18+
919

1020
version_regex = r'__version__ = ["\']([^"\']*)["\']'
1121
with open('certifi/__init__.py', 'r') as f:

0 commit comments

Comments
 (0)