zhucaoxiang / CoilPy

My personal Python package for plotting and data processing.
https://zhucaoxiang.github.io/CoilPy/
GNU General Public License v3.0
12 stars 2 forks source link

fix: only produce 64 bit builds #2

Closed henryiii closed 2 years ago

henryiii commented 2 years ago

You need to rethink dependencies. You should have a set of build time requirements - these are things you must have to build. Those go into pyproject.toml. Then you should have a set of runtime requirements, those go into install_requires. You can have extra requirements just for testing, those go into an "extra", or into requirements.txt. You should not install requirements.txt for building, but only for testing (before-test). You should not import from your local package inside your setup.py, as you do not need everything installed when setup.py is running. You can use setup.cfg for static stuff, and that might help pull out the version in a nicer way.

You also should not set a username for the pypi upload, it should be the default __token__. You should not push every time there's a change to setup.py, but rather use git tags or GitHub Releases. I recommend reading https://scikit-hep.org/developer, specifically the packaging page. Also https://packaging.python.org/tutorials/packaging-projects/.

henryiii commented 2 years ago

For example, do you need numpy at build time? If so, then use oldest-supported-numpy to make sure you build with the oldest version, so your wheels can be used with any NumPy version. You should never dump all your runtime requirements into build time.

zhucaoxiang commented 2 years ago

@henryiii Thank you very much for your suggestions. I am not an expert in distributing python packages. Your points are helpful.

I will merge your changes first and come back to fix all the issues you mentioned. Thank you again!