From aedb4ed5a96ed2d1ac10804c257d62148915533f Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 2 May 2018 11:20:31 -0700 Subject: Don't ship .pyc files and don't create pyc files when building tables (#135) --- MANIFEST.in | 1 + setup.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 219a05d..8017b7e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include README.* include LICENSE include CHANGES include setup.* +exclude setup.pyc recursive-exclude tests yacctab.* lextab.* recursive-exclude examples yacctab.* lextab.* diff --git a/setup.py b/setup.py index 2a6adc5..9189712 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,12 @@ except ImportError: def _run_build_tables(dir): - from subprocess import call - call([sys.executable, '_build_tables.py'], - cwd=os.path.join(dir, 'pycparser')) + from subprocess import check_call + # This is run inside the install staging directory (that had no .pyc files) + # We don't want to generate any. + # https://github.com/eliben/pycparser/pull/135 + check_call([sys.executable, '-B', '_build_tables.py'], + cwd=os.path.join(dir, 'pycparser')) class install(_install): -- cgit v1.2.3