Skip to content

Commit 5dfb9d7

Browse files
authored
Merge pull request #67 from nicoddemus/setuptools_scm
Setuptools scm
2 parents 498cd51 + 2262df1 commit 5dfb9d7

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sdist/
2020
var/
2121
*.egg-info/
2222
.installed.cfg
23-
*.egg
23+
*.egg*
2424

2525
# Installer logs
2626
pip-log.txt
@@ -54,3 +54,5 @@ docs/_build/
5454

5555
# Virtual Envs
5656
.env*
57+
58+
_pytest_mock_version.py

.travis.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
language: python
22
python:
33
- "3.5"
4-
- "nightly"
4+
- "3.6-dev"
55

66
install:
77
- pip install tox coveralls
88

99
script:
10-
- if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then tox; fi
11-
- if [[ $TRAVIS_PYTHON_VERSION == nightly ]]; then tox -e py36-pytest28,py36-pytest29,py36-pytest30; fi
10+
- if [[ $TRAVIS_PYTHON_VERSION != 3.6-dev ]]; then tox; fi
11+
- if [[ $TRAVIS_PYTHON_VERSION == 3.6-dev ]]; then tox -e py36-pytest28,py36-pytest29,py36-pytest30; fi
1212

1313
after_success:
1414
- coveralls
15+
16+
deploy:
17+
provider: pypi
18+
user: nicoddemus
19+
password:
20+
secure: bB4adUZVIkt31cmNklskyIDNehujKToGnStnlunp7P8CBF6CGeNqkYU17emAPvfZbTb/ClUpiO9r6AD1ej32Uyr+I8qUyhuYtHG3JGp+WRR/tw+ytAZIJ9i+PMjBv1RAdyLENJ/Tx0LKHKsABr8dQIieLFqKZJuT77f/5ZkvI/U=
21+
on:
22+
tags: true
23+
distributions: sdist bdist_wheel
24+
repo: pytest-dev/pytest-mock
25+
condition: $TRAVIS_PYTHON_VERSION = 3.5

pytest_mock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
except ImportError:
88
import unittest.mock as mock_module
99

10-
version = '1.2'
10+
from _pytest_mock_version import version
11+
__version__ = version
1112

1213

1314
class MockFixture(object):

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22

33
from setuptools import setup
44

5-
with open('pytest_mock.py') as f:
6-
m = re.search("version = '(.*)'", f.read())
7-
assert m is not None
8-
version = m.group(1)
95

106
setup(
117
name='pytest-mock',
12-
version=version,
138
entry_points={
149
'pytest11': ['pytest_mock = pytest_mock'],
1510
},
16-
py_modules=['pytest_mock'],
11+
py_modules=['pytest_mock', '_pytest_mock_version'],
1712
platforms='any',
1813
install_requires=[
1914
'pytest>=2.7',
2015
],
2116
extras_require={
2217
':python_version=="2.6" or python_version=="2.7"': ['mock'],
2318
},
19+
use_scm_version={'write_to': '_pytest_mock_version.py'},
20+
setup_requires=['setuptools_scm'],
2421
url='https://github.com/pytest-dev/pytest-mock/',
2522
license='MIT',
2623
author='Bruno Oliveira',

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ deps =
88
pytest27: pytest~=2.7
99
pytest28: pytest~=2.8
1010
pytest29: pytest~=2.9
11-
# temporary until 3.0.3 is released
12-
pytest30: git+https://github.com/pytest-dev/pytest@master
11+
pytest30: pytest~=3.0
1312
commands =
1413
coverage run --append --source=pytest_mock.py -m pytest test_pytest_mock.py
1514

0 commit comments

Comments
 (0)