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

python setup.py gives deprecation warnings #1797

Closed
seisman opened this issue Mar 9, 2022 · 1 comment · Fixed by #1823
Closed

python setup.py gives deprecation warnings #1797

seisman opened this issue Mar 9, 2022 · 1 comment · Fixed by #1823
Assignees
Labels
maintenance Boring but important stuff for the core devs
Milestone

Comments

@seisman
Copy link
Member

seisman commented Mar 9, 2022

In our CI workflow, we run commands like python setup.py sdist --formats=zip to build source or binary distributions. The command gives the following deprecation warnings:

SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.

It seems python setup.py is no longer recommended to build distributions.

Reference: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary

@seisman seisman added the maintenance Boring but important stuff for the core devs label Mar 9, 2022
@weiji14 weiji14 added this to the 0.6.1 milestone Mar 14, 2022
@weiji14
Copy link
Member

weiji14 commented Mar 14, 2022

So reading into that blog post, it looks like we'll need to

1. Have make package do python -m build

Specifically, modify the line here:

pygmt/Makefile

Lines 31 to 32 in ba51f80

package:
python setup.py sdist bdist_wheel

And then, we'll need to add build as a dependency in the publish-to-pypi.yml workflow here:

- name: Install dependencies
run: python -m pip install setuptools wheel

Now the above is the minimum we can do. If we want to go for hard mode, it sounds like we can

2. Put everything in pyproject.toml somehow

I.e. remove setup.py, setup.cfg and all those crazy files in the top level directory. So a bit like #1055, but using 'native' pypa tools instead of poetry. But that will require a bit more reading into all those PEPs.

I'd recommend doing 1) for a PyGMT v0.6.1, and maybe save 2) for PyGMT v0.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants