diff --git a/Makefile b/Makefile index bb05749..9dfa649 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,11 @@ SHELL=/bin/sh TESTDIR=./gnupg/test TESTHANDLE=$(TESTDIR)/test_gnupg.py FILES=$(SHELL find ./gnupg/ -name "*.py" -printf "%p,") +PKG_NAME=python-gnupg +DOC_DIR=docs +DOC_BUILD_DIR:=$(DOC_DIR)/_build +DOC_HTML_DIR:=$(DOC_BUILD_DIR)/html +DOC_BUILD_ZIP:=$(PKG_NAME)-docs.zip .PHONY=all all: uninstall install test @@ -73,11 +78,15 @@ py3k-uninstall: uninstall reinstall: uninstall install py3k-reinstall: py3k-uninstall py3k-install -cleandocs: - sphinx-apidoc -F -A "Isis Agora Lovecruft" -H "python-gnupg" \ - -o docs gnupg/ tests/ +docs-clean: + -rm -rf $(DOC_BUILD_DIR) -docs: - cd docs && \ - make clean && \ - make html +docs-completely-new: + sphinx-apidoc -F -A "Isis Agora Lovecruft" -H "python-gnupg" -o $(DOC_DIR) gnupg/ tests/ + +docs-html: + cd $(DOC_DIR) && make clean && make html + +docs-zipfile: docs-html + cd $(DOC_HTML_DIR) && { find . -name '*' | zip -@ -v ../$(DOC_BUILD_ZIP) ;}; + @echo "Built documentation in $(DOC_BUILD_DIR)/$(DOC_BUILD_ZIP)" diff --git a/docs/conf.py b/docs/conf.py index 049ed5a..248f450 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,6 +12,7 @@ # serve to show the default. import sys, os +import psutil # 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 diff --git a/setup.cfg b/setup.cfg index a906e65..fb18565 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,7 @@ [upload_docs] upload-dir = docs/_build/html +show-response = true +verbose = true [upload] sign = True diff --git a/setup.py b/setup.py index 5def919..3b4154d 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,10 @@ from __future__ import absolute_import from __future__ import print_function import setuptools +import os import versioneer + + versioneer.versionfile_source = 'gnupg/_version.py' versioneer.versionfile_build = 'gnupg/_version.py' versioneer.tag_prefix = '' @@ -34,6 +37,44 @@ __contact__ = 'isis@patternsinthevoid.net' __url__ = 'https://github.com/isislovecruft/python-gnupg' +def get_requirements(): + """Extract the list of requirements from our requirements.txt. + + :rtype: 2-tuple + :returns: Two lists, the first is a list of requirements in the form of + pkgname==version. The second is a list of URIs or VCS checkout strings + which specify the dependency links for obtaining a copy of the + requirement. + """ + requirements_file = os.path.join(os.getcwd(), 'requirements.txt') + requirements = [] + links=[] + try: + with open(requirements_file) as reqfile: + for line in reqfile.readlines(): + line = line.strip() + if line.startswith('#'): + continue + elif line.startswith( + ('https://', 'git://', 'hg://', 'svn://')): + links.append(line) + else: + requirements.append(line) + + except (IOError, OSError) as error: + print(error) + + return requirements, links + + +requires, deplinks = get_requirements() +print('Found requirements:') +[print('\t%s' % name) for name in requires] + +print('Found dependency links:') +[print('\t%s' % uri) for uri in deplinks] + + setuptools.setup( name = "gnupg", description="A Python wrapper for GnuPG", @@ -62,7 +103,8 @@ greater. scripts=['versioneer.py'], test_suite='gnupg.test.test_gnupg', - install_requires=['psutil>=0.5.1'], + install_requires=requires, + dependency_links=deplinks, extras_require={'docs': ["Sphinx>=1.1", "repoze.sphinx"]}, platforms="Linux, BSD, OSX, Windows",