From a7b66356e33ad568178a869475b281a4e8daddc5 Mon Sep 17 00:00:00 2001 From: Derek Kulinski Date: Tue, 1 May 2018 16:04:26 -0700 Subject: [PATCH] Packaging improvements. Improvements arount sdist and bdist_wheel generation. This change also allows to run tests by issuing `./setup.py test` --- .gitignore | 4 ++++ MANIFEST.in | 3 +++ setup.cfg | 3 +++ setup.py | 32 ++++++++++++++++++-------- {tests => test}/ox3rctest | 0 {tests => test}/test_client.py | 0 {tests => test}/test_clientfromfile.py | 0 7 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 MANIFEST.in mode change 100644 => 100755 setup.py rename {tests => test}/ox3rctest (100%) rename {tests => test}/test_client.py (100%) rename {tests => test}/test_clientfromfile.py (100%) diff --git a/.gitignore b/.gitignore index 28f5e4b..a60ad8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ +/.eggs/ +/build/ +/dist/ +/ox3apiclient.egg-info/ .ox3rc *.pyc diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5908b07 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include History.md +include LICENSE.txt +include test/ox3rctest diff --git a/setup.cfg b/setup.cfg index 12871ff..52f337b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ +[bdist_wheel] +universal=true + [metadata] description-file=README.md diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index b20fdce..aa2256d --- a/setup.py +++ b/setup.py @@ -2,22 +2,31 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages from os.path import dirname, join +import os import re +def read_file(name): + filename = join(dirname(__file__), name) + with open(filename) as fp: + return fp.read() + file_path = join(dirname(__file__), 'ox3apiclient', '__init__.py') version = re.search("__version__\s*=\s*['\"](.+)['\"]", open(file_path, 'r').read()).groups()[0] setup(name='ox3apiclient', - version=version, - author='OpenX API Team', - author_email='api@openx.com', - url='https://github.com/openx/OX3-Python-API-Client', - description='Client to connect to the OpenX Enterprise API.', - long_description='', - packages=find_packages(), - install_requires=['six','requests_oauthlib'], - classifiers=[ + version=version, + author='OpenX API Team', + author_email='api@openx.com', + url='https://github.com/openx/OX3-Python-API-Client', + license='BSD', + platforms=['POSIX'], + description='Client to connect to the OpenX Enterprise API.', + long_description=read_file('README.md'), + packages=find_packages(), + zip_safe=True, + install_requires=['six','requests_oauthlib'], + classifiers=[ 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Developers', @@ -32,4 +41,9 @@ 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules', ], + test_suite='nose.collector', + tests_require=[ + 'nose', + 'mock; python_version < "3.3"' + ] ) diff --git a/tests/ox3rctest b/test/ox3rctest similarity index 100% rename from tests/ox3rctest rename to test/ox3rctest diff --git a/tests/test_client.py b/test/test_client.py similarity index 100% rename from tests/test_client.py rename to test/test_client.py diff --git a/tests/test_clientfromfile.py b/test/test_clientfromfile.py similarity index 100% rename from tests/test_clientfromfile.py rename to test/test_clientfromfile.py