meridionaljet / py3grads

Python 3 Interface to GrADS
29 stars 10 forks source link

Unable to install with Python 3.11, setuptools deprecation warnings #3

Closed mzuranski closed 1 year ago

mzuranski commented 1 year ago

I just tried to install py3grads in a fresh conda environment. I ran python setup.py install and there's the output I saw, py3grads was not installed when it was done.

$ python setup.py install
/home/zuranski/miniconda3/envs/models3/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/home/zuranski/miniconda3/envs/models3/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
zip_safe flag not set; analyzing archive contents...

As a work-around I remade my conda environment with setuptools=58.2.0 (last version before those deprecation warnings), this also installed Python 3.9 and this time the install ran successfully. I'm not sure if it was setuptools itself that caused this or something else, either way it seems py3grads needs an updated way to install in newer environments.

meridionaljet commented 1 year ago

Thanks for the report -- the ecosystem is leaving setup.py behind. I've switched this project to using pyproject.toml as of the v2023.6.30 tag that I just pushed. This should allow installation via pip install git+https://github.com/meridionaljet/py3grads

mzuranski commented 1 year ago

Thank you! I verified this solution works by spinning up a new conda env and the above pip command worked. Python 3.11, setuptools 68.0.0.

This package gets some good use, thanks for keeping it alive!