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

Fix #15 - installing from pip and easy_install (Take 2) #21

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "Merge pull request #20 from ccpost/fix/pip-install"
This reverts commit 9277d45, reversing
changes made to f793225.
  • Loading branch information
ccpost committed Mar 27, 2016
commit d088bc8f0df673e650ba6ac8c7a31d0c2540cc84
37 changes: 0 additions & 37 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@
"""

from distutils.util import get_platform
import distutils.command.install as install_orig
import inspect
import sys

from setuptools import setup, Extension
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command.install import install


if sys.version_info[0:2] < (2, 6):
Expand Down Expand Up @@ -87,35 +83,6 @@
VERSION_ALT = '%i,%01i,%01i,%04i' % VERSION_INFO


# Workaround for `pip install` and direct `setup.py install`
class InstallBuildExtFirst(install):
"""Workaround substitute `install` command"""
def run(self):
# Run built_ext first so that SWIG generated files are included
self.run_command("build_ext")
# Copy the rest of the logic from setuptools install so that the
# stack frame logic is preserved

# Explicit request for old-style install? Just do it
if self.old_and_unmanageable or self.single_version_externally_managed:
return install_orig.install.run(self)

if not self._called_from_setup(inspect.currentframe()):
# Run in backward-compatibility mode to support bdist_* commands.
install_orig.install.run(self)
else:
self.do_egg_install()


# Workaround for `easy_install`
class BdistEggBuildExtFirst(bdist_egg):
"""Workaround substitute `bdist_egg` command"""
def run(self):
# Run build_ext first so that SWIG generated files are included
self.run_command("build_ext")
return bdist_egg.run(self)


kw = {'name': "pyscard",
'version': VERSION_STR,
'description': "Smartcard module for Python.",
Expand All @@ -139,10 +106,6 @@ def run(self):
"smartcard/wx": ["resources/*.ico"],
},

'cmdclass': {
'install': InstallBuildExtFirst,
'bdist_egg': BdistEggBuildExtFirst,
},
# the _scard.pyd extension to build
'ext_modules': [Extension("smartcard.scard._scard",
define_macros=[
Expand Down