-
Notifications
You must be signed in to change notification settings - Fork 49
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
setup.py deprecation warning #454
Comments
Looks like the Python build process should be moved over to something that follows PEP 517 (https://www.python.org/dev/peps/pep-0517/)
|
I'm testing some colcon extensions on Ubuntu Jammy 22.04, but noticed the same spammy deprecation notice:
Guessing we should stop directly executing setup.py files and be call a dedicated python build backend instead? https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html |
At our project we try to follow strategy "no warnings during builds/treat all warnings as errors". Is there a way to change our python packages structure/setup.py content/whatever, to remove those warnings? Do we need to change something in our packages or is this an issue only with colcon and we need to live with those warnings till a fix in colcon is implemented? |
You could try and install the master branch of https://github.com/colcon/colcon-python-setup-py via pip and see if that solves the issue. |
AFAIK I already have the latest version (0.2.7):
This issue doesn't occur for setuptools 45.2.0 (which are rather old but still used in the latest official ros:galactic image), however it occurs for setuptools >= 60. |
What's on pypi is behind the master branch. |
Ok, so another try:
I'm probably missing something. |
I've prepared reproducible example using docker:
when I run command
I get the same warning at the end:
|
No probably not, it was just a suggestion. Good to know it still isn't fixed. |
IIUC, we can continue to use I suppose since However, it appears the Python community is moving towards using pyproject.toml files for describing package metadata (PEP 621). Also, I think a pyproject.toml may be necessary to leverage modern build front-ends like build, which may make colcon's job easier (e.g. if we replaced setup.py CLI calls with build's CLI). Switching to pyproject.toml files everywhere would probably cause a lot more churn than some other solution, I don't know. It might be worth noting Whatever the ultimate solution is, it looks like it may involve updating downstream Python packages still relying on invoking the setup.py CLI. We can keep colcon's current implementation for building Python packages as fallback behavior if the downstream package is not updated to use a static description (e.g. setup.cfg or pyproject.toml). In the meantime, users can explicitly quiet the deprecation warning if it bothers them with a filter. For example, by setting the following environment variable:
|
In addition, I get |
I've noticed the
however, ultimately I think these warnings should all be resolved when colcon can build packages without a setup.py. |
Okay, thanks for the confirmation! We'll silence them an wait for a patched colon. 😃 |
Still seems to be an open issue, although the package still works as expected after building:
@dirk-thomas is anyone currently working on this or has there been any determination on the desired direction to head in resolving it (so we can help contribute to that effort)? |
I believe @cottsay is working on this issue. |
any news on this? :) |
This is a complicated change, and I don't have a lot of good news. The new APIs that the Python folks are pushing us towards will regress the experience here in multiple ways.
I know that folks hate warning messages. I hear you. Implementing this change right now with the tools and APIs available will likely do more harm than good. Please take comfort in the fact that even the new pyproject.toml APIs which use setuptools under the hood are relying on setuptools itself to suppress it's own warning and invoke itself similar to how we invoke it here. If you simply can't ignore the warning, please familiarize yourself with the |
Quite a similar discussion is at ament_cmake repo: |
I tried to downgrad setuptools to 58.2.0 by
|
yeah i have the same issue with Humble with ubuntu 22.04.1 even after trying what you did |
This is an unrelated flake8 issue that is tracked in https://bugs.launchpad.net/ubuntu/+source/python-flake8/+bug/1968072, so it has nothing to do with this ticket. |
58.3.0 or newer setuptools have deprecated setup.py. https://setuptools.pypa.io/en/latest/history.html#v58-3-0 We still need to use the old version: colcon/colcon-core#454 (comment)
58.3.0 or newer setuptools have deprecated setup.py. https://setuptools.pypa.io/en/latest/history.html#v58-3-0 We still need to use the old version: colcon/colcon-core#454 (comment)
We'll be discussing this topic at the Infrastructure Community Meeting on May 17: https://discourse.ros.org/t/infrastructure-community-meeting-2023-05-17/31268 |
I've issued a Call For Testing on a prototype package based on the PEPs discussed here: https://discourse.ros.org/t/call-for-testing-standards-based-python-packaging-with-colcon/32008 If you're interested in seeing these deprecation warnings disappear, please take a moment to provide feedback. |
Whats the current state of this issue? |
The prototype is available and working, but there are problems with symlink installs and general performance. PEP 660 with setuptools is currently ignoring If you're interested in this landing sooner, please consider trying the prototype package and providing feedback. |
Is there any way to download this prototype via pip? |
You can target the git branches directly using pip, but I don't think it's a good idea at all. Pip has a tendency to tangle up your system and it might make it difficult to revert back to the non-prototype packages. |
As in PR #626, it would be beneficial to suppress this error by default as well:
colcon-core/colcon_core/task/python/build.py Lines 28 to 32 in 98e30ff
The updated implementation could look like this: _PYTHON_CMD = [
sys.executable,
'-W',
'ignore:setup.py install is deprecated',
'-W',
'ignore:easy_install command is deprecated',
] Would it make sense to suppress this error too?" |
Hi, when building Python packages in ROS 2 Galactic the following warning is produced
is there a plan to change the installation logic to get rid of it?
I'm not expert at all of python packaging, but would it be sufficient to replace the
setup.py
calls withpython -m build
?The text was updated successfully, but these errors were encountered: