# HG changeset patch # User Franz Glasner # Date 1641731216 -3600 # Node ID 4e61df27b4e19e70ff294270545fdb22ec451468 # Parent 0467b3ae34ead449d2f7e8ed59946a7277653bcd Put the ".egg-info" check into a common location diff -r 0467b3ae34ea -r 4e61df27b4e1 setup.py --- a/setup.py Sun Jan 09 12:47:56 2022 +0100 +++ b/setup.py Sun Jan 09 13:26:56 2022 +0100 @@ -61,18 +61,17 @@ del sys.argv[wcp_idx] -if wcp_idx is None: +# +# Otherwise some cached package_data would be used. +# But our package data differs between "standard" builds and +# builds with "--windows-cross-pack". +# - # - # Otherwise some cached package_data would be used. - # But our package data differs between "standard" builds and - # builds with "--windows-cross-pack". - # +if os.path.isdir(PROJECT_NAME + ".egg-info"): + raise RuntimeError( + "please remove %s.egg-info before" % (PROJECT_NAME,)) - if os.path.isdir(PROJECT_NAME + ".egg-info"): - raise RuntimeError( - "please remove %s.egg-info before" % (PROJECT_NAME,)) - +if wcp_idx is None: # # Handle the optinal C-extension for Python3.7+ and CPython only. # PyPy does not need this. @@ -130,10 +129,6 @@ if not os.path.isfile("configmix/_speedups.pyd"): raise RuntimeError("no _speedups.pyd found") - if os.path.isdir(PROJECT_NAME + ".egg-info"): - raise RuntimeError( - "please remove %s.egg-info before" % (PROJECT_NAME,)) - setup_extra_kwds["package_data"] = { "configmix": ["*.pyd"] }