Merge pull request #5574 from AlanCoding/req_test_dev

In requirements test, skip -e entries from pip freeze
This commit is contained in:
Alan Rominger 2017-03-01 09:21:43 -05:00 committed by GitHub
commit 9e109019fe

View File

@ -13,14 +13,21 @@ def test_env_matches_requirements_txt():
return False
return True
def skip_line(line):
return (
line == '' or line.strip().startswith('#') or
line.strip().startswith('git') or line.startswith('-e') or
'## The following requirements were added by pip freeze' in line
)
base_dir = settings.BASE_DIR
requirements_path = os.path.join(base_dir, '../', 'requirements/requirements.txt')
reqs_actual = []
xs = freeze.freeze(local_only=True)
for x in xs:
if '## The following requirements were added by pip freeze' in x:
break
if skip_line(x):
continue
x = x.lower()
(pkg_name, pkg_version) = x.split('==')
reqs_actual.append([pkg_name, pkg_version])
@ -31,11 +38,7 @@ def test_env_matches_requirements_txt():
line = line.partition('#')[0]
line = line.rstrip().lower()
# TODO: process git requiremenst and use egg
if line == '':
continue
if line.strip().startswith('#') or line.strip().startswith('git'):
continue
if line.startswith('-e'):
if skip_line(line):
continue
'''