File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 227227 endif
228228
229229endif
230+ # dist - script to reduce the *tar.gz
231+ meson .add_dist_script(' scripts/strip-sdist.py' )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Script file to strip unwanted files from dist tarball
4+
5+ """
6+
7+ import os
8+ import shutil
9+
10+ dist_root = os .environ .get ("MESON_DIST_ROOT" )
11+
12+ # Files/Folders to strip from the *.tar.gz
13+ exclude = [
14+ ".github" ,
15+ "docs" ,
16+ "tests" ,
17+ "changelog" ,
18+ "stubs" ,
19+ "scripts" ,
20+ ".pre-commit-config.yaml" ,
21+ ".gitignore" ,
22+ ".readthedocs.yaml" ,
23+ "Makefile" ,
24+ "environment-docs-conda-base.yml" ,
25+ "mkdocs.yml" ,
26+ "uv.lock" ,
27+ "requirements-docs-locked.txt" ,
28+ "requirements-incl-optional-locked.txt" ,
29+ "requirements-locked.txt" ,
30+ "requirements-only-tests-locked.txt" ,
31+ "requirements-only-tests-min-locked.txt" ,
32+ "requirements-upstream-dev.txt" ,
33+ ".copier-answers.yml" ,
34+ ".fprettify.rc" ,
35+ ]
36+
37+ # Stripping
38+ for path in exclude :
39+ abs_path = os .path .join (dist_root , path )
40+ if not os .path .exists (abs_path ):
41+ print (f"File not found: { abs_path } " )
42+ if os .path .isdir (abs_path ):
43+ shutil .rmtree (abs_path )
44+ elif os .path .isfile (abs_path ):
45+ os .remove (abs_path )
You can’t perform that action at this time.
0 commit comments