Skip to content

Commit 4a661d5

Browse files
committed
Adopt src layout
1 parent 894db99 commit 4a661d5

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ docs/_build/
5656
# Virtual Envs
5757
.env*
5858

59-
_pytest_mock_version.py
60-
6159
# IDE
6260
.idea
61+
/src/pytest_mock/_version.py

setup.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
from io import open
22

3-
from setuptools import setup
3+
from setuptools import setup, find_packages
44

55
setup(
66
name="pytest-mock",
77
entry_points={"pytest11": ["pytest_mock = pytest_mock"]},
8-
py_modules=["pytest_mock", "_pytest_mock_version"],
8+
packages=find_packages(where="src"),
9+
package_dir={"": "src"},
910
platforms="any",
1011
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
1112
install_requires=["pytest>=2.7", 'mock;python_version<"3.0"'],
12-
use_scm_version={"write_to": "_pytest_mock_version.py"},
13+
use_scm_version={"write_to": "src/pytest_mock/_version.py"},
1314
setup_requires=["setuptools_scm"],
1415
url="https://github.com/pytest-dev/pytest-mock/",
1516
license="MIT",

src/pytest_mock/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from pytest_mock.plugin import *
2+
from pytest_mock.plugin import _get_mock_module

pytest_mock.py renamed to src/pytest_mock/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from _pytest_mock_version import version
9+
from ._version import version
1010

1111
__version__ = version
1212

File renamed without changes.

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ passenv = USER USERNAME
66
deps =
77
coverage
88
commands =
9-
coverage run --append --source=pytest_mock.py -m pytest test_pytest_mock.py
9+
coverage run --append --source={envsitepackagesdir}/pytest_mock -m pytest tests
1010

1111
[testenv:norewrite]
1212
commands =
13-
pytest test_pytest_mock.py --assert=plain
13+
pytest tests --assert=plain
1414

1515
[testenv:linting]
1616
skipsdist = True

0 commit comments

Comments
 (0)