|
|
|
@ -1,9 +1,10 @@ |
|
|
|
#!/usr/bin/env python3 |
|
|
|
|
|
|
|
import re |
|
|
|
from os.path import join |
|
|
|
from subprocess import check_call, check_output |
|
|
|
from sys import argv |
|
|
|
from tempfile import TemporaryDirectory |
|
|
|
import re |
|
|
|
|
|
|
|
|
|
|
|
def print_packages(packages, heading): |
|
|
|
@ -37,16 +38,21 @@ with TemporaryDirectory() as tmpdir: |
|
|
|
# pip installs the module itself along with deps so we need to get that out of |
|
|
|
# our list by finding the thing that was file installed during dev |
|
|
|
frozen = sorted([p for p in frozen if not p.startswith(our_package_name)]) |
|
|
|
dev_frozen = sorted([p for p in dev_frozen |
|
|
|
if not p.startswith(our_package_name)]) |
|
|
|
dev_frozen = sorted( |
|
|
|
[p for p in dev_frozen if not p.startswith(our_package_name)] |
|
|
|
) |
|
|
|
|
|
|
|
print_packages(frozen, 'frozen') |
|
|
|
print_packages(dev_frozen, 'dev_frozen') |
|
|
|
|
|
|
|
script = argv[0] |
|
|
|
|
|
|
|
with open('requirements.txt', 'w') as fh: |
|
|
|
fh.write(f'# DO NOT EDIT THIS FILE DIRECTLY - use {script} to update\n') |
|
|
|
fh.write('\n'.join(frozen)) |
|
|
|
fh.write('\n') |
|
|
|
|
|
|
|
with open('requirements-dev.txt', 'w') as fh: |
|
|
|
fh.write(f'# DO NOT EDIT THIS FILE DIRECTLY - use {script} to update\n') |
|
|
|
fh.write('\n'.join(dev_frozen)) |
|
|
|
fh.write('\n') |