Spaces:
Sleeping
Sleeping
File size: 1,005 Bytes
5e16fc6 bcfb8cf 5e16fc6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | """Create a portable source archive, excluding passwords, databases and test data."""
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
root=Path(__file__).resolve().parent
files=['app.py','schema.sql','seed.py','seed_data.json','importer.py','setup_routes.py','exporter.py',
'launcher.py','setup.bat','start_mom.bat','requirements.txt','requirements-dev.txt',
'README.md','PLAN.md','.gitignore','prepare_sources.py','hf_backup.py','space_server.py',
'Dockerfile','.dockerignore','HF_DEPLOYMENT.md']
for directory in ['templates','static','sources','tests']:
files.extend(str(p.relative_to(root)) for p in (root/directory).rglob('*') if p.is_file() and '__pycache__' not in p.parts)
with ZipFile(root/'MOM_App.zip','w',ZIP_DEFLATED) as archive:
for name in files:
archive.write(root/name,'MOM_App/'+name.replace('\\','/'))
print('Created MOM_App.zip with source code, original reports and launch instructions. No live data or credentials included.')
|