Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

# Note: when adding to this list, be aware that you need to commit your changes
# before they take effect (can be confusing during testing)
#
# Note: git submodules cannot be handled in this file. For removing
# files and directories from git submodules, see `tools/trim_sdist_content.py`
# This is a Meson "dist script", run during sdist generation only.

.circleci/* export-ignore
.github/* export-ignore
ci/* export-ignore
Expand Down
Binary file removed doc/source/_static/gitpod/github-gitpod.png
Binary file not shown.
Binary file not shown.
Binary file removed doc/source/_static/gitpod/gitpod-workspace.png
Binary file not shown.
Binary file not shown.
Binary file removed doc/source/_static/gitpod/installing-gitpod-io.png
Binary file not shown.
Binary file removed doc/source/_static/gitpod/rst-rendering.png
Binary file not shown.
Binary file removed doc/source/_static/gitpod/scipy-github.png
Binary file not shown.
Binary file not shown.
Binary file removed doc/source/_static/gitpod/vscode-rst.png
Binary file not shown.
Binary file removed doc/source/_static/gitpod/vscode-statusbar.png
Binary file not shown.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ project(
],
)

meson.add_dist_script('tools/trim_sdist_content.py')

py3 = import('python').find_installation(pure: false)
py3_dep = py3.dependency()

Expand Down
42 changes: 42 additions & 0 deletions tools/trim_sdist_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)

Loading