From ee3b18bfcb2a12a217e7cf9eeb2e625e8afa183b Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Thu, 12 Aug 2021 16:31:59 +0000 Subject: [PATCH] Fix manifest to not exclude cythonized files if we are building pure python. --- .gitignore | 1 + MANIFEST.in => MANIFEST.assets | 4 ---- MANIFEST.cython | 8 ++++++++ setup.py | 9 +++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) rename MANIFEST.in => MANIFEST.assets (88%) create mode 100644 MANIFEST.cython diff --git a/.gitignore b/.gitignore index a61fd21..71fdda6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ bemani.egg-info/ server/ emblems .vscode/ +MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.assets similarity index 88% rename from MANIFEST.in rename to MANIFEST.assets index ee58756..64e654d 100644 --- a/MANIFEST.in +++ b/MANIFEST.assets @@ -19,7 +19,3 @@ include bemani/frontend/static/controllers/ddr/*.js include bemani/frontend/static/controllers/reflec/*.js include bemani/frontend/static/controllers/sdvx/*.js include bemani/frontend/static/controllers/museca/*.js -exclude bemani/protocol/lz77.py -exclude bemani/protocol/stream.py -exclude bemani/protocol/binary.py -exclude bemani/protocol/xml.py diff --git a/MANIFEST.cython b/MANIFEST.cython new file mode 100644 index 0000000..f91c566 --- /dev/null +++ b/MANIFEST.cython @@ -0,0 +1,8 @@ +exclude bemani/protocol/lz77.py +exclude bemani/protocol/stream.py +exclude bemani/protocol/binary.py +exclude bemani/protocol/node.py +exclude bemani/protocol/protocol.py +exclude bemani/protocol/xml.py +exclude bemani/format/afp/types/generic.py +exclude bemani/format/dxt.py diff --git a/setup.py b/setup.py index c2798fd..fd579f4 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,9 @@ def extensions(): # extensions. Note that the pure python code will run slower. if 'PURE_PYTHON' in os.environ: # We've been asked not to compile extensions. + with open("MANIFEST.in", "w") as wfp: + with open("MANIFEST.assets", "r") as rfp: + wfp.write(rfp.read()) return [] from setuptools import Extension @@ -42,6 +45,12 @@ def extensions(): ), ] + with open("MANIFEST.in", "w") as wfp: + with open("MANIFEST.assets", "r") as rfp: + wfp.write(rfp.read()) + with open("MANIFEST.cython", "r") as rfp: + wfp.write(rfp.read()) + if 'EXPERIMENTAL_MYPYC_COMPILER' in os.environ: from mypyc.build import mypycify