diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2018-07-06 20:55:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 20:55:04 +0300 |
commit | c3d2f15c97b8d74a19a7f52402f7ec633acfb008 (patch) | |
tree | 549642eb912677e8639d49f384e6b8a31c02c9cf | |
parent | cd48afe689b0f90ffa203490b19ea022d1e44a6d (diff) | |
parent | bf723307f609ca12260c4429dcb013101d95c2cf (diff) | |
download | pysaml2-c3d2f15c97b8d74a19a7f52402f7ec633acfb008.tar.gz |
Merge pull request #516 from c00kiemon5ter/feature-tidy-metadata
Tidy metadata and project files
-rw-r--r-- | .bzrignore | 12 | ||||
-rw-r--r-- | .editorconfig | 24 | ||||
-rw-r--r-- | .github/issue_template.md (renamed from issue_template.md) | 0 | ||||
-rw-r--r-- | .github/pull_request_template.md (renamed from pull_request_template.md) | 0 | ||||
-rw-r--r-- | .gitignore | 313 | ||||
-rw-r--r-- | CHANGELOG.rst (renamed from CHANGES) | 3 | ||||
-rw-r--r-- | MANIFEST.in | 24 | ||||
-rw-r--r-- | README.rst | 35 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rwxr-xr-x | doc/make.sh | 5 | ||||
-rw-r--r-- | docs/Makefile (renamed from doc/Makefile) | 0 | ||||
-rw-r--r-- | docs/_static/ViewmeonGitHub.png (renamed from doc/_static/ViewmeonGitHub.png) | bin | 6160 -> 6160 bytes | |||
-rw-r--r-- | docs/conf.py (renamed from doc/conf.py) | 22 | ||||
-rw-r--r-- | docs/examples/idp.rst (renamed from doc/examples/idp.rst) | 0 | ||||
-rw-r--r-- | docs/examples/index.rst (renamed from doc/examples/index.rst) | 0 | ||||
-rw-r--r-- | docs/examples/sp.rst (renamed from doc/examples/sp.rst) | 0 | ||||
-rw-r--r-- | docs/howto/config.rst (renamed from doc/howto/config.rst) | 0 | ||||
-rw-r--r-- | docs/howto/index.rst (renamed from doc/howto/index.rst) | 0 | ||||
-rw-r--r-- | docs/index.rst (renamed from doc/index.rst) | 0 | ||||
-rw-r--r-- | docs/install.rst (renamed from doc/install.rst) | 0 | ||||
-rw-r--r-- | docs/make.bat (renamed from doc/make.bat) | 0 | ||||
-rwxr-xr-x | docs/make.sh | 5 | ||||
-rw-r--r-- | docs/sp_test/internal.rst (renamed from doc/sp_test/internal.rst) | 0 | ||||
-rw-r--r-- | example/.gitignore | 9 | ||||
-rw-r--r-- | release-howto.rst | 46 | ||||
-rw-r--r-- | setup.cfg | 102 | ||||
-rwxr-xr-x | setup.py | 70 | ||||
-rw-r--r-- | src/saml2/__init__.py | 15 | ||||
-rw-r--r-- | src/saml2/version.py | 10 | ||||
-rw-r--r-- | work/test.txt | 0 |
31 files changed, 386 insertions, 313 deletions
diff --git a/.bzrignore b/.bzrignore deleted file mode 100644 index 212ca100..00000000 --- a/.bzrignore +++ /dev/null @@ -1,12 +0,0 @@ -.idea -build -python_saml2.egg-info -dist -.coverage -htmlcov -*.bak -*.dat -*.dir -*.log -*.egg-info -doc/_build diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c750e236 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +tab_width = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 79 + +[*.y{a,}ml] +indent_size = 2 +tab_width = 2 + +[*.html] +indent_style = tab + +[*.js] +indent_style = tab + +[*.css] +indent_style = tab diff --git a/issue_template.md b/.github/issue_template.md index 58967f57..58967f57 100644 --- a/issue_template.md +++ b/.github/issue_template.md diff --git a/pull_request_template.md b/.github/pull_request_template.md index 94be46df..94be46df 100644 --- a/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,205 +1,192 @@ -*.pyc -*.~ -\#* -.*~ -.eggs -*.egg -*.egg-info -example/*/*.log -example/*.db -example/*/*.db -tests/*.db -tests/*.log -build/ -dist/ -example/sp/identities -subject.db -.idea -.project -.pydevproject -.DS_store -.gitignore -debug_* -*.log -*.out -tmp* -*.tmp -*.log.* -*.db -*egg-info* -.coverage -*.tmpl -*.iml -_build/ -.cache -*.swp -.tox -env -bin/ -include/ -lib/ -local/ -pip-selfcheck.json - -example/idp3/htdocs/login.mako - -example/idp3/idp.py - -example/idp3/idp.xml - -example/idp3/idp_conf.py - -example/idp3/idp_err.xml - -example/idp3/idp_user.py - -example/idp3/metadata.xml - -example/idp3/modules/login.mako.py - -example/idp3/modules/root.mako.py - -example/idp3/pki/create_key.sh - -example/idp3/pki/mycert.pem - -example/idp3/pki/mykey.pem - -example/idp3/templates/root.mako - -example/sp2/attributemaps/basic.py - -example/sp2/attributemaps/saml_uri.py - -example/sp2/attributemaps/shibboleth_uri.py - -example/sp2/pki/mycert.pem - -example/sp2/pki/mykey.pem - -example/sp2/sp.py - -example/sp2/sp.xml +### Custom.gitignore -example/sp2/sp_conf.py +example/*/*.subject +example/*/*.xml +example/*/*_conf.py +example/*/modules/ -example/sp2/who.ini - -example/idp2/idp.xml - -example/idp2/idp_conf_test.py - -example/idp2/metadata.xml - -example/idp2/modules/login.mako.py - -example/idp2/modules/root.mako.py - -example/idp3/idp_conf_test.py - -update - -src/saml2/entity_category/swamid2.py - -example/idp2/IdpTestConf.py - -example/idp2/create_idp_conf.json - -example/idp2/create_idp_conf.py - -example/idp2/idpSaml2test.xml - -example/idp2/idp_conf.template - -example/idp2/idp_conf_saml2test.py - -example/sp/sp.xml - -example/idp2/idp_conf_local.py - -example/sp/sp_conf_local.py - -example/sp/my_backup_sp_conf_local.py - -example/sp/backup_sp_conf_local.py +tests/*.log.* +tests/*.db -example/idp2/pki/localhost.ca.crt +eptid -example/idp2/pki/localhost.ca.crt -example/idp2/pki/localhost.ca.key +### Python.gitignore +### https://github.com/github/gitignore/blob/master/Python.gitignore -example/idp2/pki/localhost.ca.key +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class -example/sp/pki/localhost.ca.crt +# C extensions +*.so -example/sp/pki/localhost.ca.crt +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# +# Usually these files are written by a python script from a template before +# PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ -example/sp/pki/localhost.ca.key +# Translations +*.mo +*.pot -example/sp/pki/localhost.ca.key +# Django stuff: +*.log +local_settings.py +db.sqlite3 -example/idp2/idp_conf_dirgweb.py +# Flask stuff: +instance/ +.webassets-cache -example/idp2/idp_conf_nocert.py +# Scrapy stuff: +.scrapy -example/idp2/idp_conf_proxy.py +# Sphinx documentation +docs/_build/ -example/idp2/idp_nocert.xml +# PyBuilder +target/ -example/sp/nocert_sp_conf/sp_nocert.xml +# Jupyter Notebook +.ipynb_checkpoints -example/sp/normal_sp_conf/sp.xml +# pyenv +.python-version -example/sp/normal_sp_conf/sp_conf.py +# celery beat schedule file +celerybeat-schedule -example/sp/normal_sp_conf/who.ini +# SageMath parsed files +*.sage.py -example/sp/sp_nocert.xml +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ -example/sp/sp_nocert2.xml +# Spyder project settings +.spyderproject +.spyproject -example/sp/test.py +# Rope project settings +.ropeproject -example/sp/sp_conf.py +# mkdocs documentation +/site -example/sp/nocert_sp_conf/sp.xml +# mypy +.mypy_cache/ -example/sp/nocert_sp_conf/sp_conf.py -example/sp/nocert_sp_conf/who.ini +### Linux.gitignore +### https://github.com/github/gitignore/blob/master/Global/Linux.gitignore -example/sp-repoze/my_sp.xml +*~ -example/sp-repoze/pki/localhost.ca.crt +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* -example/sp-repoze/pki/localhost.ca.key +# KDE directory preferences +.directory -example/sp-repoze/sp.xml +# Linux trash folder which might appear on any partition or disk +.Trash-* -example/sp-repoze/sp.xml +# .nfs files are created when an open file is removed but is still being accessed +.nfs* -example/sp-repoze/sp_conf.py -example/sp-repoze/sp_conf.py +### masOS.gitignore +### https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -example/idp2/sp_test.xml +# General +.DS_Store +.AppleDouble +.LSOverride -example/sp-repoze/idp_test.xml +# Icon must end with two \r +Icon -example/sp-repoze/sp_conf_example.py +# Thumbnails +._* -example/idp2/idp_conf_example.py +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent -example/idp2/lidp.xml +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk -example/idp2/old_idp.xml -example/sp-repoze/old_sp.xml +### Vim.gitignore +### https://github.com/github/gitignore/blob/master/Global/Vim.gitignore -example/sp-repoze/sp_conf_2.Pygmalion +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] -example/sp-repoze/sp_conf_2.py +# Session +Session.vim -sp.xml -tests/pki/qwerty.* +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ @@ -1,3 +1,6 @@ +Changelog +========= + 0.4.2 (2012-03-27) ------------------ - Add default attribute mappings diff --git a/MANIFEST.in b/MANIFEST.in index d2ebadc2..3d5b6477 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,17 @@ -include INSTALL -include LICENSE.txt -include README -include TODO -recursive-include tests * -recursive-include example * -recursive-include doc * +include VERSION +include LICENSE +include README.rst +include CHANGELOG.rst + +include src/saml2/xml_template/template.xml + +graft docs +prune docs/build + +prune tests +prune example +prune .github + +global-exclude *.py[cod] +global-exclude __pycache__ +global-exclude *.egg-info @@ -2,8 +2,7 @@ PySAML2 - SAML2 in Python ************************* -:Author: Roland Hedberg -:Version: 4.5.0 +:Version: see VERSION_ :Documentation: https://pysaml2.readthedocs.io/ .. image:: https://api.travis-ci.org/IdentityPython/pysaml2.png?branch=master @@ -15,27 +14,26 @@ PySAML2 - SAML2 in Python .. image:: https://img.shields.io/pypi/v/pysaml2.svg :target: https://pypi.org/project/pysaml2/ -.. image:: https://img.shields.io/pypi/dm/pysaml2.svg - :target: https://pypi.org/project/pysaml2/ +PySAML2 is a pure python implementation of SAML Version 2 Standard. It contains +all necessary pieces for building a SAML2 service provider or an identity +provider. The distribution contains examples of both. Originally written to +work in a WSGI environment there are extensions that allow you to use it with +other frameworks. -PySAML2 is a pure python implementation of SAML2. It contains all -necessary pieces for building a SAML2 service provider or an identity provider. -The distribution contains examples of both. -Originally written to work in a WSGI environment there are extensions that -allow you to use it with other frameworks. Testing ======= -PySAML2 uses the `pytest <http://doc.pytest.org/en/latest/>`_ framework for -testing. To run the tests on your system's version of python -1. Create and activate a `virtualenv <https://virtualenv.pypa.io/en/stable/>`_. -2. Inside the virtualenv, install the dependencies needed for testing :code:`pip install -r tests/test-requirements.txt` +PySAML2 uses the pytest_ framework for testing. To run the tests on your +system's version of python: + +1. Create and activate a virtualenv_ +2. Inside the virtualenv_, install the dependencies needed for testing + :code:`pip install -r tests/test-requirements.txt` 3. Run the tests :code:`py.test tests` -To run tests in multiple python environments, you can use -`pyenv <https://github.com/yyuu/pyenv>`_ with `tox <https://tox.readthedocs.io/en/latest/>`_. +To run tests in multiple python environments, you can use pyenv_ with tox_. Please contribute! @@ -48,3 +46,10 @@ To help out, you could: 3. Write more unit tests. **If you have the time and inclination I'm looking for Collaborators** + + +.. _VERSION: VERSION +.. _pytest: https://docs.pytest.org/en/latest/ +.. _virtualenv: https://virtualenv.pypa.io/en/stable/ +.. _pyenv: https://github.com/yyuu/pyenv +.. _tox: https://tox.readthedocs.io/en/latest/ @@ -1,3 +0,0 @@ -1. Write documentation. -2. Write unit tests for signature related utility methods. -3. Complete saml2 message class. diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..a84947d6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.5.0 diff --git a/doc/make.sh b/doc/make.sh deleted file mode 100755 index a2d7c6e6..00000000 --- a/doc/make.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -rm -f saml2* -sphinx-apidoc -F -o ../doc/ ../src/saml2 -make clean -make html
\ No newline at end of file diff --git a/doc/Makefile b/docs/Makefile index 462e0de6..462e0de6 100644 --- a/doc/Makefile +++ b/docs/Makefile diff --git a/doc/_static/ViewmeonGitHub.png b/docs/_static/ViewmeonGitHub.png Binary files differindex 44da44c9..44da44c9 100644 --- a/doc/_static/ViewmeonGitHub.png +++ b/docs/_static/ViewmeonGitHub.png diff --git a/doc/conf.py b/docs/conf.py index 6bb2bb81..71e81bba 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -11,9 +11,14 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +from __future__ import unicode_literals + +import os + import alabaster +import saml2.version + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -39,15 +44,15 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'pysaml2' -copyright = u'2010-2011, Roland Hedberg' +project = 'pysaml2' +copyright = '2010-2011, Roland Hedberg' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '' +version = str(saml2.version.version) # The full version, including alpha/beta/rc tags. release = '' @@ -180,8 +185,13 @@ htmlhelp_basename = 'pysaml2doc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'pysaml2.tex', u'pysaml2 Documentation', - u'Roland Hedberg', 'manual'), + ( + 'index', + 'pysaml2.tex', + 'pysaml2 Documentation', + 'Roland Hedberg', + 'manual', + ), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/doc/examples/idp.rst b/docs/examples/idp.rst index fcb636a6..fcb636a6 100644 --- a/doc/examples/idp.rst +++ b/docs/examples/idp.rst diff --git a/doc/examples/index.rst b/docs/examples/index.rst index 19c26a40..19c26a40 100644 --- a/doc/examples/index.rst +++ b/docs/examples/index.rst diff --git a/doc/examples/sp.rst b/docs/examples/sp.rst index 7d392257..7d392257 100644 --- a/doc/examples/sp.rst +++ b/docs/examples/sp.rst diff --git a/doc/howto/config.rst b/docs/howto/config.rst index c1691119..c1691119 100644 --- a/doc/howto/config.rst +++ b/docs/howto/config.rst diff --git a/doc/howto/index.rst b/docs/howto/index.rst index 52f2d409..52f2d409 100644 --- a/doc/howto/index.rst +++ b/docs/howto/index.rst diff --git a/doc/index.rst b/docs/index.rst index 4b596290..4b596290 100644 --- a/doc/index.rst +++ b/docs/index.rst diff --git a/doc/install.rst b/docs/install.rst index 58910e29..58910e29 100644 --- a/doc/install.rst +++ b/docs/install.rst diff --git a/doc/make.bat b/docs/make.bat index 4a006237..4a006237 100644 --- a/doc/make.bat +++ b/docs/make.bat diff --git a/docs/make.sh b/docs/make.sh new file mode 100755 index 00000000..65a507ed --- /dev/null +++ b/docs/make.sh @@ -0,0 +1,5 @@ +#!/bin/sh +rm -f saml2* +sphinx-apidoc -F -o ../docs/ ../src/saml2 +make clean +make html diff --git a/doc/sp_test/internal.rst b/docs/sp_test/internal.rst index 5875cdf1..5875cdf1 100644 --- a/doc/sp_test/internal.rst +++ b/docs/sp_test/internal.rst diff --git a/example/.gitignore b/example/.gitignore deleted file mode 100644 index 904fe3fc..00000000 --- a/example/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -idp/idp_conf.py -idp2/idp.subject -idp2/test_idp_conf.py -sp/outstanding -sp/sp_conf.py -server.crt -server.csr -server.key -server.key.org diff --git a/release-howto.rst b/release-howto.rst index b3cfb3b3..f6fa97a1 100644 --- a/release-howto.rst +++ b/release-howto.rst @@ -11,52 +11,44 @@ When releasing a new version, the following steps should be taken: 3. Make sure the package metadata in ``setup.py`` is up-to-date. You can verify the information by re-generating the egg info:: - python setup.py egg_info + python setup.py egg_info and inspecting ``src/pysaml2.egg-info/PKG-INFO``. You should also make sure that the long description renders as valid reStructuredText. You can do this by using the ``rst2html.py`` utility from docutils_:: - python setup.py --long-description | rst2html > test.html + python setup.py --long-description | rst2html > test.html If this will produce warning or errors, PyPI will be unable to render the long description nicely. It will treat it as plain text instead. -4. Update the version in the setup.py file and the doc conf.py file. Commit - these changes. +4. Update the version in the VERSION_ file and commit the change. -5. Create a release tag:: +5. Create a release tag_:: - bzr tag X.Y.Z + git tag -a vX.Y.Z -m "Release of version X.Y.Z" -6. Push these changes to Launchpad:: +6. Push these changes to Github:: - bzr push + git push origin vX.Y.Z 7. Create a source distribution and upload it to PyPI using the following command:: - python setup.py register sdist upload + python setup.py register sdist upload 8. Upload the documentation to PyPI. First you need to generate the html version of the documentation:: - cd doc - make clean - make html - cd _build/html - zip -r pysaml2-docs.zip * + cd docs/ + make clean + make html + cd _build/html + zip -r pysaml2-docs.zip * - now go to http://pypi.python.org/pypi?%3Aaction=pkg_edit&name=pysaml2 and - submit the pysaml2-docs.zip file in the form at the bottom of that page. + Submit the generated pysaml2-docs.zip file. -9. Create a new release at Launchpad. If no milestone was created for this - release in the past, create it now at https://launchpad.net/pysaml2/main - Then create a release for that milestone. You can copy the section of - the CHANGES file that matches this release in the appropiate field of - the Launchpad form. Finally, add a download file for that release. - -10. Send an email to the pysaml2 list announcing this release +9. Send an email to the pysaml2 list announcing this release **Important:** Once released to PyPI or any other public download location, @@ -64,6 +56,10 @@ a released egg may *never* be removed, even if it has proven to be a faulty release ("brown bag release"). In such a case it should simply be superseded immediately by a new, improved release. -.. _docutils: http://docutils.sourceforge.net/ -This document is based on http://svn.zope.org/*checkout*/Sandbox/philikon/foundation/releasing-software.txt +This document is based on zope release-software_ guidelines. + + +.. _docutils: http://docutils.sourceforge.net/ +.. _tag: https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags +.. _release-software: https://zopetoolkit.readthedocs.io/en/latest/process/releasing-software.html diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..82b6ed89 --- /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 = <fnmatch> +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 @@ -1,69 +1,13 @@ -#!/usr/bin/env python -import re +"""Setup.py entry point for package. -import sys +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 +""" -from setuptools import setup -from setuptools.command.test import test as TestCommand +import setuptools -install_requires = [ - # core dependencies - 'requests >= 1.0.0', - 'future', - 'cryptography', - 'pytz', - 'pyOpenSSL', - 'python-dateutil', - 'defusedxml', - 'six' -] - -extras_require = { - 's2repoze': [ - 'paste', - 'zope.interface', - 'repoze.who' - ] -} - -version = '' -with open('src/saml2/__init__.py', 'r') as fd: - version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', - fd.read(), re.MULTILINE).group(1) - -setup( - name='pysaml2', - version=version, - description='Python implementation of SAML Version 2', - # long_description = read("README"), - author='Roland Hedberg', - author_email='roland.hedberg@adm.umu.se', - license='Apache 2.0', - url='https://github.com/IdentityPython/pysaml2', - - packages=['saml2', 'saml2/xmldsig', 'saml2/xmlenc', 'saml2/s2repoze', - 'saml2/s2repoze.plugins', "saml2/profile", "saml2/schema", - "saml2/extension", "saml2/attributemaps", "saml2/authn_context", - "saml2/entity_category", "saml2/userinfo", "saml2/ws"], +setuptools.setup( 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/parse_xsd2.py", "tools/make_metadata.py", - "tools/mdexport.py", "tools/merge_metadata.py"], - install_requires=install_requires, - extras_require=extras_require, - zip_safe=False, ) diff --git a/src/saml2/__init__.py b/src/saml2/__init__.py index 3eb959fa..e8ae901f 100644 --- a/src/saml2/__init__.py +++ b/src/saml2/__init__.py @@ -17,10 +17,11 @@ provides methods and functions to convert SAML classes to and from strings. """ -__version__ = "4.5.0" - import logging + import six + +import saml2.version from saml2.validate import valid_instance try: @@ -38,6 +39,10 @@ except ImportError: from elementtree import ElementTree import defusedxml.ElementTree + +__version__ = str(saml2.version.version) + + root_logger = logging.getLogger(__name__) root_logger.level = logging.NOTSET @@ -1027,9 +1032,9 @@ def is_required_attribute(cls, attr): """ Check if the attribute is a required attribute for a specific SamlBase class. - - :param cls: The class - :param attr: An attribute, note it must be the name of the attribute + + :param cls: The class + :param attr: An attribute, note it must be the name of the attribute that appears in the XSD in which the class is defined. :return: True if required """ diff --git a/src/saml2/version.py b/src/saml2/version.py new file mode 100644 index 00000000..a3e43085 --- /dev/null +++ b/src/saml2/version.py @@ -0,0 +1,10 @@ +import pkg_resources as _pkg_resources + + +def _parse_version(): + data = _pkg_resources.get_distribution('pysaml2') + value = _pkg_resources.parse_version(data.version) + return value + + +version = _parse_version() diff --git a/work/test.txt b/work/test.txt deleted file mode 100644 index e69de29b..00000000 --- a/work/test.txt +++ /dev/null |