Skip to content

Commit 12b9119

Browse files
committed
Add 0.1
0 parents  commit 12b9119

File tree

6 files changed

+87
-0
lines changed

6 files changed

+87
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 John Vandenberg
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# coverage config reload plugin
2+
3+
Place as the last plugin to be loaded, this plugin will
4+
reloads the configuration files after other plugins have been loaded.

coverage_config_reload_plugin.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Coverage Config reload Plugin"""
2+
import sys
3+
4+
def get_coverage_config():
5+
"""Get coverage config from stack."""
6+
# Stack
7+
# 1. get_coverage_config (i.e. this function)
8+
# 2. coverage_init
9+
# 3. load_plugins
10+
frame = sys._getframe(2)
11+
config = frame.f_locals['config']
12+
return config
13+
14+
def read_config_files(config):
15+
config_filenames = config.config_files.copy()
16+
for filename in config_filenames:
17+
prefix = '' if filename == '.coveragerc' else 'coverage:'
18+
config.from_file(filename, section_prefix=prefix)
19+
20+
# restore original as from_file appends to the config_files list
21+
config.config_files = config_filenames
22+
23+
def coverage_init(reg, options):
24+
config = get_coverage_config()
25+
read_config_files(config)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage >= 4.0

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = 1

setup.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
3+
from setuptools import setup
4+
5+
classifiers = """\
6+
Environment :: Console
7+
Intended Audience :: Developers
8+
License :: OSI Approved :: MIT License
9+
Operating System :: OS Independent
10+
Programming Language :: Python :: 2.7
11+
Programming Language :: Python :: 3.4
12+
Programming Language :: Python :: 3.5
13+
Programming Language :: Python :: 3.6
14+
Programming Language :: Python :: Implementation :: CPython
15+
Programming Language :: Python :: Implementation :: PyPy
16+
Topic :: Software Development :: Quality Assurance
17+
Topic :: Software Development :: Testing
18+
Development Status :: 3 - Alpha
19+
"""
20+
21+
setup(
22+
name='coverage_config_reload_plugin',
23+
version='0.1',
24+
description='coverage.py config reload plugin',
25+
author='John Vandenberg',
26+
author_email='[email protected]',
27+
url='https://github.com/jayvdb/coverage_config_reload_plugin',
28+
py_modules=['coverage_config_reload_plugin'],
29+
install_requires=[
30+
'coverage >= 4.0',
31+
],
32+
license='MIT License',
33+
classifiers=classifiers.splitlines(),
34+
)

0 commit comments

Comments
 (0)