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

C Extension that works with pip install #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

justengel
Copy link

@justengel justengel commented Oct 7, 2021

I created a C Extension. If you have the Visual Studio compilers installed, you can just pip install. See Also https://wiki.python.org/moin/WindowsCompilers. I also created wmm2020_cext on pypi.org. This library has published compiled ".whl" files for Windows Python37-39. Build the wheel files with python setup.py bdist_wheel

Also, removed the static path for WMM.COF and added it as a function argument.

You don't have to add this, but it is really helpful. I couldn't install your library. It looks like it uses MinGW instead of Visual Studio. Python is compiled with Visual Studio on Windows, so the best convention is to compile supporting libraries with Visual Studio for Windows. Also, if you use a C Extension Python will handle the compilation for you. No need for Makefiles. Additionally, the Makefile and build approach installs the .c, .h, and Makefiles with the Python library and forces the user to compile the library. When you compile the C Extension into .whl files you only need to bundle the .py and compiled .pyd files. This allows users to simply pip install unless they are running an OS that you did not compile .whl files for. In that case they can install the Python dev/build tools and pip install. Python will take care of compiling and installing the library which just makes it easier.

… wmmsub function now calls wmmsub_f function. C doesn't support overloading without a lot of junk.
…d ctypes LoadLibrary into build.py. Made load library to only run when calling the function for the first time and not on import. Moved SDIR to this_path to support old compatibility layers.
…hout building the C Extension. This allows the old build method to still be supported.
@justengel justengel changed the title C ext C Extension that works with pip install Oct 7, 2021
@el-hult
Copy link

el-hult commented Jul 17, 2022

Thank you! I managed to install your extension in a simple way. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants