Skip to content

Commit

Permalink
Update setup.py to package the compiled go program
Browse files Browse the repository at this point in the history
Signed-off-by: Lou Marvin Caraig <[email protected]>
  • Loading branch information
se7entyse7en committed Jun 27, 2020
1 parent 4300f14 commit e4a6f7c
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from functools import partial

import setuptools
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel


requires = [
Expand Down Expand Up @@ -30,7 +31,7 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development',
'Topic :: Utilities'
'Topic :: Utilities',
]

with open('README.md', 'r') as fh:
Expand All @@ -40,7 +41,7 @@
def get_about():
regexes = {
'title': r"^__title__\s=\s(?P<quote>['])(?P<title>\w*)(?P=quote)$",
'version': r"^__version__\s=\s(?P<quote>['])(?P<version>[\d\.]*)(?P=quote)$",
'version': r"^__version__\s=\s(?P<quote>['])(?P<version>[\w\.]*)(?P=quote)$",
'author': r"^__author__\s=\s(?P<quote>['])(?P<author>[\w\s]*)(?P=quote)$",
'author_email': r"^__author_email__\s=\s(?P<quote>['])(?P<author_email>.*)(?P=quote)$",
'description': r"^__description__\s=\s(?P<quote>['])(?P<description>.*)(?P=quote)$",
Expand All @@ -57,6 +58,19 @@ def get_about():
about = get_about()


class bdist_wheel(_bdist_wheel):

def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False

def get_tag(self):
if not self.plat_name_supplied:
raise ValueError('plat_name is required')

return 'py2.py3', 'none', self.plat_name


setuptools.setup(
name=about['title'],
version=about['version'],
Expand All @@ -68,8 +82,14 @@ def get_about():
url=about['project_url'],
packages=setuptools.find_packages(exclude=['tests']),
scripts=scripts,
package_data={'': ['LICENSE']},
package_data={
'': ['LICENSE'],
},
data_files=[('bin', ['bin/pydockenv_exec'])],
include_package_data=True,
install_requires=requires,
classifiers=classifiers,
cmdclass={
'bdist_wheel': bdist_wheel,
},
)

0 comments on commit e4a6f7c

Please sign in to comment.