Skip to content

Commit a3c8176

Browse files
authored
Merge pull request #197 from pre-commit/py2
no longer skip pyc -- does not support python 2
2 parents f96147b + 1225db3 commit a3c8176

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

pre_commit_mirror_maker/make_repo.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from pre_commit_mirror_maker.languages import LIST_VERSIONS
1111

1212

13-
EXCLUDED_EXTENSIONS = ('.pyc',)
14-
15-
1613
def format_files(src: str, dest: str, **fmt_vars: str) -> None:
1714
"""Copies all files inside src into dest while formatting the contents
1815
of the files into the output.
@@ -34,10 +31,8 @@ def format_files(src: str, dest: str, **fmt_vars: str) -> None:
3431
assert os.path.exists(dest)
3532
# Only at the root. Could be made more complicated and recursive later
3633
for filename in os.listdir(src):
37-
if filename.endswith(EXCLUDED_EXTENSIONS):
38-
continue
3934
# Flat directory structure
40-
elif not os.path.isfile(os.path.join(src, filename)):
35+
if not os.path.isfile(os.path.join(src, filename)):
4136
continue
4237
with open(os.path.join(src, filename)) as f:
4338
output_contents = f.read().format(**fmt_vars)

tests/make_repo_test.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ def test_format_files(tmpdir):
3232
assert dest.join('file3.txt').read() == 'foo bar derp'
3333

3434

35-
def test_format_files_skips_pyc(tmpdir):
36-
src = tmpdir.join('src').ensure_dir()
37-
dest = tmpdir.join('dest').ensure_dir()
38-
39-
src.join('setup.py').write('# Setup.py')
40-
src.join('setup.pyc').write("# Setup.pyc, don't copy me!")
41-
42-
format_files(src, dest)
43-
44-
assert dest.join('setup.py').exists()
45-
assert not dest.join('setup.pyc').exists()
46-
47-
4835
def test_skips_directories(tmpdir):
4936
src = tmpdir.join('src').ensure_dir()
5037
dest = tmpdir.join('dest').ensure_dir()

0 commit comments

Comments
 (0)