Skip to content

Commit 60d0498

Browse files
author
Sylvain MARIE
committed
Fixed BSD 3-clause license details and added headers in all files pointing to that license
1 parent d9c1411 commit 60d0498

File tree

118 files changed

+545
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+545
-1
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2018, smarie
3+
Copyright (c) 2018-2020, Sylvain Marié, Schneider Electric Industries
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

ci_tools/headers.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Authors: Sylvain MARIE <[email protected]>
2+
+ All contributors to <https://github.com/smarie/python-pytest-cases>
3+
4+
License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>

ci_tools/headers_check.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import re
2+
3+
import click
4+
from dateutil.utils import today
5+
from glob import glob
6+
from os.path import dirname, join, abspath
7+
8+
9+
# path to the the pytest_cases folder
10+
root = abspath(join(dirname(__file__), '../pytest_cases'))
11+
default_tmpl = abspath(join(dirname(__file__), 'headers.tmpl'))
12+
13+
14+
@click.command()
15+
@click.option('-s', '--single', 'single', is_flag=True)
16+
@click.option('-r', '--remove', 'action', flag_value='remove')
17+
@click.option('-i', '--inject', 'action', flag_value='inject', default=True)
18+
def check_all_headers(path=root, headers_template=default_tmpl, action='inject', single=False):
19+
"""
20+
21+
:param path:
22+
:param headers_template:
23+
:param remove:
24+
:return:
25+
"""
26+
headers_tmpl = ""
27+
with open(headers_template) as f:
28+
for line in f.readlines():
29+
headers_tmpl += "# %s" % line if line != "\n" else "#\n"
30+
31+
# note: the year now disappeared, everything is redirected to the LICENSE file at the root
32+
headers_regex = re.compile(re.escape(headers_tmpl).replace("\\{", "{").replace("\\}", "}").format(year=".*"))
33+
headers = headers_tmpl.format(year=today().year)
34+
35+
# rel_root = relpath(abspath(root), getcwd())
36+
for f in glob("%s/**/*.py" % path, recursive=True):
37+
# skip meta tests
38+
if "meta" in f:
39+
print("skipping file %s" % f)
40+
continue
41+
42+
# read file
43+
with open(f, mode="rt") as contents:
44+
src = contents.read()
45+
46+
# skip empty files
47+
if src.strip() == "":
48+
print("skipping file %s as it is empty" % f)
49+
continue
50+
51+
if action == 'inject':
52+
if src.startswith(headers):
53+
continue
54+
match = headers_regex.match(src)
55+
if match:
56+
# different year. remove the existing header and re-apply
57+
src = src[match.end():]
58+
new_contents = headers + src
59+
elif action == 'remove':
60+
if src.startswith(headers):
61+
new_contents = src[len(headers):]
62+
else:
63+
match = headers_regex.match(src)
64+
if match:
65+
new_contents = src[match.end():]
66+
else:
67+
continue
68+
else:
69+
raise ValueError("invalid action: %s" % action)
70+
71+
with open(f, mode="wt") as contents:
72+
contents.write(new_contents)
73+
74+
if single:
75+
print("single file modded '%s' - exiting" % f)
76+
break
77+
78+
79+
if __name__ == '__main__':
80+
check_all_headers()

pytest_cases/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from .common_pytest_lazy_values import lazy_value
26
from .common_others import unfold_expected_err, assert_exception, AUTO, AUTO2
37

pytest_cases/case_funcs_legacy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from __future__ import division
26

37
from itertools import product

pytest_cases/case_funcs_new.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from copy import copy
26

37
from decopatch import function_decorator, DECORATED

pytest_cases/case_parametrizer_legacy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
# Use true division operator always even in old python 2.x (used in `_get_case_getter_s`)
26
from __future__ import division
37

pytest_cases/case_parametrizer_new.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
# Use true division operator always even in old python 2.x (used in `_extract_cases_from_module`)
26
from __future__ import division
37

pytest_cases/common_mini_six.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import sys
26

37
PY3 = sys.version_info[0] >= 3

pytest_cases/common_others.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import functools
26
import inspect
37
from importlib import import_module

pytest_cases/common_pytest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from __future__ import division
26

