Skip to content

Commit

Permalink
Use one set of config files to produce all Python packages/wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Meister committed Apr 18, 2024
1 parent 67753ca commit 0ed3274
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 47 deletions.
7 changes: 4 additions & 3 deletions concordance/win/make_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
shutil.copy2(dll, subdir)
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/../.libs/concordance.exe', subdir)
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/../../libconcord/bindings/python/libconcord.py', subdir + '/__init__.py')
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/setup.py.win32-wheel', tempdir + '/setup.py')
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/pyproject.toml.win32-wheel', tempdir + '/pyproject.toml')
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/../../libconcord/bindings/python/setup.py', tempdir)
shutil.copy2(os.path.dirname(os.path.abspath(__file__)) + '/../../libconcord/bindings/python/pyproject.toml', tempdir)

curdir = os.getcwd()
os.chdir(tempdir)

subprocess.run([ 'python3', '-m', 'build', ])
os.environ["WIN32WHEEL"]="1"
subprocess.run([ 'python3', '-m', 'build', '-w' ])
for file in glob.glob('dist/*.whl'):
print("Found wheel: " + file)
shutil.copy2(file, os.path.dirname(os.path.abspath(__file__)))
Expand Down
3 changes: 0 additions & 3 deletions concordance/win/pyproject.toml.win32-wheel

This file was deleted.

36 changes: 0 additions & 36 deletions concordance/win/setup.py.win32-wheel

This file was deleted.

32 changes: 27 additions & 5 deletions libconcord/bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,32 @@
#

from setuptools import setup
import os

setup(
name='libconcord',
version='1.5',
py_modules=['libconcord'],
)
common_name='libconcord'
common_version='1.5'

if os.environ.get("WIN32WHEEL", None) == "1":
#Win32 Wheel Option Set
setup(
name=common_name,
version=common_version,
packages=['libconcord'],
zip_safe=False,
package_data={
'': ['*.dll', '*.exe']
},
options={
"bdist_wheel": {
"plat_name": "win32",
},
},
)
else:
#Default Option Set
setup(
name=common_name,
version=common_version,
py_modules=['libconcord'],
)

0 comments on commit 0ed3274

Please sign in to comment.