From 9c7d1ec68331b5a656d3e4bd49b3525c4596e741 Mon Sep 17 00:00:00 2001 From: Shae Date: Mon, 11 Dec 2023 09:23:35 -0800 Subject: [PATCH] Added more exclusions for common files to manifest building --- _rsruntime/rs_BOOTSTRAP.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_rsruntime/rs_BOOTSTRAP.py b/_rsruntime/rs_BOOTSTRAP.py index 1107006..b895a26 100644 --- a/_rsruntime/rs_BOOTSTRAP.py +++ b/_rsruntime/rs_BOOTSTRAP.py @@ -656,12 +656,13 @@ def gen_field_metadata(*, name: str, manifest_upstream: str, content_upstream: s 'platform': sys.platform, 'os_release': os.uname().release, 'os_version': os.uname().version, 'hostname': os.uname().nodename, 'python_version': sys.version_info[:]} FILE_PATTERNS = ('**/*',) + FILE_EXCLUDED_PARTS = ('__pycache__', '.git', '.gitignore', 'requirements.txt') FILE_EXCLUDED_SUFFIXES = {'.pyc', '.json', '.ini', '.old'} @classmethod def gen_field_files(cls, algorithm: typing.Literal[*hashlib.algorithms_available], path: Path) -> ManifestDict_files: return {file.relative_to(path).as_posix(): base64.b85encode(hashlib.new(algorithm, file.read_bytes()).digest()).decode() - for patt in cls.FILE_PATTERNS for file in path.glob(patt) if (file.suffix not in cls.FILE_EXCLUDED_SUFFIXES) and file.is_file()} + for patt in cls.FILE_PATTERNS for file in path.glob(patt) if (not any((p in cls.FILE_EXCLUDED_PARTS) for p in file.parts) and (file.suffix not in cls.FILE_EXCLUDED_SUFFIXES) and file.is_file())} # Generation functions def generate_outline(self, *, system_info_level: typing.Literal['full', 'lite', 'none'] = 'full',