Skip to content

Commit f520829

Browse files
committed
No need to put setup in if __name__==...
1 parent b32b4d0 commit f520829

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

setup.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
from setuptools import Extension, setup
2121

22+
# Allow config/verbosity to be set from cli
23+
# http://stackoverflow.com/a/4792601/5208670
2224
CONFIG = "Release" # Release or Debug
2325
VERBOSITY = "minimal" # quiet, minimal, normal, detailed, diagnostic
2426

@@ -346,52 +348,50 @@ def run(self):
346348

347349

348350
###############################################################################
349-
if __name__ == "__main__":
350-
setupdir = os.path.dirname(__file__)
351-
if setupdir:
352-
os.chdir(setupdir)
353-
354-
setup_requires = []
355-
interop_file = _get_interop_filename()
356-
if not os.path.exists(interop_file):
357-
setup_requires.append("pycparser")
358-
359-
setup(
360-
name="pythonnet",
361-
version="2.2.2",
362-
description=".Net and Mono integration for Python",
363-
url='https://pythonnet.github.io/',
364-
license='MIT',
365-
author="The Python for .Net developers",
366-
classifiers=[
367-
'Development Status :: 5 - Production/Stable',
368-
'Intended Audience :: Developers',
369-
'License :: OSI Approved :: MIT License',
370-
'Programming Language :: C#',
371-
'Programming Language :: Python :: 2',
372-
'Programming Language :: Python :: 2.7',
373-
'Programming Language :: Python :: 3',
374-
'Programming Language :: Python :: 3.3',
375-
'Programming Language :: Python :: 3.4',
376-
'Programming Language :: Python :: 3.5',
377-
'Programming Language :: Python :: 3.6',
378-
'Operating System :: Microsoft :: Windows',
379-
'Operating System :: POSIX :: Linux',
380-
'Operating System :: MacOS :: MacOS X',
381-
],
382-
ext_modules=[
383-
Extension("clr", sources=list(_get_source_files()))
384-
],
385-
data_files=[
386-
("{install_platlib}", [
387-
"{build_lib}/Python.Runtime.dll",
388-
"Python.Runtime.dll.config"]),
389-
],
390-
zip_safe=False,
391-
cmdclass={
392-
"build_ext": BuildExtPythonnet,
393-
"install_lib": InstallLibPythonnet,
394-
"install_data": InstallDataPythonnet,
395-
},
396-
setup_requires=setup_requires,
397-
)
351+
setupdir = os.path.dirname(__file__)
352+
if setupdir:
353+
os.chdir(setupdir)
354+
355+
setup_requires = []
356+
if not os.path.exists(_get_interop_filename()):
357+
setup_requires.append("pycparser")
358+
359+
setup(
360+
name="pythonnet",
361+
version="2.2.2",
362+
description=".Net and Mono integration for Python",
363+
url='https://pythonnet.github.io/',
364+
license='MIT',
365+
author="The Python for .Net developers",
366+
setup_requires=setup_requires,
367+
ext_modules=[
368+
Extension("clr", sources=list(_get_source_files()))
369+
],
370+
data_files=[
371+
("{install_platlib}", [
372+
"{build_lib}/Python.Runtime.dll",
373+
"Python.Runtime.dll.config"]),
374+
],
375+
cmdclass={
376+
"build_ext": BuildExtPythonnet,
377+
"install_lib": InstallLibPythonnet,
378+
"install_data": InstallDataPythonnet,
379+
},
380+
classifiers=[
381+
'Development Status :: 5 - Production/Stable',
382+
'Intended Audience :: Developers',
383+
'License :: OSI Approved :: MIT License',
384+
'Programming Language :: C#',
385+
'Programming Language :: Python :: 2',
386+
'Programming Language :: Python :: 2.7',
387+
'Programming Language :: Python :: 3',
388+
'Programming Language :: Python :: 3.3',
389+
'Programming Language :: Python :: 3.4',
390+
'Programming Language :: Python :: 3.5',
391+
'Programming Language :: Python :: 3.6',
392+
'Operating System :: Microsoft :: Windows',
393+
'Operating System :: POSIX :: Linux',
394+
'Operating System :: MacOS :: MacOS X',
395+
],
396+
zip_safe=False,
397+
)

0 commit comments

Comments
 (0)