From 9c7b0014ccc4229031813ddcc5f6790b59540df5 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Mon, 2 Jul 2018 15:47:58 +0300 Subject: [PATCH] Switch from setup.py to setup.cfg A bug is blocking setuptools from working with python2 [bug]. Work is on its way [pr]. Until that is fixed, package_dir should be defined in setup.py to preserve compatibility of the native str type. [bug]: https://github.com/pypa/setuptools/issues/1136 [pr]: https://github.com/pypa/setuptools/pull/1180 Signed-off-by: Ivan Kanakarakis --- VERSION | 1 + setup.cfg | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 77 ++++------------------------------------- 3 files changed, 109 insertions(+), 71 deletions(-) create mode 100644 VERSION create mode 100644 setup.cfg diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..a84947d6f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.5.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..82b6ed89b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,102 @@ +[metadata] +name = pysaml2 +version = file:VERSION +author = IdentityPython +author-email = discuss@idpy.org +maintainer = IdentityPython +maintainer-email = discuss@idpy.org +license = Apache License Version 2.0 +license-file = LICENSE +description = Python implementation of SAML Version 2 Standard +long-description = file:README.rst +long_description_content_type = text/x-rst; charset=UTF-8 +home-page = https://idpy.org +project_urls = + Bug Tracker = https://github.com/IdentityPython/pysaml2/issues + Documentation = https://pysaml2.readthedocs.io + Source Code = https://github.com/IdentityPython/pysaml2 +classifier = + Development Status :: 4 - Beta + License :: OSI Approved :: Apache Software License + Topic :: Software Development :: Libraries :: Python Modules + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 +requires-dist = setuptools +keywords = + saml + saml2 + standard + federation + idpy + IdentityPython + + +[options] +zip_safe = False +include_package_data = True +package_dir = + = src +packages = find: +scripts = + tools/make_metadata.py + tools/mdexport.py + tools/merge_metadata.py + tools/parse_xsd2.py +install_requires = + cryptography + defusedxml + future + pyOpenSSL + python-dateutil + pytz + requests >= 1.0.0 + six + + +[options.packages.find] +where = src +include = + saml2 + saml2.* + + +[options.package_data] +* = + *.xml + + +[options.extras_require] +s2repoze = + paste + zope.interface + repoze.who + + +[bdist_wheel] +universal = 1 + + +[flake8] +author-attribute = forbidden +no-accept-encodings = True +assertive-snakecase = True +# assertive-test-pattern = +inline-quotes = ' +multiline-quotes = ''' +docstring-quotes = """ +application-import-names = saml2 + +hang_closing = false +doctests = false +max-complexity = 10 +exclude = + .git + __pycache__ + docs/source/conf.py + build + dist diff --git a/setup.py b/setup.py index 7d3865054..996b404f0 100755 --- a/setup.py +++ b/setup.py @@ -1,78 +1,13 @@ -"""Setup.py entry point for package.""" +"""Setup.py entry point for package. -import re +Configuration is handled by setuptools>30.3.0 through setup.cfg. +https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata +https://setuptools.readthedocs.io/en/latest/setuptools.html#options +""" import setuptools -version = '' -VERSION_REGEX = r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]' -with open('src/saml2/__init__.py', 'r') as fd: - content = fd.read() - version = re.search(VERSION_REGEX, content, re.MULTILINE).group(1) - setuptools.setup( - name='pysaml2', - version=version, - description='Python implementation of SAML Version 2 Standard', - license='Apache 2.0', - url='https://github.com/IdentityPython/pysaml2', - packages=[ - 'saml2', - 'saml2/attributemaps', - 'saml2/authn_context', - 'saml2/entity_category', - 'saml2/extension', - 'saml2/profile', - 'saml2/s2repoze', - 'saml2/s2repoze.plugins', - 'saml2/schema', - 'saml2/userinfo', - 'saml2/ws', - 'saml2/xmldsig', - 'saml2/xmlenc', - ], - package_dir={ - '': 'src', - }, - package_data={ - '': [ - 'xml/*.xml', - ], - }, - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: Apache Software License', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - ], - scripts=[ - 'tools/make_metadata.py', - 'tools/mdexport.py', - 'tools/merge_metadata.py', - 'tools/parse_xsd2.py', - ], - install_requires=[ - 'cryptography', - 'defusedxml', - 'future', 'pyOpenSSL', - 'python-dateutil', - 'pytz', - 'requests >= 1.0.0', - 'six', - ], - extras_require={ - 's2repoze': [ - 'paste', - 'zope.interface', - 'repoze.who', - ], - }, - zip_safe=False, + package_dir={'': 'src'}, )