forked from pycurl/pycurl
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
639 lines (572 loc) · 24.7 KB
/
Copy pathsetup.py
File metadata and controls
639 lines (572 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
"""Setup script for the PycURL module distribution."""
PACKAGE="pycurl"
PY_PACKAGE="curl"
VERSION="7.19.5"
importglob, os, re, sys, string, subprocess
importdistutils
fromdistutils.coreimportsetup
fromdistutils.extensionimportExtension
fromdistutils.utilimportsplit_quoted
fromdistutils.versionimportLooseVersion
try:
# python 2
exception_base=StandardError
exceptNameError:
# python 3
exception_base=Exception
classConfigurationError(exception_base):
pass
deffail(msg):
sys.stderr.write(msg+"\n")
exit(10)
defscan_argv(s, default=None):
p=default
i=1
whilei<len(sys.argv):
arg=sys.argv[i]
ifstr.find(arg, s) ==0:
ifs.endswith('='):
# --option=value
p=arg[len(s):]
assertp, arg
else:
# --option
# set value to True
p=True
delsys.argv[i]
else:
i=i+1
##print sys.argv
returnp
classExtensionConfiguration(object):
def__init__(self):
self.include_dirs= []
self.define_macros= [("PYCURL_VERSION", '"%s"'%VERSION)]
self.library_dirs= []
self.libraries= []
self.runtime_library_dirs= []
self.extra_objects= []
self.extra_compile_args= []
self.extra_link_args= []
self.configure()
@property
defdefine_symbols(self):
return [symbolforsymbol, expansioninself.define_macros]
# append contents of an environment variable to library_dirs[]
defadd_libdirs(self, envvar, sep, fatal=False):
v=os.environ.get(envvar)
ifnotv:
return
fordirinstr.split(v, sep):
dir=str.strip(dir)
ifnotdir:
continue
dir=os.path.normpath(dir)
ifos.path.isdir(dir):
ifnotdirinlibrary_dirs:
self.library_dirs.append(dir)
eliffatal:
fail("FATAL: bad directory %s in environment variable %s"% (dir, envvar))
defconfigure_unix(self):
OPENSSL_DIR=scan_argv("--openssl-dir=")
ifOPENSSL_DIRisnotNone:
self.include_dirs.append(os.path.join(OPENSSL_DIR, "include"))
CURL_CONFIG=os.environ.get('PYCURL_CURL_CONFIG', "curl-config")
CURL_CONFIG=scan_argv("--curl-config=", CURL_CONFIG)
try:
p=subprocess.Popen((CURL_CONFIG, '--version'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
exceptOSError:
exc=sys.exc_info()[1]
msg='Could not run curl-config: %s'%str(exc)
raiseConfigurationError(msg)
stdout, stderr=p.communicate()
ifp.wait() !=0:
msg="`%s' not found -- please install the libcurl development files or specify --curl-config=/path/to/curl-config"%CURL_CONFIG
ifstderr:
msg+=":\n"+stderr.decode()
raiseConfigurationError(msg)
libcurl_version=stdout.decode().strip()
print("Using %s (%s)"% (CURL_CONFIG, libcurl_version))
p=subprocess.Popen((CURL_CONFIG, '--cflags'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr=p.communicate()
ifp.wait() !=0:
msg="Problem running `%s' --cflags"%CURL_CONFIG
ifstderr:
msg+=":\n"+stderr.decode()
raiseConfigurationError(msg)
forarginsplit_quoted(stdout.decode()):
ifarg[:2] =="-I":
# do not add /usr/include
ifnotre.search(r"^\/+usr\/+include\/*$", arg[2:]):
self.include_dirs.append(arg[2:])
else:
self.extra_compile_args.append(arg)
# Obtain linker flags/libraries to link against.
# In theory, all we should need is `curl-config --libs`.
# Apparently on some platforms --libs fails and --static-libs works,
# so try that.
# If --libs succeeds do not try --static-libs; see
# https://github.com/pycurl/pycurl/issues/52 for more details.
# If neither --libs nor --static-libs work, fail.
#
# --libs/--static-libs are also used for SSL detection.
# libcurl may be configured such that --libs only includes -lcurl
# without any of libcurl's dependent libraries, but the dependent
# libraries would be included in --static-libs (unless libcurl
# was built with static libraries disabled).
# Therefore we largely ignore (see below) --static-libs output for
# libraries and flags if --libs succeeded, but consult both outputs
# for hints as to which SSL library libcurl is linked against.
# More information: https://github.com/pycurl/pycurl/pull/147
#
# The final point is we should link agaist the SSL library in use
# even if libcurl does not tell us to, because *we* invoke functions
# in that SSL library. This means any SSL libraries found in
# --static-libs are forwarded to our libraries.
optbuf=''
sslhintbuf=''
errtext=''
foroptionin ["--libs", "--static-libs"]:
p=subprocess.Popen((CURL_CONFIG, option),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr=p.communicate()
ifp.wait() ==0:
ifoptbuf=='':
# first successful call
optbuf=stdout.decode()
# optbuf only has output from this call
sslhintbuf+=optbuf
else:
# second successful call
sslhintbuf+=stdout.decode()
else:
ifoptbuf=='':
# no successful call yet
errtext+=stderr.decode()
else:
# first call succeeded and second call failed
# ignore stderr and the error exit
pass
ifoptbuf=="":
msg="Neither curl-config --libs nor curl-config --static-libs"+\
" succeeded and produced output"
iferrtext:
msg+=":\n"+errtext
raiseConfigurationError(msg)
ssl_lib_detected=False
if'PYCURL_SSL_LIBRARY'inos.environ:
ssl_lib=os.environ['PYCURL_SSL_LIBRARY']
ifssl_libin ['openssl', 'gnutls', 'nss']:
ssl_lib_detected=True
self.define_macros.append(('HAVE_CURL_%s'%ssl_lib.upper(), 1))
else:
raiseConfigurationError('Invalid value "%s" for PYCURL_SSL_LIBRARY'%ssl_lib)
ssl_options= {
'--with-ssl': 'HAVE_CURL_OPENSSL',
'--with-gnutls': 'HAVE_CURL_GNUTLS',
'--with-nss': 'HAVE_CURL_NSS',
}
foroptioninssl_options:
ifscan_argv(option) isnotNone:
forother_optioninssl_options:
ifoption!=other_option:
ifscan_argv(other_option) isnotNone:
raiseConfigurationError('Cannot give both %s and %s'% (option, other_option))
ssl_lib_detected=True
self.define_macros.append((ssl_options[option], 1))
# libraries and options - all libraries and options are forwarded
# but if --libs succeeded, --static-libs output is ignored
forarginsplit_quoted(optbuf):
ifarg[:2] =="-l":
self.libraries.append(arg[2:])
elifarg[:2] =="-L":
self.library_dirs.append(arg[2:])
else:
self.extra_link_args.append(arg)
# ssl detection - ssl libraries are forwarded
forarginsplit_quoted(sslhintbuf):
ifarg[:2] =="-l":
ifnotssl_lib_detectedandarg[2:] =='ssl':
self.define_macros.append(('HAVE_CURL_OPENSSL', 1))
ssl_lib_detected=True
# the actual library that defines CRYPTO_num_locks etc.
# is crypto, and on cygwin linking against ssl does not
# link against crypto as of May 2014.
# http://stackoverflow.com/questions/23687488/cant-get-pycurl-to-install-on-cygwin-missing-openssl-symbols-crypto-num-locks
self.libraries.append('crypto')
ifnotssl_lib_detectedandarg[2:] =='gnutls':
self.define_macros.append(('HAVE_CURL_GNUTLS', 1))
ssl_lib_detected=True
self.libraries.append('gnutls')
ifnotssl_lib_detectedandarg[2:] =='ssl3':
self.define_macros.append(('HAVE_CURL_NSS', 1))
ssl_lib_detected=True
self.libraries.append('ssl3')
ifnotssl_lib_detected:
p=subprocess.Popen((CURL_CONFIG, '--features'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr=p.communicate()
ifp.wait() !=0:
msg="Problem running `%s' --features"%CURL_CONFIG
ifstderr:
msg+=":\n"+stderr.decode()
raiseConfigurationError(msg)
forfeatureinsplit_quoted(stdout.decode()):
iffeature=='SSL':
# this means any ssl library, not just openssl
self.define_macros.append(('HAVE_CURL_SSL', 1))
else:
# if we are configuring for a particular ssl library,
# we can assume that ssl is being used
self.define_macros.append(('HAVE_CURL_SSL', 1))
ifnotself.libraries:
self.libraries.append("curl")
# Add extra compile flag for MacOS X
ifsys.platform[:-1] =="darwin":
self.extra_link_args.append("-flat_namespace")
# Recognize --avoid-stdio on Unix so that it can be tested
self.check_avoid_stdio()
defconfigure_windows(self):
# Windows users have to pass --curl-dir parameter to specify path
# to libcurl, because there is no curl-config on windows at all.
curl_dir=scan_argv("--curl-dir=")
ifcurl_dirisNone:
fail("Please specify --curl-dir=/path/to/built/libcurl")
ifnotos.path.exists(curl_dir):
fail("Curl directory does not exist: %s"%curl_dir)
ifnotos.path.isdir(curl_dir):
fail("Curl directory is not a directory: %s"%curl_dir)
print("Using curl directory: %s"%curl_dir)
self.include_dirs.append(os.path.join(curl_dir, "include"))
# libcurl windows documentation states that for linking against libcurl
# dll, the import library name is libcurl_imp.lib.
# in practice, the library name sometimes is libcurl.lib.
# override with: --libcurl-lib-name=libcurl_imp.lib
curl_lib_name=scan_argv('--libcurl-lib-name=', 'libcurl.lib')
ifscan_argv("--use-libcurl-dll") isnotNone:
libcurl_lib_path=os.path.join(curl_dir, "lib", curl_lib_name)
self.extra_link_args.extend(["ws2_32.lib"])
ifstr.find(sys.version, "MSC") >=0:
# build a dll
self.extra_compile_args.append("-MD")
else:
self.extra_compile_args.append("-DCURL_STATICLIB")
libcurl_lib_path=os.path.join(curl_dir, "lib", curl_lib_name)
self.extra_link_args.extend(["gdi32.lib", "wldap32.lib", "winmm.lib", "ws2_32.lib",])
ifnotos.path.exists(libcurl_lib_path):
fail("libcurl.lib does not exist at %s.\nCurl directory must point to compiled libcurl (bin/include/lib subdirectories): %s"%(libcurl_lib_path, curl_dir))
self.extra_objects.append(libcurl_lib_path)
self.check_avoid_stdio()
# make pycurl binary work on windows xp.
# we use inet_ntop which was added in vista and implement a fallback.
# our implementation will not be compiled with _WIN32_WINNT targeting
# vista or above, thus said binary won't work on xp.
# http://curl.haxx.se/mail/curlpython-2013-12/0007.html
self.extra_compile_args.append("-D_WIN32_WINNT=0x0501")
ifstr.find(sys.version, "MSC") >=0:
self.extra_compile_args.append("-O2")
self.extra_compile_args.append("-GF") # enable read-only string pooling
self.extra_compile_args.append("-WX") # treat warnings as errors
p=subprocess.Popen(['cl.exe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err=p.communicate()
match=re.search(r'Version (\d+)', err.decode().split("\n")[0])
ifmatchandint(match.group(1)) <16:
# option removed in vs 2010:
# connect.microsoft.com/VisualStudio/feedback/details/475896/link-fatal-error-lnk1117-syntax-error-in-option-opt-nowin98/
self.extra_link_args.append("/opt:nowin98") # use small section alignment
ifsys.platform=="win32":
configure=configure_windows
else:
configure=configure_unix
defcheck_avoid_stdio(self):
if'PYCURL_SETUP_OPTIONS'inos.environand'--avoid-stdio'inos.environ['PYCURL_SETUP_OPTIONS']:
self.extra_compile_args.append("-DPYCURL_AVOID_STDIO")
ifscan_argv('--avoid-stdio') isnotNone:
self.extra_compile_args.append("-DPYCURL_AVOID_STDIO")
defget_bdist_msi_version_hack():
# workaround for distutils/msi version requirement per
# epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html -
# only x.y.z version numbers are supported, whereas our versions might be x.y.z.p.
# bugs.python.org/issue6040#msg133094
fromdistutils.command.bdist_msiimportbdist_msi
importinspect
importtypes
importre
classbdist_msi_version_hack(bdist_msi):
""" MSI builder requires version to be in the x.x.x format """
defrun(self):
defmonkey_get_version(self):
""" monkey patch replacement for metadata.get_version() that
returns MSI compatible version string for bdist_msi
"""
# get filename of the calling function
ifinspect.stack()[1][1].endswith('bdist_msi.py'):
# strip revision from version (if any), e.g. 11.0.0-r31546
match=re.match(r'(\d+\.\d+\.\d+)', self.version)
assertmatch
returnmatch.group(1)
else:
returnself.version
# monkeypatching get_version() call for DistributionMetadata
self.distribution.metadata.get_version= \
types.MethodType(monkey_get_version, self.distribution.metadata)
bdist_msi.run(self)
returnbdist_msi_version_hack
defstrip_pycurl_options():
ifsys.platform=='win32':
options= [
'--curl-dir=', '--curl-lib-name=', '--use-libcurl-dll',
'--avoid-stdio',
]
else:
options= ['--openssl-dir=', '--curl-config=', '--avoid-stdio']
foroptioninoptions:
scan_argv(option)
###############################################################################
defget_extension(split_extension_source=False):
ifsplit_extension_source:
sources= [
os.path.join("src", "docstrings.c"),
os.path.join("src", "easy.c"),
os.path.join("src", "module.c"),
os.path.join("src", "multi.c"),
os.path.join("src", "oscompat.c"),
os.path.join("src", "pythoncompat.c"),
os.path.join("src", "share.c"),
os.path.join("src", "stringcompat.c"),
os.path.join("src", "threadsupport.c"),
]
depends= [
os.path.join("src", "pycurl.h"),
]
else:
sources= [
os.path.join("src", "allpycurl.c"),
]
depends= []
ext_config=ExtensionConfiguration()
ext=Extension(
name=PACKAGE,
sources=sources,
depends=depends,
include_dirs=ext_config.include_dirs,
define_macros=ext_config.define_macros,
library_dirs=ext_config.library_dirs,
libraries=ext_config.libraries,
runtime_library_dirs=ext_config.runtime_library_dirs,
extra_objects=ext_config.extra_objects,
extra_compile_args=ext_config.extra_compile_args,
extra_link_args=ext_config.extra_link_args,
)
##print(ext.__dict__); sys.exit(1)
returnext
###############################################################################
# prepare data_files
defget_data_files():
# a list of tuples with (path to install to, a list of local files)
data_files= []
ifsys.platform=="win32":
datadir=os.path.join("doc", PACKAGE)
else:
datadir=os.path.join("share", "doc", PACKAGE)
#
files= ["AUTHORS", "ChangeLog", "COPYING-LGPL", "COPYING-MIT",
"INSTALL.rst", "README.rst", "RELEASE-NOTES.rst"]
iffiles:
data_files.append((os.path.join(datadir), files))
files=glob.glob(os.path.join("examples", "*.py"))
iffiles:
data_files.append((os.path.join(datadir, "examples"), files))
files=glob.glob(os.path.join("examples", "quickstart", "*.py"))
iffiles:
data_files.append((os.path.join(datadir, "examples", "quickstart"), files))
#
assertdata_files
forinstall_dir, filesindata_files:
assertfiles
forfinfiles:
assertos.path.isfile(f), (f, install_dir)
returndata_files
###############################################################################
defcheck_manifest():
importfnmatch
f=open('MANIFEST.in')
globs= []
try:
forlineinf.readlines():
stripped=line.strip()
ifstripped==''orstripped.startswith('#'):
continue
assertstripped.startswith('include ')
glob=stripped[8:]
globs.append(glob)
finally:
f.close()
paths= []
start=os.path.abspath(os.path.dirname(__file__))
forroot, dirs, filesinos.walk(start):
if'.git'indirs:
dirs.remove('.git')
forfileinfiles:
iffile.endswith('.pyc'):
continue
rel=os.path.join(root, file)[len(start)+1:]
paths.append(rel)
forpathinpaths:
included=False
forglobinglobs:
iffnmatch.fnmatch(path, glob):
included=True
break
ifnotincluded:
print(path)
AUTHORS_PARAGRAPH=3
defcheck_authors():
f=open('AUTHORS')
try:
contents=f.read()
finally:
f.close()
paras=contents.split("\n\n")
authors_para=paras[AUTHORS_PARAGRAPH]
authors= [authorforauthorinauthors_para.strip().split("\n")]
log=subprocess.check_output(['git', 'log', '--format=%an (%ae)'])
forauthorinlog.strip().split("\n"):
author=author.replace('@', ' at ').replace('(', '<').replace(')', '>')
ifauthornotinauthors:
authors.append(author)
authors.sort()
paras[AUTHORS_PARAGRAPH] ="\n".join(authors)
f=open('AUTHORS', 'w')
try:
f.write("\n\n".join(paras))
finally:
f.close()
defconvert_docstrings():
docstrings= []
forentryinsorted(os.listdir('doc/docstrings')):
ifnotentry.endswith('.rst'):
continue
name=entry.replace('.rst', '')
f=open('doc/docstrings/%s'%entry)
try:
text=f.read().strip()
finally:
f.close()
docstrings.append((name, text))
f=open('src/docstrings.c', 'w')
try:
f.write("/* Generated file - do not edit. */\n")
# space to avoid having /* inside a C comment
f.write("/* See doc/docstrings/ *.rst. */\n\n")
f.write("#include \"pycurl.h\"\n\n")
forname, textindocstrings:
text=text.replace("\"", "\\\"").replace("\n", "\\n\\\n")
f.write("PYCURL_INTERNAL const char %s_doc[] = \"%s\";\n\n"% (name, text))
finally:
f.close()
f=open('src/docstrings.h', 'w')
try:
f.write("/* Generated file - do not edit. */\n")
# space to avoid having /* inside a C comment
f.write("/* See doc/docstrings/ *.rst. */\n\n")
forname, textindocstrings:
f.write("extern const char %s_doc[];\n"%name)
finally:
f.close()
defgen_docstrings_sources():
sources='DOCSTRINGS_SOURCES ='
forentryinsorted(os.listdir('doc/docstrings')):
ifentry.endswith('.rst'):
sources+=" \\\n\tdoc/docstrings/%s"%entry
print(sources)
###############################################################################
setup_args=dict(
name=PACKAGE,
version=VERSION,
description="PycURL -- cURL library module for Python",
author="Kjetil Jacobsen, Markus F.X.J. Oberhumer, Oleg Pudeyev",
author_email="kjetilja at gmail.com, markus at oberhumer.com, oleg at bsdpower.com",
maintainer="Oleg Pudeyev",
maintainer_email="oleg@bsdpower.com",
url="http://pycurl.sourceforge.net/",
download_url="http://pycurl.sourceforge.net/download/",
license="LGPL/MIT",
keywords=['curl', 'libcurl', 'urllib', 'wget', 'download', 'file transfer',
'http', 'www'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Internet :: File Transfer Protocol (FTP)',
'Topic :: Internet :: WWW/HTTP',
],
packages=[PY_PACKAGE],
package_dir={ PY_PACKAGE: os.path.join('python', 'curl') },
long_description="""
This module provides Python bindings for the cURL library.""",
)
ifsys.platform=="win32":
setup_args['cmdclass'] = {'bdist_msi': get_bdist_msi_version_hack()}
##print distutils.__version__
ifLooseVersion(distutils.__version__) >LooseVersion("1.0.1"):
setup_args["platforms"] ="All"
ifLooseVersion(distutils.__version__) <LooseVersion("1.0.3"):
setup_args["licence"] =setup_args["license"]
unix_help='''\
PycURL Unix options:
--curl-config=/path/to/curl-config use specified curl-config binary
--openssl-dir=/path/to/openssl/dir path to OpenSSL headers and libraries
--with-ssl libcurl is linked against OpenSSL
--with-gnutls libcurl is linked against GnuTLS
--with-nss libcurl is linked against NSS
'''
windows_help='''\
PycURL Windows options:
--curl-dir=/path/to/compiled/libcurl path to libcurl headers and libraries
--use-libcurl-dll link against libcurl DLL, if not given
link against libcurl statically
--libcurl-lib-name=libcurl_imp.lib override libcurl import library name
'''
if__name__=="__main__":
if'--help'insys.argvor'-h'insys.argv:
# unfortunately this help precedes distutils help
ifsys.platform=="win32":
print(windows_help)
else:
print(unix_help)
# invoke setup without configuring pycurl because
# configuration might fail, and we want to display help anyway.
# we need to remove our options because distutils complains about them
strip_pycurl_options()
setup(**setup_args)
eliflen(sys.argv) >1andsys.argv[1] =='manifest':
check_manifest()
eliflen(sys.argv) >1andsys.argv[1] =='docstrings':
convert_docstrings()
eliflen(sys.argv) >1andsys.argv[1] =='authors':
check_authors()
eliflen(sys.argv) >1andsys.argv[1] =='docstrings-sources':
gen_docstrings_sources()
else:
setup_args['data_files'] =get_data_files()
if'PYCURL_RELEASE'inos.environandos.environ['PYCURL_RELEASE'].lower() in ['1', 'yes', 'true']:
split_extension_source=False
else:
split_extension_source=True
ext=get_extension(split_extension_source=split_extension_source)
setup_args['ext_modules'] = [ext]
foroinext.extra_objects:
assertos.path.isfile(o), o
setup(**setup_args)