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

Add patches for conda compatibility #666

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

hmaarrfk
Copy link
Contributor

For the conda-forge packages I package wgpu-native myself and install them in the "system" libraries.

This should continue to allow you to use the "wheel" vendored headers but then also look for the headers in the "system" locations.

I've been dragging on a simpler (less upstreamable) version of this patch for about a year but I'm hoping I don't have to with this addition.

@hmaarrfk hmaarrfk requested a review from Korijn as a code owner January 26, 2025 14:20
@Korijn
Copy link
Collaborator

Korijn commented Jan 26, 2025

Is there any (sane) way to test the different "deployment types" we want to support?

@hmaarrfk
Copy link
Contributor Author

I can add a conda forge based CI if you want

@hmaarrfk
Copy link
Contributor Author

I also have an other patch to disable the hatchling script.

@Korijn
Copy link
Collaborator

Korijn commented Jan 26, 2025

Is it possible to unit test the required functionality? It seems like that should be sufficient?

@hmaarrfk
Copy link
Contributor Author

I’m not sure I can think of a test that is guaranteed to run successfully to completion on your local setups.

Even to unit test the behavior.

Would it be ok for me to add a CI job with a comment to delete it if/when I become inactive and unable to maintain it?

@almarklein
Copy link
Member

Personally, I don't mind not-testing the conda-specific behaviour here.

Its (I assume) already tested in the conda forge feedstock. When it fails, an update is made relatively easily. A test here (in the current repo) might catch such errors sooner, but I doubt whether the maintenance overhead is worth it, since I don't expect these paths to change very often.

@hmaarrfk hmaarrfk force-pushed the add_patches_for_conda_compatibility branch from 6e53552 to 74ca92e Compare January 27, 2025 13:45
@hmaarrfk hmaarrfk marked this pull request as draft January 27, 2025 13:46
hmaarrfk added a commit to hmaarrfk/wgpu-py-feedstock that referenced this pull request Jan 27, 2025
@hmaarrfk
Copy link
Contributor Author

Ok let me test with conda-forge CIs before I unmark this as draft.

@hmaarrfk
Copy link
Contributor Author

@hmaarrfk hmaarrfk force-pushed the add_patches_for_conda_compatibility branch from 74ca92e to 531ae45 Compare January 27, 2025 14:12
@hmaarrfk hmaarrfk marked this pull request as ready for review January 27, 2025 14:28
@hmaarrfk
Copy link
Contributor Author

Ok i backported the patch and it seems like it both tested the new path (since I found a bug in lib vs bin on windows) so this seems good to go from my end if it is cool with all of you!

For the conda-forge packages I package wgpu-native myself and install
them in the "system" libraries.

This should continue to allow you to use the "wheel" vendored headers
but then also look for the headers in the "system" locations.

I've been dragging on a simpler (less upstreamable) version of this
patch for about a year but I'm hoping I don't have to with this
addition.
@Korijn Korijn force-pushed the add_patches_for_conda_compatibility branch from 0e7e95c to dc830f2 Compare January 27, 2025 14:59
@Korijn Korijn enabled auto-merge (squash) January 27, 2025 14:59
@Korijn Korijn merged commit 11bb195 into pygfx:main Jan 27, 2025
20 checks passed
@hmaarrfk
Copy link
Contributor Author

thank you!

@hmaarrfk hmaarrfk deleted the add_patches_for_conda_compatibility branch January 30, 2025 15:52
@Korijn
Copy link
Collaborator

Korijn commented Jan 30, 2025

Can you explain how this works in the conda distribution? I would expect the new code to still prefer vendored headers when they're there. Does the conda package not ship the vendored headers?

This question is purely out of interest. :)

@hmaarrfk
Copy link
Contributor Author

hmm, i didn't realize that you vendored the headers in the source package itself.... I'll have to try again.

  1. I try to keep the wgpu-native stuff in sync
  2. I comment out the hatchling stuff https://github.com/conda-forge/wgpu-py-feedstock/blob/main/recipe/no_hatchling.patch
  3. I need to add something like rm wgpu/resources/*.h or something...

@hmaarrfk
Copy link
Contributor Author

I've packaged the headers and the library and depend on those "c-like" packages in the recipe: https://github.com/conda-forge/wgpu-py-feedstock/blob/main/recipe/meta.yaml#L36

@hmaarrfk
Copy link
Contributor Author

and followup: conda-forge/wgpu-py-feedstock#29

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.

3 participants