Skip to content

Instantly share code, notes, and snippets.

@dougn
Created June 6, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougn/f73f6883be0a9d4e3c95143cb72edd5e to your computer and use it in GitHub Desktop.
Save dougn/f73f6883be0a9d4e3c95143cb72edd5e to your computer and use it in GitHub Desktop.
from setuptools import setup, find_packages
from setuptools import Extension
from setuptools.command.install import install
from setuptools import Command
from setuptools.dist import Distribution
from wheel.bdist_wheel import bdist_wheel
class BinaryDistribution(Distribution):
def is_pure(self):
return False
## allows the python package to still be zip imported
class bdist_wheel_mixed(bdist_wheel):
def finalize_options(self):
bdist_wheel.finalize_options(self)
self.root_is_purelib = True
def get_tag(self):
tag = bdist_wheel.get_tag(bdist_wheel(BinaryDistribution(attrs=dict(
name=self.distribution.get_name(),
version=self.distribution.get_version()))))
return tag
import package
setup(
name = 'package',
version = package.__version_string__, # + '_' + build,
description = 'description',
packages = find_packages(),
cmdclass = {
'bdist_wheel_mixed': bdist_wheel_mixed,
},
entry_points={
'console_scripts': [
'script = package.tools.script:__main__',
]
},
include_package_data=True,
package_data={
'package' : list_of_binaries,
},
data_files=[
(script_dir, exe_files),
],
install_requires=[
],
distclass = BinaryDistribution,
zip_safe=True,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment