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

Commit b062664

Browse files
committed
Merge pull request #176 from Lukasa/packaging-improvements
Packaging improvements
2 parents 941036b + 49bb0cc commit b062664

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include README.rst LICENSE CONTRIBUTORS.rst HISTORY.rst hyper/certs.pem tox.ini
2-
2+
recursive-include test *

setup.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
import itertools
43
import os
54
import re
65
import sys
76

8-
try:
9-
from setuptools import setup
10-
except ImportError:
11-
from distutils.core import setup
7+
from setuptools import setup
8+
from setuptools.command.test import test as TestCommand
9+
10+
11+
class PyTest(TestCommand):
12+
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
13+
14+
def initialize_options(self):
15+
TestCommand.initialize_options(self)
16+
self.pytest_args = ['test/']
17+
18+
def finalize_options(self):
19+
TestCommand.finalize_options(self)
20+
self.test_args = []
21+
self.test_suite = True
22+
23+
def run_tests(self):
24+
# import here, cause outside the eggs aren't loaded
25+
import pytest
26+
errno = pytest.main(self.pytest_args)
27+
sys.exit(errno)
28+
1229

1330
# Get the version
1431
version_regex = r'__version__ = ["\']([^"\']*)["\']'
@@ -83,6 +100,8 @@ def resolve_install_requires():
83100
'Programming Language :: Python :: Implementation :: CPython',
84101
],
85102
install_requires=resolve_install_requires(),
103+
tests_require=['pytest', 'requests', 'mock'],
104+
cmdclass={'test': PyTest},
86105
entry_points={
87106
'console_scripts': [
88107
'hyper = hyper.cli:main',

0 commit comments

Comments
 (0)