From 085aca6da92c6ab36e68e57d35a5ec8cf1185d3f Mon Sep 17 00:00:00 2001 From: Uche Ogbuji Date: Sun, 10 Nov 2019 21:13:06 -0700 Subject: [PATCH] 0.5.0 release prep --- pyreqs.txt | 6 --- setup.py | 112 +++++++++++++++++++++++++++-------------- test/py/test_memory.py | 6 +-- 3 files changed, 77 insertions(+), 47 deletions(-) delete mode 100644 pyreqs.txt diff --git a/pyreqs.txt b/pyreqs.txt deleted file mode 100644 index 05bd01d..0000000 --- a/pyreqs.txt +++ /dev/null @@ -1,6 +0,0 @@ -amara3-iri -amara3-xml -Markdown -#nose -#nose-testconfig -#jinja2 diff --git a/setup.py b/setup.py index bc8b1eb..fbbb431 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,59 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- +''' +Highly recommend installing using `pip install -U .` not `python setup.py install` + +Uses pkgutil-style namespace package (Working on figuring out PEP 420) + +Note: careful not to conflate install_requires with requirements.txt + +https://packaging.python.org/discussions/install-requires-vs-requirements/ + +Reluctantly use setuptools for now to get install_requires & long_description_content_type + +$ python -c "import amara3; import amara3.iri; import amara3.uxml; import amara3.uxml.version; print(amara3.uxml.version.version_info)" +('3', '0', '1') +''' + +import sys +from setuptools import setup, Extension +#from distutils.core import setup, Extension + +PROJECT_NAME = 'versa' +PROJECT_DESCRIPTION = "Versa model for Web resources and relationships. Think of it as an evolution of Resource Description Framework (RDF) that's at once simpler and more expressive." +PROJECT_LICENSE = 'License :: OSI Approved :: Apache Software License' +PROJECT_AUTHOR = 'Uche Ogbuji' +PROJECT_AUTHOR_EMAIL = 'uche@ogbuji.net' +PROJECT_URL = 'https://github.com/uogbuji/versa' +PACKAGE_DIR = {'versa': 'tools/py'} +PACKAGES = ['versa', 'versa.driver', 'versa.reader', 'versa.writer', 'versa.query', 'versa.pipeline', 'versa.contrib'] +SCRIPTS = [ + 'tools/exec/build_model_site', + 'tools/exec/parse_versa', + 'tools/exec/parse_versa_model', + 'tools/exec/atom2versa', + 'tools/exec/parse_rdfa', +] -from distutils.core import setup -#from lib import __version__ +CORE_REQUIREMENTS = [ + 'amara3.xml', + 'Markdown', +] + +# From http://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + #"Environment :: Other Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Internet :: WWW/HTTP", +] + +KEYWORDS=['web', 'data'] versionfile = 'tools/py/version.py' exec(compile(open(versionfile, "rb").read(), versionfile, 'exec'), globals(), locals()) @@ -16,41 +68,25 @@ ''' -try: - import pypandoc - long_description = pypandoc.convert('README.md', 'rst') -except (IOError, ImportError) as e: - #long_description = open('README.md').read() - long_description = LONGDESC +LONGDESC_CTYPE = 'text/markdown' setup( - name = "versa", - version = __version__, - description="Versa model for Web resources and relationships. Think of it as an evolution of Resource Description Framework (RDF) that's at once simpler and more expressive.", - author='Uche Ogbuji', - author_email='uche@ogbuji.net', - url='https://github.com/uogbuji/versa', - package_dir={'versa': 'tools/py'}, - packages=['versa', 'versa.driver', 'versa.reader', 'versa.writer', 'versa.query', 'versa.pipeline', 'versa.contrib'], - scripts=[ - 'tools/exec/build_model_site', - 'tools/exec/parse_versa', - 'tools/exec/parse_versa_model', - 'tools/exec/atom2versa', - 'tools/exec/parse_rdfa', - ], - keywords = ["web", "data"], - #scripts=['exec/exhibit_agg', 'exec/exhibit_lint'], - classifiers = [ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Development Status :: 3 - Alpha", - #"Environment :: Other Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Internet :: WWW/HTTP", - ], - long_description = long_description - ) + name=PROJECT_NAME, + version=__version__, + description=PROJECT_DESCRIPTION, + license=PROJECT_LICENSE, + author=PROJECT_AUTHOR, + author_email=PROJECT_AUTHOR_EMAIL, + #maintainer=PROJECT_MAINTAINER, + #maintainer_email=PROJECT_MAINTAINER_EMAIL, + url=PROJECT_URL, + package_dir=PACKAGE_DIR, + packages=PACKAGES, + scripts=SCRIPTS, + install_requires=CORE_REQUIREMENTS, + classifiers=CLASSIFIERS, + long_description=LONGDESC, + long_description_content_type=LONGDESC_CTYPE, + keywords=KEYWORDS, +) + diff --git a/test/py/test_memory.py b/test/py/test_memory.py index e234365..d63f0b0 100644 --- a/test/py/test_memory.py +++ b/test/py/test_memory.py @@ -8,14 +8,14 @@ import logging -from testconfig import config +#from testconfig import config from versa.driver import memory #If you do this you also need --nologcapture #Handle --tc=debug:y option -if config.get('debug', 'n').startswith('y'): - logging.basicConfig(level=logging.DEBUG) +#if config.get('debug', 'n').startswith('y'): +# logging.basicConfig(level=logging.DEBUG) def test_basics():