Skip to content

Commit 3284406

Browse files
authored
Merge pull request #4 from studio3104/setuptools_scm
Adopt `setuptools_scm` for versioning by git tag
2 parents 418f9d5 + e7a6774 commit 3284406

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

pytest_chalice/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*
2+
3+
from pkg_resources import get_distribution, DistributionNotFound
4+
5+
6+
try:
7+
__version__ = get_distribution(__name__).version
8+
except DistributionNotFound:
9+
pass

pytest_chalice/fixtures.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import pytest
4+
5+
from .handlers import RequestHandler
6+
7+
8+
@pytest.fixture
9+
def client(app):
10+
yield RequestHandler(app)

pytest_chalice.py renamed to pytest_chalice/handlers.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
import pytest
4-
53
import json
64
from logging import getLogger
75
import re
@@ -88,8 +86,3 @@ def request(path, headers={}, body=''):
8886
return ResponseHandler(response)
8987

9088
return request
91-
92-
93-
@pytest.fixture
94-
def client(app):
95-
yield RequestHandler(app)

pytest_chalice/plugin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from .fixtures import client # noqa
4+
5+
6+
def pytest_configure(config):
7+
config.addinivalue_line(
8+
'markers',
9+
'app: A Chalice application object',
10+
)

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import os
55
import codecs
6-
from setuptools import setup
6+
from setuptools import find_packages, setup
77

88

99
def read(fname):
@@ -13,21 +13,26 @@ def read(fname):
1313

1414
setup(
1515
name='pytest-chalice',
16-
version='0.0.1',
16+
license='MIT',
17+
1718
author='Satoshi SUZUKI',
1819
author_email='[email protected]',
1920
maintainer='Satoshi SUZUKI',
2021
maintainer_email='[email protected]',
21-
license='MIT',
22+
2223
url='https://github.com/studio3104/pytest-chalice',
2324
description='A set of py.test fixtures for AWS Chalice',
2425
long_description=read('README.rst'),
25-
py_modules=['pytest_chalice'],
26+
packages=find_packages(exclude=['docs', 'tests']),
2627
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
2728
install_requires=[
2829
'chalice>=1.8.0',
2930
'pytest>=3.5.0',
3031
],
32+
33+
setup_requires=['setuptools_scm'],
34+
use_scm_version=True,
35+
3136
classifiers=[
3237
'Development Status :: 4 - Beta',
3338
'Framework :: Pytest',
@@ -46,9 +51,10 @@ def read(fname):
4651
'Operating System :: OS Independent',
4752
'License :: OSI Approved :: MIT License',
4853
],
54+
4955
entry_points={
5056
'pytest11': [
51-
'chalice = pytest_chalice',
57+
'chalice = pytest_chalice.plugin',
5258
],
5359
},
5460
)

0 commit comments

Comments
 (0)