Skip to content

Commit 0131a41

Browse files
committed
Add notes for compiling Python module for Windows
1 parent 143ef27 commit 0131a41

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

bindings/python/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@ mkdir SpecUtils
7878
cp .\Release\libSpecUtils.dll .\SpecUtils\SpecUtils.pyd
7979
cp ..\bindings\python\__init__.py .\SpecUtils\
8080
cp ..\bindings\python\setup.py .
81-
pip install pip setuptools
82-
python.exe -m build --wheel
83-
python.exe -m pip install --user --force .\dist\SpecUtils-0.0.1-cp310-cp310-win_amd64.whl
81+
pip install pip setuptools wheel
82+
# We should be able to run the following command to make a package:
83+
# python.exe -m build --wheel
84+
# But I ran into an issue with the "Tag" wasnt compatible with the current
85+
# Python, so needed to use:
86+
python.exe setup.py bdist_wheel --plat-name=win_amd64
87+
# You can list tags compatible with your install `python.exe -m pip debug --verbose`
88+
# And you may be able.
89+
# If we ever get around to only using the stable API, we could use the command:
90+
# python.exe setup.py bdist_wheel --plat-name=win_amd64 --python-tag=cp35 --py-limited-api=cp35
91+
python.exe -m pip install --user --force .\dist\SpecUtils-0.0.1-cp312-cp312-win32.whl
8492
```

bindings/python/SpecFile_py.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
// For statically linking on Windows, we need this following define
2121
#define BOOST_PYTHON_STATIC_LIB
2222

23+
// TODO: It would be nice to have the compiled results compatible with
24+
// any python >= 3.5, which would require this next line, but this
25+
// would require significant changes to use this limited API
26+
// #define Py_LIMITED_API 0x03050000
27+
2328
#include "SpecUtils_config.h"
2429

2530
#include "3rdparty/date/include/date/date.h"

0 commit comments

Comments
 (0)