Skip to content

Commit

Permalink
Added more exclusions for common files to manifest building
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiger-Tom committed Dec 11, 2023
1 parent f6a85c7 commit 9c7d1ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _rsruntime/rs_BOOTSTRAP.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9c7d1ec

Please sign in to comment.