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

feat(py/client-ticking): Support windows build for py/client-ticking #6198

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
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
27 changes: 25 additions & 2 deletions py/client-ticking/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
import os
import pathlib
import platform

# Note: pkg_resources is deprecated https://setuptools.pypa.io/en/latest/pkg_resources.html, and it is suggested
# to use an external library `packaging`. From the context of building a wheel though, we'd prefer to not have to
Expand All @@ -29,6 +30,27 @@ def _compute_version():
return _normalize_version(os.environ['DEEPHAVEN_VERSION'])

_version = _compute_version()
_system = platform.system()

if _system == 'Windows':
dhinstall=os.environ.get('DHINSTALL')
extra_compiler_args=['/std:c++17', f'/I{dhinstall}\\include']
extra_link_args=[f'/LIBPATH:{dhinstall}\\lib']

# Ensure distutils uses the compiler and linker in %PATH%
# You need an installation of Visual Studio 2022 with
# * Python Development Workspace
# * Python native option enabled
# And this should be run from the "x64 Native Tools Command Prompt" installed by VS
# Note "x64_x86 Cross Tools Command Prompt" will NOT work.
os.environ['DISTUTILS_USE_SDK']='y'
os.environ['MSSdk']='y'
libraries=['dhcore_static', 'ws2_32']

else:
extra_compiler_args=['-std=c++17']
extra_link_args=None
libraries=['dhcore_static']

setup(
name='pydeephaven-ticking',
Expand Down Expand Up @@ -61,8 +83,9 @@ def _compute_version():
[Extension("pydeephaven_ticking._core",
sources=["src/pydeephaven_ticking/*.pyx"],
language="c++",
extra_compile_args=["-std=c++17"],
libraries=["dhcore_static"]
extra_compile_args=extra_compiler_args,
extra_link_args=extra_link_args,
libraries=libraries
)]),
python_requires='>=3.8',
install_requires=[f"pydeephaven=={_version}"],
Expand Down
Loading