Skip to content

Commit

Permalink
Add notes for compiling Python module for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed Jun 28, 2024
1 parent 143ef27 commit 0131a41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ mkdir SpecUtils
cp .\Release\libSpecUtils.dll .\SpecUtils\SpecUtils.pyd
cp ..\bindings\python\__init__.py .\SpecUtils\
cp ..\bindings\python\setup.py .
pip install pip setuptools
python.exe -m build --wheel
python.exe -m pip install --user --force .\dist\SpecUtils-0.0.1-cp310-cp310-win_amd64.whl
pip install pip setuptools wheel
# We should be able to run the following command to make a package:
# python.exe -m build --wheel
# But I ran into an issue with the "Tag" wasnt compatible with the current
# Python, so needed to use:
python.exe setup.py bdist_wheel --plat-name=win_amd64
# You can list tags compatible with your install `python.exe -m pip debug --verbose`
# And you may be able.
# If we ever get around to only using the stable API, we could use the command:
# python.exe setup.py bdist_wheel --plat-name=win_amd64 --python-tag=cp35 --py-limited-api=cp35
python.exe -m pip install --user --force .\dist\SpecUtils-0.0.1-cp312-cp312-win32.whl
```
5 changes: 5 additions & 0 deletions bindings/python/SpecFile_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
// For statically linking on Windows, we need this following define
#define BOOST_PYTHON_STATIC_LIB

// TODO: It would be nice to have the compiled results compatible with
// any python >= 3.5, which would require this next line, but this
// would require significant changes to use this limited API
// #define Py_LIMITED_API 0x03050000

#include "SpecUtils_config.h"

#include "3rdparty/date/include/date/date.h"
Expand Down

0 comments on commit 0131a41

Please sign in to comment.