1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Support magic PIP_SKIP_REQUIREMENTS_REGEX in pip freeze

This commit is contained in:
Ian Bicking 2009-04-13 13:22:41 -05:00
parent 14fcda6977
commit 5827857072

6
pip.py
View file

@ -577,6 +577,9 @@ class FreezeCommand(Command):
find_links = options.find_links or []
## FIXME: Obviously this should be settable:
find_tags = False
skip_match = None
if os.environ.get('PIP_SKIP_REQUIREMENTS_REGEX'):
skip_match = re.compile(os.environ['PIP_SKIP_REQUIREMENTS_REGEX'])
if filename == '-':
logger.move_stdout_to_stderr()
@ -608,6 +611,9 @@ class FreezeCommand(Command):
if not line.strip() or line.strip().startswith('#'):
f.write(line)
continue
if skip_match and skip_match.search(line):
f.write(line)
continue
elif line.startswith('-e') or line.startswith('--editable'):
if line.startswith('-e'):
line = line[2:].strip()