Skip to content

Commit af5711c

Browse files
committed
move to src layout to fix coverage report
1 parent 9d8d241 commit af5711c

File tree

8 files changed

+19
-15
lines changed

8 files changed

+19
-15
lines changed

setup.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
if sys.version_info[:2] < (2, 7):
66
sys.exit('virtualenv requires Python 2.7 or higher.')
7-
87
try:
9-
from setuptools import setup
8+
from setuptools import setup, find_packages
109
from setuptools.command.test import test as TestCommand
1110

1211
class PyTest(TestCommand):
@@ -41,7 +40,7 @@ def run_tests(self):
4140
'have to use "python -m virtualenv ENV"')
4241
setup_params = {}
4342
else:
44-
script = 'scripts/virtualenv'
43+
script = 'src/scripts/virtualenv'
4544
setup_params = {'scripts': [script]}
4645

4746

@@ -50,9 +49,10 @@ def read_file(*paths):
5049
with open(os.path.join(here, *paths)) as f:
5150
return f.read()
5251

52+
5353
# Get long_description from index.rst:
54-
long_description = read_file('docs', 'index.rst')
55-
long_description = long_description.strip().split('split here', 1)[0]
54+
long_description_full = read_file('docs', 'index.rst')
55+
long_description = long_description_full.strip().split('split here', 1)[0]
5656
# Add release history
5757
changes = read_file('docs', 'changes.rst')
5858
# Only report last two releases for brevity
@@ -75,7 +75,7 @@ def read_file(*paths):
7575

7676

7777
def get_version():
78-
version_file = read_file('virtualenv.py')
78+
version_file = read_file(os.path.join('src', 'virtualenv.py'))
7979
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
8080
version_file, re.M)
8181
if version_match:
@@ -116,8 +116,9 @@ def get_version():
116116
maintainer_email='[email protected]',
117117
url='https://virtualenv.pypa.io/',
118118
license='MIT',
119+
package_dir={'': 'src'},
119120
py_modules=['virtualenv'],
120-
packages=['virtualenv_support'],
121+
packages=find_packages('src'),
121122
package_data={'virtualenv_support': ['*.whl']},
122123
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
123124
**setup_params)
File renamed without changes.
File renamed without changes.
File renamed without changes.

tox.ini

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,29 @@ deps = mock
1414
pytest-mock >= 1.10.0, <2
1515
pytest-timeout >= 1.3.0, <2
1616
commands = pytest {posargs:\
17-
--cov="virtualenv" \
17+
--cov=virtualenv \
1818
--cov-config="{toxinidir}/tox.ini" \
1919
--timeout=180 \
2020
--junitxml={env:JUNIT_XML_FILE:{toxworkdir}/.test.{envname}.xml} \
2121
. }
2222

23+
[testenv:.package]
24+
deps =
25+
2326
[coverage:run]
24-
branch = true
27+
branch = false
2528

2629
[coverage:report]
2730
skip_covered = True
2831
show_missing = True
2932

3033
[coverage:paths]
31-
source = virtualenv
32-
.tox/*/lib/python*/site-packages/virtualenv
33-
.tox/pypy*/site-packages/virtualenv
34-
.tox\*\Lib\site-packages\virtualenv
35-
*/virtualenv
36-
*\virtualenv
34+
source = src
35+
.tox/*/lib/python*/site-packages
36+
.tox/pypy*/site-packages
37+
.tox\*\Lib\site-packages
38+
*/virtualenv.py
39+
*\virtualenv.py
3740

3841
[testenv:coverage]
3942
description = [run locally after tests]: combine coverage data and create report;

0 commit comments

Comments
 (0)