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

Package on conda-forge and conda osx-arm64 #69

Open
gabuzi opened this issue Nov 25, 2023 · 6 comments
Open

Package on conda-forge and conda osx-arm64 #69

gabuzi opened this issue Nov 25, 2023 · 6 comments

Comments

@gabuzi
Copy link

gabuzi commented Nov 25, 2023

Hi,

I have realized that I can't install ismrmrd-python on an apple silicon device (conda platform osx-arm64). While one can pretend to be on x86-64 by creating the env with --platform osx-64, I don't think that this should be required (as ismrmrd-python is a pure python package).

Further, install from conda seems to require conda-forge channels anyway since xsdata is only available from there. Ismrmrd-python could also be distributed via conda-forge to simplify the installation as the currently required custom 'ismrmrd' channel for install is not well documented and I had to dig a bit in the repo to find it.

I would thus propose to publish also to conda-forge. My initial tests with building a noarch python conda package (https://docs.anaconda.com/reference/glossary/?highlight=noarch#noarch-package) for ismrmrd-python were successful, although I could not build directly from the sources released on PyPI, because they don't include all source files (crucially schema/.xsdata.xml is absent, and then the xsdata code generation will default to PascalCase instead of camelCase for classes). Also examples are not present.

The are two options that worked for me for building, including tests:

  1. Build either from github source release.
  2. Build from PyPI wheel (which contains the xsd-generated python module): https://docs.conda.io/projects/conda-build/en/3.27.x/user-guide/wheel-files.html.
    If building from PyPI wheel, we need to download the PyPI sources still, because LICENSE and tests/ are only contained therein. I have tested this, it works on my apple silicon machine, but it makes the recipe more complicated.

Conda-forge prefers source builds over builds from wheels.
Preferably, sources uploaded to PyPI are identical with those in github releases to avoid confusion. Then it also wouldn't matter anymore where the sources are taken from. It should also be possible for to setup automatic conda-forge packaging regardless of where the sources are from (https://conda-forge.org/docs/maintainer/updating_pkgs.html#how-does-regro-cf-autotick-bot-create-automatic-version-updates), but I have no personal experience with this.

I wanted to ask for the ismrmrd-python maintainers' opinions on this.
I'd be happy to submit a PR to https://github.com/conda-forge/staged-recipes to get the process started.

@gabuzi
Copy link
Author

gabuzi commented Mar 22, 2024

Any objections to me going forward with a conda-forge build?

@dchansen
Copy link
Contributor

@hansenms Any objections here?

@hansenms
Copy link
Member

Go for it!

@gabuzi
Copy link
Author

gabuzi commented Mar 28, 2024

Happy to report that the PR was merged and ismrmrd-python is now available from the conda-forge channel: https://anaconda.org/conda-forge/ismrmrd-python

This is a "noarch" conda package (pure python) and should thus run on windows, linux, macos...

I was forced to constrain to Python <3.12 as 3.12 has now finally removed the imp library: https://docs.python.org/3/whatsnew/3.12.html.
Nose, which is quite old (1.3.7 was last updated 9 years ago) is no longer compatible (I'm honestly surprised that it lasted for so long).
At this point, I would suggest to migrate away from nose to another testing library. There is pynose as a maintained fork of nose, but it doesn't seem to be available from conda.

Lastly, I'm happy to maintain the conda-forge recipe, but if any maintainer here wants to be added as a recipe maintainer, please let me know, it's certainly better to have more people in the loop!

@lrlunin
Copy link

lrlunin commented Oct 29, 2024

Happy to report that the PR was merged and ismrmrd-python is now available from the conda-forge channel: https://anaconda.org/conda-forge/ismrmrd-python

This is a "noarch" conda package (pure python) and should thus run on windows, linux, macos...

I was forced to constrain to Python <3.12 as 3.12 has now finally removed the imp library: https://docs.python.org/3/whatsnew/3.12.html. Nose, which is quite old (1.3.7 was last updated 9 years ago) is no longer compatible (I'm honestly surprised that it lasted for so long). At this point, I would suggest to migrate away from nose to another testing library. There is pynose as a maintained fork of nose, but it doesn't seem to be available from conda.

Lastly, I'm happy to maintain the conda-forge recipe, but if any maintainer here wants to be added as a recipe maintainer, please let me know, it's certainly better to have more people in the loop!

Can you please update the library to the 1.14.1 version? Maybe there is some way inclduing GitHub workflow to automatically update the conda-forge version to the last release in this repo.

Thank you very much for your work!

@gabuzi
Copy link
Author

gabuzi commented Oct 29, 2024

Can you please update the library to the 1.14.1 version? Maybe there is some way inclduing GitHub workflow to automatically update the conda-forge version to the last release in this repo.

Thank you very much for your work!

Sorry, that update slipped my attention, thanks for the reminder. PR is merged conda-forge/ismrmrd-python-feedstock#2, should show up on conda-forge shortly.

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

No branches or pull requests

4 participants