Skip to content

Commit 5f372ba

Browse files
authored
PYTHON-4373 Move dependency declaration to setup.py (#1602)
1 parent 4470309 commit 5f372ba

File tree

2 files changed

+47
-44
lines changed

2 files changed

+47
-44
lines changed

pyproject.toml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pymongo"
7-
dynamic = ["version"]
7+
dynamic = ["version", "dependencies", "optional-dependencies"]
88
description = "Python driver for MongoDB <http://www.mongodb.org>"
99
readme = "README.md"
1010
license = {file="LICENSE"}
@@ -39,48 +39,6 @@ classifiers = [
3939
"Topic :: Database",
4040
"Typing :: Typed",
4141
]
42-
dependencies = [
43-
"dnspython>=1.16.0,<3.0.0",
44-
]
45-
46-
[project.optional-dependencies]
47-
aws = [
48-
"pymongo-auth-aws>=1.1.0,<2.0.0",
49-
]
50-
encryption = [
51-
"pymongo[aws]",
52-
"pymongocrypt>=1.6.0,<2.0.0",
53-
"certifi;os.name=='nt' or sys_platform=='darwin'",
54-
]
55-
gssapi = [
56-
"pykerberos;os.name!='nt'",
57-
"winkerberos>=0.5.0;os.name=='nt'"
58-
]
59-
# PyOpenSSL 17.0.0 introduced support for OCSP. 17.1.0 introduced
60-
# a related feature we need. 17.2.0 fixes a bug
61-
# in set_default_verify_paths we should really avoid.
62-
# service_identity 18.1.0 introduced support for IP addr matching.
63-
# Fallback to certifi on Windows if we can't load CA certs from the system
64-
# store and just use certifi on macOS.
65-
# https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.set_default_verify_paths
66-
ocsp = [
67-
"certifi;os.name=='nt' or sys_platform=='darwin'",
68-
"pyopenssl>=17.2.0",
69-
"requests<3.0.0",
70-
"cryptography>=2.5",
71-
"service_identity>=18.1.0",
72-
]
73-
snappy = [
74-
"python-snappy"
75-
]
76-
# PYTHON-3423 Removed in 4.3 but kept here to avoid pip warnings.
77-
srv = []
78-
tls = []
79-
# PYTHON-2133 Removed in 4.0 but kept here to avoid pip warnings.
80-
zstd = [
81-
"zstandard",
82-
]
83-
test = ["pytest>=7"]
8442

8543
[project.urls]
8644
Homepage = "https://www.mongodb.org"

setup.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,49 @@ def build_extension(self, ext):
136136
)
137137
ext_modules = []
138138

139-
setup(cmdclass={"build_ext": custom_build_ext}, ext_modules=ext_modules) # type:ignore
139+
140+
dependencies = [
141+
"dnspython>=1.16.0,<3.0.0",
142+
]
143+
144+
extras_require = dict(
145+
aws=[
146+
"pymongo-auth-aws>=1.1.0,<2.0.0",
147+
],
148+
encryption=[
149+
"pymongo[aws]",
150+
"pymongocrypt>=1.6.0,<2.0.0",
151+
"certifi;os.name=='nt' or sys_platform=='darwin'",
152+
],
153+
gssapi=["pykerberos;os.name!='nt'", "winkerberos>=0.5.0;os.name=='nt'"],
154+
# PyOpenSSL 17.0.0 introduced support for OCSP. 17.1.0 introduced
155+
# a related feature we need. 17.2.0 fixes a bug
156+
# in set_default_verify_paths we should really avoid.
157+
# service_identity 18.1.0 introduced support for IP addr matching.
158+
# Fallback to certifi on Windows if we can't load CA certs from the system
159+
# store and just use certifi on macOS.
160+
# https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.set_default_verify_paths
161+
ocsp=[
162+
"certifi;os.name=='nt' or sys_platform=='darwin'",
163+
"pyopenssl>=17.2.0",
164+
"requests<3.0.0",
165+
"cryptography>=2.5",
166+
"service_identity>=18.1.0",
167+
],
168+
snappy=["python-snappy"],
169+
# PYTHON-3423 Removed in 4.3 but kept here to avoid pip warnings.
170+
srv=[],
171+
tls=[],
172+
# PYTHON-2133 Removed in 4.0 but kept here to avoid pip warnings.
173+
zstd=[
174+
"zstandard",
175+
],
176+
test=["pytest>=7"],
177+
)
178+
179+
setup(
180+
cmdclass={"build_ext": custom_build_ext},
181+
install_requires=dependencies,
182+
extras_require=extras_require,
183+
ext_modules=ext_modules,
184+
) # type:ignore

0 commit comments

Comments
 (0)