Skip to content

Commit

Permalink
ignore __pycache__ directory when dephell creates tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
515hikaru committed Oct 25, 2019
1 parent 97d4592 commit 7bbdaab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dephell/converters/sdist.py
Expand Up @@ -175,6 +175,7 @@ def _write_additional_files(self, *, tar, project, subdir):
if self.ratio is None:
self.ratio = config['sdist']['ratio']
tests_path = Path('tests')
subpaths = tests_path.glob('**/*')
if tests_path.exists():
package_size = get_path_size(path=project.package.packages[0].path)
tests_size = get_path_size(path=tests_path)
Expand All @@ -183,7 +184,14 @@ def _write_additional_files(self, *, tar, project, subdir):
name=str(tests_path),
arcname=subdir + tests_path.name,
filter=self._set_uid_gid,
)
recursive=False)
for path in subpaths:
if '__pycache__' not in str(path):
tar.add(
name=str(path),
arcname=subdir + path.name,
filter=self._set_uid_gid,
recursive=False)

def _write_content(self, tar, path: str, content) -> None:
content = content.encode('utf-8')
Expand Down

0 comments on commit 7bbdaab

Please sign in to comment.