From 11f8df9cc1d10a0ec5a50520a9957153d148a89a Mon Sep 17 00:00:00 2001 From: v4hn Date: Tue, 5 Nov 2024 11:20:04 +0100 Subject: [PATCH] do not create a python package ... where there is no package. Only a script was installed from the setup.py but catkin provides a separate command for that http://docs.ros.org/en/jade/api/catkin/html/howto/format2/installing_python.html I retained the installation to the global path. It is unusual to do that, but it has been like that for a long time. This started failing with recent setuptools with the following error message: --- error: Multiple top-level packages discovered in a flat-layout: ['debian', 'config', 'launch']. To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build. If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options: 1. set up custom discovery (`find` directive with `include` or `exclude`) 2. use a `src-layout` 3. explicitly set `py_modules` or `packages` with a list of names To find more information, look for "package discovery" on setuptools docs. --- --- fetch_calibration/CMakeLists.txt | 8 ++++++-- fetch_calibration/package.xml | 2 -- fetch_calibration/setup.py | 10 ---------- 3 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 fetch_calibration/setup.py diff --git a/fetch_calibration/CMakeLists.txt b/fetch_calibration/CMakeLists.txt index de157c1f..a4e4b842 100644 --- a/fetch_calibration/CMakeLists.txt +++ b/fetch_calibration/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.0.2) project(fetch_calibration) find_package(catkin) -catkin_python_setup() catkin_package() install(DIRECTORY config @@ -13,7 +12,12 @@ install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install( +catkin_install_python( PROGRAMS scripts/camera_reconfigure.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) + +catkin_install_python( + PROGRAMS scripts/calibrate_robot + DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) diff --git a/fetch_calibration/package.xml b/fetch_calibration/package.xml index 2c2c9520..f5730e3a 100644 --- a/fetch_calibration/package.xml +++ b/fetch_calibration/package.xml @@ -20,8 +20,6 @@ https://github.com/fetchrobotics/fetch_ros catkin - python-setuptools - python3-setuptools robot_calibration diff --git a/fetch_calibration/setup.py b/fetch_calibration/setup.py deleted file mode 100644 index cd991806..00000000 --- a/fetch_calibration/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup -from catkin_pkg.python_setup import generate_distutils_setup - -d = generate_distutils_setup( - scripts=['scripts/calibrate_robot'], - ) - -setup(**d)