From 51cf46e66045162c2c827cb3c05661f46156eb4a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 3 Jun 2018 20:56:07 -0700 Subject: [PATCH 1/2] Simplify setup.py in arbitrary_bytes_repo --- .../{python3_hook/main.py => python3_hook.py} | 2 +- .../arbitrary_bytes_repo/python3_hook/__init__.py | 0 testing/resources/arbitrary_bytes_repo/setup.py | 7 ++----- 3 files changed, 3 insertions(+), 6 deletions(-) rename testing/resources/arbitrary_bytes_repo/{python3_hook/main.py => python3_hook.py} (96%) delete mode 100644 testing/resources/arbitrary_bytes_repo/python3_hook/__init__.py diff --git a/testing/resources/arbitrary_bytes_repo/python3_hook/main.py b/testing/resources/arbitrary_bytes_repo/python3_hook.py similarity index 96% rename from testing/resources/arbitrary_bytes_repo/python3_hook/main.py rename to testing/resources/arbitrary_bytes_repo/python3_hook.py index c6a5547c..ba698a93 100644 --- a/testing/resources/arbitrary_bytes_repo/python3_hook/main.py +++ b/testing/resources/arbitrary_bytes_repo/python3_hook.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import sys -def func(): +def main(): # Intentionally write mixed encoding to the output. This should not crash # pre-commit and should write bytes to the output. sys.stdout.buffer.write('☃'.encode('UTF-8') + '²'.encode('latin1') + b'\n') diff --git a/testing/resources/arbitrary_bytes_repo/python3_hook/__init__.py b/testing/resources/arbitrary_bytes_repo/python3_hook/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/testing/resources/arbitrary_bytes_repo/setup.py b/testing/resources/arbitrary_bytes_repo/setup.py index bf7690c0..c780e427 100644 --- a/testing/resources/arbitrary_bytes_repo/setup.py +++ b/testing/resources/arbitrary_bytes_repo/setup.py @@ -1,11 +1,8 @@ -from setuptools import find_packages from setuptools import setup setup( name='python3_hook', version='0.0.0', - packages=find_packages('.'), - entry_points={ - 'console_scripts': ['python3-hook = python3_hook.main:func'], - }, + py_modules=['python3_hook'], + entry_points={'console_scripts': ['python3-hook=python3_hook:main']}, ) From 37f49d8fd447e7ed9bcb12d07822feb19d6dd06f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 3 Jun 2018 21:33:10 -0700 Subject: [PATCH 2/2] Stop crlf messages in appveyor --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 772caf4d..271edafa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,6 +19,7 @@ build: false before_test: # Shut up CRLF messages + - git config --global core.autocrlf false - git config --global core.safecrlf false test_script: tox