Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify haveWheel condition in setup.py #2691

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements/devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ appdirs
setuptools
sip == 6.9.1

wheel
twine
requests >= 2.26.0
cython==3.0.10
Expand Down
42 changes: 18 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
import buildtools.version as version

haveWheel = True

# Create a buildtools.config.Configuration object
cfg = Config(noWxConfig=True)
DOCS_BASE='http://docs.wxPython.org'
Expand Down Expand Up @@ -174,30 +172,28 @@ def run(self):
# Run the default bdist_egg command
orig_bdist_egg.run(self)

class wx_bdist_wheel(orig_bdist_wheel):
def finalize_options(self):
# Do a bit of monkey-patching to let bdist_wheel know that there
# really are extension modules in this build, even though they are
# not built here.
def _has_ext_modules(self):
return True
from setuptools.dist import Distribution
#Distribution.is_pure = _is_pure
Distribution.has_ext_modules = _has_ext_modules

if haveWheel:
class wx_bdist_wheel(orig_bdist_wheel):
def finalize_options(self):
# Do a bit of monkey-patching to let bdist_wheel know that there
# really are extension modules in this build, even though they are
# not built here.
def _has_ext_modules(self):
return True
from setuptools.dist import Distribution
#Distribution.is_pure = _is_pure
Distribution.has_ext_modules = _has_ext_modules

orig_bdist_wheel.finalize_options(self)
orig_bdist_wheel.finalize_options(self)


def run(self):
# Ensure that there is a basic library build for bdist_egg/wheel to pull from.
self.run_command("build")
def run(self):
# Ensure that there is a basic library build for bdist_egg/wheel to pull from.
self.run_command("build")

_cleanup_symlinks(self)
_cleanup_symlinks(self)

# Run the default bdist_wheel command
orig_bdist_wheel.run(self)
# Run the default bdist_wheel command
orig_bdist_wheel.run(self)


class wx_install(orig_install):
Expand Down Expand Up @@ -233,10 +229,8 @@ def run(self):
'bdist_egg' : wx_bdist_egg,
'install' : wx_install,
'sdist' : wx_sdist,
'bdist_wheel' : wx_bdist_wheel,
}
if haveWheel:
CMDCLASS['bdist_wheel'] = wx_bdist_wheel



#----------------------------------------------------------------------
Expand Down