File: trim_sdist_content.py

package info (click to toggle)
scipy 1.16.0-1exp7
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 234,820 kB
  • sloc: cpp: 503,145; python: 344,611; ansic: 195,638; javascript: 89,566; fortran: 56,210; cs: 3,081; f90: 1,150; sh: 848; makefile: 785; pascal: 284; csh: 135; lisp: 134; xml: 56; perl: 51
file content (42 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
"""
The purpose of this script is to remove files from the sdist that are not
needed and bloat the sdist size too much. This deals with files from
git submodules, because those cannot be removed by using `export-ignore`
in the top-level `.gitattributes` file.
"""

import os
import pathlib
import shutil

dist_root = pathlib.Path(os.environ['MESON_DIST_ROOT'])

for name in [dist_root / d for d in (
    'subprojects/boost_math/math/.github',
    'subprojects/boost_math/math/build',
    'subprojects/boost_math/math/config',
    'subprojects/boost_math/math/doc',
    'subprojects/boost_math/math/example',
    'subprojects/boost_math/math/meta',
    'subprojects/boost_math/math/reporting',
    'subprojects/boost_math/math/src',
    'subprojects/boost_math/math/test',
    'subprojects/boost_math/math/tools',
    'subprojects/highs/.github',
    'subprojects/highs/app',
    'subprojects/highs/check',
    'subprojects/highs/docs',
    'subprojects/highs/examples',
    'subprojects/highs/nuget',
    'subprojects/highs/scripts',
    'subprojects/highs/tests',
    'subprojects/xsf/.github',
    'subprojects/xsf/pixi.lock',
    'subprojects/xsf/tests',
    )]:
    if name.is_file():
        name.unlink()
    else:
        shutil.rmtree(name)