lopsided98 / nix-ros-overlay

ROS overlay for the Nix package manager
Apache License 2.0
192 stars 77 forks source link

setup.py deprecation #314

Closed Educorreia932 closed 12 months ago

Educorreia932 commented 12 months ago

Trying to build a Python package, with colcol build command, using ROS 2 Iron distribution, I get a warning related to the deprecation of setup.py.

 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()

According to ROS forums, I should be using setuptools with version 58.2.0, but the one bundled with my environment is 68.0.0.post0.

How can I downgrade it?

This is my flake.nix for reference:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    ros-overlay.url = "github:lopsided98/nix-ros-overlay";
  };

  outputs = { nixpkgs, flake-utils, ros-overlay, ... }:
    with nixpkgs.lib;
    with flake-utils.lib;

    eachSystem allSystems (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          overlays = [ ros-overlay.overlays.default ];
        };
      in
      {
        devShells.default = with pkgs; mkShell {
          buildInputs = with rosPackages.iron; [
            (buildEnv {
              paths = [
                # ROS packages
                ament-cmake-core
                colcon
                ros-core
                rqt
                rqt-action
                rqt-common-plugins
                rqt-gui
                rqt-gui-cpp
                rqt-gui-py
                turtlesim
                ros2pkg
              ];
            })
          ];
        };
      });
}
lopsided98 commented 12 months ago

You'll find this warning in the logs of pretty much every Python package in nixpkgs. I don't think there's any concrete plans to actually remove this functionality. It was technically deprecated even in 58.2.0 (and earlier); there's just no warning there. IMO it's on colcon to move to a modern approach, but I'm pretty sure this is difficult to do without breaking a lot of packages. Until then, I suggest you ignore the warning.