Skip to content

Commit

Permalink
Add setup.py for creating a Windows Python installer
Browse files Browse the repository at this point in the history
python setup.py bdist_wininst
  • Loading branch information
jhasse committed Jan 24, 2019
1 parent 64eb7d2 commit 1539d23
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build/
/jngl.egg-info/
/dist/
26 changes: 26 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3

from distutils.core import setup
from setuptools.dist import Distribution
import shutil, os

if not os.path.exists('build/lib.win32-3.6'):
os.makedirs('build/lib.win32-3.6')
shutil.copy('../visualcpp/Release/Python.dll', 'build/lib.win32-3.6/jngl.pyd')

class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name"""
def has_ext_modules(foo):
return True

setup(
name="jngl",
version="1.4.0",
description="JNGL for Python",
author="Jan Niklas Hasse",
author_email="jhasse@bixense.com",
url="https://bixense.com/jngl",
data_files=[(".", ["../visualcpp/Release/jngl.dll", "../epoxy-0.dll"])],
py_modules=['jngl'],
distclass=BinaryDistribution,
)

0 comments on commit 1539d23

Please sign in to comment.