Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #176 from Lukasa/packaging-improvements
Browse files Browse the repository at this point in the history
Packaging improvements
  • Loading branch information
Lukasa committed Oct 29, 2015
2 parents 941036b + 49bb0cc commit b062664
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include README.rst LICENSE CONTRIBUTORS.rst HISTORY.rst hyper/certs.pem tox.ini

recursive-include test *
29 changes: 24 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import os
import re
import sys

try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools import setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ['test/']

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)


# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
Expand Down Expand Up @@ -83,6 +100,8 @@ def resolve_install_requires():
'Programming Language :: Python :: Implementation :: CPython',
],
install_requires=resolve_install_requires(),
tests_require=['pytest', 'requests', 'mock'],
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'hyper = hyper.cli:main',
Expand Down

0 comments on commit b062664

Please sign in to comment.