sbird / fake_spectra

A code for generating fake spectra from a cosmological simulation
MIT License
12 stars 13 forks source link

Can not get v2.2.1 via pip #63

Closed andreufont closed 2 years ago

andreufont commented 2 years ago

Hi everyone - there are a couple of people in DESI that would like to play with the MP-Gadget sims that Chris and I ran, and I'm setting up some simple example scripts at NERSC. Unfortunately, pip install fake_spectra can not find the latest version (v2.2.1), and we need that to be able to read pre-computed spectra without accessing the snapshots (#56).

Would it be possible to make v2.2.1 accessible via pip?

Thanks!

sbird commented 2 years ago

This is partially working thanks to @mahdiqezlou but it seems pypi now requires platform-independent wheels from the manylinux project. I'll work on this...

andreufont commented 2 years ago

Thanks @sbird! It is not urgent, since meanwhile I have put together skewers and actual snapshots for one of the sims, and most of the new "test users" are happy with just that one box (they are just testing and developing new analysis code). It would be good to have the option in the future though.

sbird commented 2 years ago

No, I appreciate you mentioning this! I have been meaning to get the tests working with github actions for a while and this was a good impetus for that.

Python packaging is just a bit of a pain in the arse because it is so absurdly complicated that it has to be automated, and they change the One True Way of doing it so often the automation always breaks.

jobovy commented 2 years ago

Not sure how I ended up on this issue... but for now, perhaps you just want to add --sdist to the python -m build invocation at https://github.com/sbird/fake_spectra/blob/a6ab4943f7a7cf04a21f5aea67148331216f3f34/.github/workflows/python-publish.yml#L39 to just build a source distribution rather than a binary wheel. Building manylinux wheels is ...difficult...

sbird commented 2 years ago

I don't know how you ended up here either but I'm glad you did, because that was the right suggestion! v2.2.2 should be on pip now.

jobovy commented 2 years ago

Glad it helped! If you do want to build binary wheels, I know that many people use cibuildwheel, although I've personally have had issues with it and had to write my own code to build wheels for all different platforms (easy for mac and windows, hard for manylinux).

sbird commented 2 years ago

Thanks, good to know. Wheels for mac and windows would be useful (since in practice linux users will always have a compiler). Do you have a link to the code?

jobovy commented 2 years ago

My code? My code for creating Mac/Windows wheels is here:

https://github.com/jobovy/galpy/blob/main/.github/workflows/build_macosx_windows_wheels.yml

and it requires the conda environments defined under .github. Note that I should switch to using python -m build to build the wheels, but haven't done so yet.

My code for creating manylinux wheels is here:

https://github.com/jobovy/galpy/blob/main/.github/workflows/build_manylinux_wheels.yml

and also requires the files in .github/workflows/actions.

Both of these build wheels for every push to main, but only upload to PyPI for a release.

sbird commented 2 years ago

Thank you @jobovy! Must be some new github AI feature that brought you into this issue...

andreufont commented 2 years ago

@sbird - we can probably close this issue, right? It seems to be working now.

qezlou commented 2 years ago

Yes Andreu, that is correct! but I will be pushing a slight modification to use cibuildwheels for macos. It is useful for those users who do not have a compiler on their machine. After that, we can close this, I guess.

sbird commented 2 years ago

Thanks @mahdiqezlou closing!

qezlou commented 2 years ago

@sbird We need to bump the version to get the GitHub Action pushing the macos wheel to the pip. :) I leave it to your preference.

sbird commented 2 years ago

Done!