37
try: # python 3.3+

pytest_cases/common_pytest_lazy_values.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from distutils.version import LooseVersion
26
from functools import partial
37

pytest_cases/common_pytest_marks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import warnings
26
from distutils.version import LooseVersion
37

pytest_cases/fixture__creation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from __future__ import division
26

37
from inspect import getmodule, currentframe

pytest_cases/fixture_core1_unions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from __future__ import division
26

37
from inspect import isgeneratorfunction

pytest_cases/fixture_core2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from __future__ import division
26

37
from distutils.version import LooseVersion

pytest_cases/fixture_parametrize_plus.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from collections import Iterable
26
from inspect import isgeneratorfunction
37
from warnings import warn

pytest_cases/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from collections import OrderedDict, namedtuple
26
from copy import copy
37
from distutils.version import LooseVersion

pytest_cases/tests/cases/doc/cases_doc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26

37
from pytest_cases import case

pytest_cases/tests/cases/doc/example.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15

26
def foo(a, b):
37
""" the function to test ! """

pytest_cases/tests/cases/doc/test_doc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26

37
from pytest_harvest import get_session_synthesis_dct

pytest_cases/tests/cases/doc/test_doc_cache.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize, parametrize_with_cases, fixture
26

37

pytest_cases/tests/cases/doc/test_doc_cases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
def case_two_positive_ints():
26
""" Inputs are two positive integers """
37
return 1, 2

pytest_cases/tests/cases/doc/test_doc_filters_n_tags.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_harvest import get_session_synthesis_dct
26

37
from pytest_cases.common_pytest_marks import has_pytest_param

pytest_cases/tests/cases/doc/test_doc_filters_n_tags2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from math import sqrt
26
import pytest
37

pytest_cases/tests/cases/doc/test_fixtures.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_harvest import get_session_synthesis_dct
26

37
from pytest_cases import parametrize_with_cases, fixture, parametrize

pytest_cases/tests/cases/doc/test_generators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import sys
26

37
from pytest_harvest import get_session_synthesis_dct

pytest_cases/tests/cases/doc/test_joss.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from random import random
26
# from tabulate import tabulate
37
from pytest_cases import parametrize, parametrize_with_cases

pytest_cases/tests/cases/doc/test_parametrize_alt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26

37
from pytest_cases import parametrize_with_cases

pytest_cases/tests/cases/issues/test_issue_117.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize_with_cases
26

37

pytest_cases/tests/cases/issues/test_issue_125.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize_with_cases, fixture
26

37

pytest_cases/tests/cases/issues/test_issue_126.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26
from pytest_cases import parametrize_with_cases
37

pytest_cases/tests/cases/issues/test_issue_126_2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26

37
from pytest_cases.common_pytest_marks import has_pytest_param

pytest_cases/tests/cases/issues/test_issue_126_2_cases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize
26

37

pytest_cases/tests/cases/issues/test_issue_128.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize_with_cases, fixture
26

37

pytest_cases/tests/cases/issues/test_issue_128_2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import parametrize_with_cases, fixture
26

37

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
def case_one(bird):
26
return bird

pytest_cases/tests/cases/legacy/advanced/test_memoize.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import cases_data, CaseDataGetter, THIS_MODULE, case_tags
26
from ..utils import nb_pytest_parameters, get_pytest_param
37

pytest_cases/tests/cases/legacy/advanced/test_memoize_generators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from pytest_cases import cases_data, THIS_MODULE, cases_generator, CaseDataGetter, get_all_cases_legacy
26
from ..utils import nb_pytest_parameters, get_pytest_param
37

pytest_cases/tests/cases/legacy/advanced/test_parameters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
import pytest
26

37
from ..example_code import super_function_i_want_to_test

pytest_cases/tests/cases/legacy/advanced/test_stackoverflow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Authors: Sylvain MARIE <[email protected]>
2+
# + All contributors to <https://github.com/smarie/python-pytest-cases>
3+
#
4+
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
15
from ..example_code import super_function_i_want_to_test
26
from pytest_cases import cases_data, CaseDataGetter
37
try:

0 commit comments

Comments
 (0)