Skip to content

Windows support#27

Merged
billbrod merged 8 commits intoLabForComputationalVision:mainfrom
WardBrian:feature/windows-support
Dec 18, 2023
Merged

Windows support#27
billbrod merged 8 commits intoLabForComputationalVision:mainfrom
WardBrian:feature/windows-support

Conversation

@WardBrian
Copy link
Contributor

@billbrod - I had some time after lunch and it ended up not being that hard to wrap up. Here's my first attempt.

This PR enables the package to be built and used on Windows with the Microsoft compiler. It supersedes #20.

This required two changes to the C source:

  • To continue using the nice Extension object to build the C code, a function named PyInit_wrapConv must exist so link.exe doesn't fail. Since we don't directly import this library, it is just a dummy stub.
  • To make the symbols in the library visible, they need to be annotated with __declspec(dllexport). This is done by way of the PYRTOOLS_EXPORT macro, which expands to the above on Windows and nothing on *nix.

There was also one small change needed in wrapper.py, as the produced file does not end in .so but rather has a name like wrapConv.cp312-win_amd64.pyd

The remaining changes in this PR are quality-of-life, mainly around providing pre-built wheels in the deploy Action.

@codecov
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c36ac7c) 69.70% compared to head (4b96db6) 69.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   69.70%   69.72%   +0.02%     
==========================================
  Files          19       19              
  Lines        1459     1460       +1     
  Branches      328      328              
==========================================
+ Hits         1017     1018       +1     
  Misses        348      348              
  Partials       94       94              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WardBrian
Copy link
Contributor Author

I've just added the ability to run the deploy action for a non-release. This should produce the wheels but not upload them to PyPI, so it can be used for testing/debugging

Copy link
Member

@billbrod billbrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks for putting this together!

@WardBrian
Copy link
Contributor Author

I think this should close #26, #20, and #18 when merged

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.

2 participants