Giter Site home page Giter Site logo

catkin_pkg's Introduction

catkin_pkg's People

Contributors

130s avatar aleksandaratanasov avatar clalancette avatar codebot avatar cottsay avatar csukuangfj avatar davetcoleman avatar de-vri-es avatar dirk-thomas avatar dmerejkowsky avatar jbohren avatar k-okada avatar mathias-luedtke avatar matthijsburgh avatar mikaelarguedas avatar mikepurvis avatar nickolaim avatar nuclearsandwich avatar otamachan avatar patrickcjh avatar paulbovbel avatar petrox avatar pierrickkoch avatar rayman avatar rotu avatar seanyen avatar sidfaber avatar swinterbotix avatar tfoote avatar wjwwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catkin_pkg's Issues

Incorrect dependency in ubuntu precise

I think that now, the official repo to install ros hydro for precise is broken.

dpkg: python-catkin-pkg: dependency problems, but configuring anyway as you requested:
python-catkin-pkg depends on python:any (>= 2.7.1-0ubuntu2).
Setting up python-catkin-pkg (0.2.6-1) ...

and following the official instructions it's not possible.

So, I don't know why,
apt-cache policy python:any
python:
Installed: 2.7.3-0ubuntu2
Candidate: 2.7.3-0ubuntu2
Version table:
*** 2.7.3-0ubuntu2 0
500 http://mirrors.kernel.org/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status

is lower than (>= 2.7.1-0ubuntu2), that needs python-catkin-pkg, so I think that there are something wrong with the version numbers.

Validate_package fails because of whitespace

You should strip these before you check their equality.
https://github.com/ros-infrastructure/catkin_pkg/blob/master/src/catkin_pkg/metapackage.py#L120

 git-bloom-generate -y rosrelease groovy --source upstream -i 0
Invalid metapackage:
  Metapackage 'wu_ros_tools': Invalid CMakeLists.txt
Expected:
cmake_minimum_required(VERSION 2.8.3)
project(wu_ros_tools)
find_package(catkin REQUIRED)
catkin_metapackage()


Got:
cmake_minimum_required(VERSION 2.8.3)
project(wu_ros_tools)
find_package(catkin REQUIRED)
catkin_metapackage()


Refusing to release invalid metapackage 'wu_ros_tools', metapackage requirements:

catkin_create_pkg should fill system deps and CATKIN_DEPENDS

The new CATKIN_DEPENDS and DEPENDS cmake macro arg should be initialized by default

I imagine we could extend the create script so that this syntax:

catkin_create_pkg foo roscpp --system BZip2 --boost thread regex

creates this CMakeLists.txt snippets:

find_package(catkin REQUIRED COMPONENTS roscpp)
find_package(Boost REQUIRED COMPONENTS regex thread)
find_package(BZip2 REQUIRED)
catkin_package(
  # INCLUDE_DIRS include
  # CATKIN-DEPENDS roscpp
  # DEPENDS BZip2
  )
# target_link_libraries(rosbag 
#     ${catkin_LIBRARIES}
#     ${Boost_LIBRARIES} 
#     ${BZIP2_LIBRARIES})

Dirk to advise whether the above example is correct and makes sense.

I can create a pull request if others agree.

catkin_create_meta_pkg

I think the title is self-descriptive.

An alternative could be to create an option to keep the pkg philosophy: catkin_create_pkg --meta pkgname (not sure, but the rest of options might be valid as well).

The idea is to have a template for meta packages, similar to what catkin_create_pkg does, just to make things easier and error-prone.

UnicodeEncodeError at changelog.py

Described here.

I've looked at the code (/catkin_pkg/changelog.py) wondering if I could hack it or at least if I could find a way to unit test, but I found it's beyond me..thus I can't provide reproduction scenario other than running bloom-release as described in the question thread above.

catkin_create_pkg should not create empty required folders -> incompatible with git

Moved from ros/catkin#469, filled by @SeveQ

catkin_create_pkg should not leave empty folders in package directories, that is it should at least create an empty dummy file. Some folders (like the include folder) seem to be required by catkin_make but don't get added to a git repository since git doesn't know how to handle empty folders. If you intend to manage revisions of a catkin workspace through git you end up having to create the missing folders by hand.

Alternatively there should be a command or something to re-create the missing folders in a cloned catkin workspace.

catkin_create_pkg could hint at _EXPORTED_TARGETS

Moved from ros/catkin#548 filled by @tkruse:

The CMakeLists.txt created by catkin_create_pkg contains a lot of help and templates to guide users into writing clean catkin packages.

I suggest adding a small block to encourage users to use the ${catkin_EXPORTED_TARGETS} variable in add_dependencies when using e.g. messages/dynamic_reconfigure from other packages. The help text should IMO explicitly mention message generation and dynamic_reconfigure. possibly it could mention build performance effects, though I am not in favor of that.

Missing docutils dependency

I was running bloom-release and received the following error:

==> git-bloom-generate -y rosrelease hydro --source upstream -i 1
rosdep was not detected, please install it.
<== Error running command '['/usr/bin/git-bloom-generate', '-y', 'rosrelease', 'hydro', '--source', 'upstream', '-i', '1']'
Release failed, exiting.

After investigating the code, it looks like bloom is failing on this line in debian/generator.py:

from catkin_pkg.changelog import get_changelog_from_path

When I try that line in iPython, it says docutils could not be found in catkin_pkg/changelog.py:

In [1]: from catkin_pkg.changelog import get_changelog_from_path
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/home/vagrant/ws/src/rospy_message_converter/<ipython-input-1-0a30714053c0> in <module>()
----> 1 from catkin_pkg.changelog import get_changelog_from_path

/usr/lib/pymodules/python2.7/catkin_pkg/changelog.py in <module>()
     43 
     44 import dateutil.parser
---> 45 import docutils
     46 import docutils.core
     47 import logging

If I apt-get install python-docutils, everything works fine.

For reproducing, this is a clean install of Ubuntu 12.04.2 server edition. I only ran sudo apt-get python-rosdep python-bloom then used rosdep to install all the ROS dependencies for my package.

Invalid topological sort

There is a bug in topological sorting, that I noticed when I tried to understand the sorting around message generators. Basically, if we add a new message generator genfoo that depends not only on genmsg, but also on other catkin packages, then the algorithm in test_topological_order may put a foo_msgs package before genfoo in the topological ordering, because other packages that depend only on genmsg will come first.

To reproduce, add this test to test_topological_order:

    def test_sort_decorated_packages_message_gens(self):
        mock1 = Mock()
        mock2 = Mock()
        mock3 = Mock()

        # here package mock1 has to come after mock3, because of
        # message generation.
        mock1.depends_for_topological_order = set()
        mock2.depends_for_topological_order = set()
        mock3.depends_for_topological_order = set(['mock2'])
        mock3.message_generator = True

        projects = {'mock3': mock3, 'mock2': mock2, 'mock1': mock1}

        sprojects = _sort_decorated_packages(projects)
        self.assertEqual([[mock2.path, mock2.package],
                          [mock3.path, mock3.package],
                          [mock1.path, mock1.package]], sprojects)

This test fails, but ought to pass. I could not see an easy clean fix to the algorithm in _sort_decorated_packages().

One idea for a fix would be: "As long as there are still any message_generators in the packages set, only select those packages without dependencies for candidates, which are also dependet upon (transitively) by message_generator packages."

This needs some additional subtree traversal in each loop iteration, so I'll leave that for later or someone else. It is not high priority I guess, since no message_generator exists for which this breaks (to our knowledge)

pypi package should depend on empy

On a fresh OSX install, I get the following error after installing catkin_pkg using pip and invoking catkin_make_isolated:

==> Processing catkin package: 'catkin'
==> Creating build directory: 'build_isolated/catkin'
==> cmake /Users/osrf/ws/src/catkin -DCATKIN_DEVEL_PREFIX=/Users/osrf/ws/devel_isolated/catkin -DCMAKE_INSTALL_PREFIX=/Users/osrf/ws/install_isolated in '/Users/osrf/ws/build_isolated/catkin'
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /Users/osrf/ws/devel_isolated/catkin
-- Using CMAKE_PREFIX_PATH: 
-- Found PythonInterp: /usr/bin/python (found version "2.7.5") 
-- Using default Python package layout
-- Could NOT find PY_em (missing:  PY_EM) 
CMake Error at cmake/empy.cmake:28 (message):
  Unable to find either executable 'empy' or Python module 'em'...  try
    installing package 'python-empy'
    Call Stack (most recent call first):
      cmake/all.cmake:135 (include)
        CMakeLists.txt:8 (include)

It works after sudo pip install EmPy. Perhaps the pip dependencies could be modified?

`catkin_make --pkg` includes CMakeLists from all packages in workspace, not just those needed to build the requested packages

Running catkin_make --pkg is a useful way to debug some buildsystem errors, but currently CMakeLists from all packages in the workspace are incldued in the configuration step, instead of just the packages which are in the dependency tree of the requested packages.

Shouldn't catkin_make --pkg only include CMakeLists from the packages which are to be built? This would speed up partial workspace builds as well as make it easier to debug facets of a workspace.

catkin_tag_changelog fails to detect forthcoming in truncated changelog

Moved from ros/catkin#449, filled by @tfoote:

It failed on this changelog:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package tf2_py
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* splitting rospy dependency into tf2_py so tf2 is pure c++ library.

catkin_prepare_release has the same problem:

catkin_prepare_release --bump minor
Repository type: git
Found packages: tf2_geometry_msgs, tf2_bullet, geometry_experimental, tf2_tools, tf2_py, test_tf2, tf2_ros, tf2, tf2_msgs, tf2_kdl
<string>:136: (ERROR/3) Unknown target name: "cache_time".
Warning: the following packages do not have a changelog file or entry for the to be released version: tf2_py
Continue without changelogs [y/N]?n
Skipping release, populate the changelog with 'catkin_generate_changelog' or manually.

catkin_create_pkg fails when running tutorial

Hi,
I am following the catkin tutorial [0] and encounter the following error:
$catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
Traceback (most recent call last):
File "/usr/bin/catkin_create_pkg", line 60, in
main()
File "/usr/bin/catkin_create_pkg", line 53, in main
newfiles={})
File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 146, in create_package_files
newfiles[os.path.join(target_path, PACKAGE_MANIFEST_FILENAME)] = create_package_xml(package_template, rosdistro)
File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 205, in create_package_xml
package_xml_template = read_template_file(PACKAGE_MANIFEST_FILENAME, rosdistro)
File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 97, in read_template_file
raise ValueError('Unknown distro' % rosdistro)
TypeError: not all arguments converted during string formatting

I don't know if I missed something before running that command. Can anyone reproduce this bug?
Regards,
Oier
[0] http://www.ros.org/wiki/ROS/Tutorials/catkin/CreatingPackage

Travis CI is failing, not reproducable locally

======================================================================
ERROR: test_version_and_date_from_title (test.test_changelog.TestSectionTitleParsing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/ros-infrastructure/catkin_pkg/test/test_changelog.py", line 21, in test_version_and_date_from_title
    self.assertRaises(InvalidSectionTitle, version_and_date_from_title, title)
  File "/usr/lib/python2.7/unittest/case.py", line 471, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/travis/build/ros-infrastructure/catkin_pkg/src/catkin_pkg/changelog.py", line 294, in version_and_date_from_title
    date = dateutil.parser.parse(date_str)
  File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/dateutil/parser.py", line 748, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/dateutil/parser.py", line 310, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
TypeError: 'NoneType' object is not iterable

The same issue appears to be here: karan/TPB#35

test_depend is not used in topological_order().

See http://answers.ros.org/question/115991/how-do-i-conditionally-include-a-catkin-component-only-for-testing/ for more details.

I believe the problem I'm seeing (where my find_package(<test_dependency>) is not found the first time I catkin_make but is found subsequent times I catkin_make) is caused by the fact that topological_order() ignores test_depend tags. If it did not ignore it, my test dependency package(s) would be available when cmake processed my package that depends on them for testing.

As it is, I need an external script to call catkin_make twice, once to build everything except tests, and a second time to build tests.

improve parse_package_for_distutils

parse_package_for_distutils was apparently written to make it easier to write a setup.py file based on information contained in setup.py. The API returning a dict that can be passet to setup(**dict) is concise and powerful.

However the call is quite cryptic and the application requires much more knowledge of python and setuptools than what a novice python programmer has. IMHO this should be made much easier to read and write.

I suggest (also) providing a catkin_setup() function to replace this:

d = parse_package_for_distutils()
d['packages'] = ['roslaunch']
d['package_dir'] = {'': 'src'}
d['scripts'] = ['scripts/roscore',
                'scripts/roslaunch',
                'scripts/roslaunch-deps',
                'scripts/roslaunch-logs']
d['install_requires'] = ['genmsg', 'genpy', 'roslib', 'rospkg']
setup(**d)

with something like this:

catkin_setup(
    packages=['roslaunch']
    package_dir={'': 'src'}
    scripts=['scripts/roscore',
             'scripts/roslaunch',
             'scripts/roslaunch-deps',
             'scripts/roslaunch-logs']
    install_requires=['genmsg', 'genpy', 'roslib', 'rospkg'])

This API also allows people to compare their setup.py with the documentation of distutils.

catkin_setup() may also take additional kwargs to pass to disutials setup(), provided they do not conflict with package.xml.

catkin_create_pkg: should handle catkin as a dependency

If I run catkin_create_pkg foo catkin ros_comm some odd things will be generated. For example:

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS catkin ros_comm)

Also, even if catkin isn't specified as a dependency from the cli it should be in the package.xml as a build (buildtool?) dependency always.

The changelog parsing doesn't seem to pick up only one version section

This will break it:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package pcl_conversions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.1 (2013-07-18)
------------------
* Initial backport to Groovy

If you call catkin_test_changelog on this file will return nothing, which also affects other tools like catkin_prepare_release.

Adding another section will allow the tools to see both sections, like this:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package pcl_conversions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.2 (2013-07-19)
------------------
* asfd

0.0.1 (2013-07-18)
------------------
* Initial backport to Groovy

catkin_pkg does not fail for duplicate packages sometimes

In packages.py find_package_paths:

basename = os.path.basename(dirpath)
if basename not in paths:
     paths.append(os.path.relpath(dirpath, basepath))

this compares basepaths to relative paths ( we append relative paths to paths, but always compare only the basepath).

Should check basepath. Duplicate check is done in find_packages.

This cannot reliably be reproduced, as the order in which paths are crawled is not deterministic.
E.g. crwaling genlisp, underlay/genlisp in that order causes the latter not to be added, whereas crawling
underlay/genlisp, genlisp adds both.

Duplicate package errors while calculating topological order with underlayed workspaces

#87 added support of underlay workspaces while calculating topological order of catkin packages. Since this patch has been introduced and released I am getting the following errors when I invoke catkin_make in a workspace that overlays another workspace /opt/orocos/hydro where the package is found more than once:

Multiple packages found with the same name "rtt":
- share/rtt
- src/orocos_toolchain/rtt

In this case the package rtt is found in the overlayed workspace's src folder and in the share folder. I installed this workspace with the root folder as install-space, overwriting the default install/ subfolder destination, which - I assume - is not forbidden and resembles the layout of the /opt/ros/hydro install-space.

But even with the standard workspace layout as depicted here the underlay workspace support introduced in #87 is invalid if the overlayed workspace is a devel-space as find_packages() will not find any package.xml in the devel/ folder directly. catkin invokes the topological_order() function with a list of overlayed workspaces as defined by the CMAKE_PREFIX_PATH, which does not contain the root paths of the workspaces but of the respective devel- or install-spaces. Instead, topological_order() should search for packages in the respective ROS_PACKAGE_PATH of the overlayed workspaces, namely in the share subfolder for install-spaces and in the source folders as listed in the .catkin marker file in case of devel-spaces.

Steps to reproduce:

cd /tmp
mkdir -p underlay_ws/src overlay_ws/src

# create, build and install a package in the underlay workspace:
cd underlay_ws/src
catkin_create_pkg underlay_pkg
cd ../..
catkin_make -C underlay_ws -DCMAKE_INSTALL_PREFIX=/tmp/underlay_ws install
source underlay_ws/setup.sh

# create, build and install a package in the underlay workspace:
cd overlay_ws/src
catkin_create_pkg overlay_pkg underlay_pkg
cd ../..
catkin_make -C overlay_ws

will result in

/opt/ros/hydro/share/catkin/cmake/em/order_packages.cmake.em:23: error: <type 'exceptions.RuntimeError'>: Multiple packages found with the same name "underlay_pkg":
- share/underlay_pkg
- src/underlay_pkg
Traceback (most recent call last):
  File "/usr/bin/empy", line 3288, in <module>
    if __name__ == '__main__': main()
  File "/usr/bin/empy", line 3286, in main
    invoke(sys.argv[1:])
  File "/usr/bin/empy", line 3269, in invoke
    interpreter.wrap(interpreter.file, (file, name))
  File "/usr/bin/empy", line 2273, in wrap
    self.fail(e)
  File "/usr/bin/empy", line 2264, in wrap
    apply(callable, args)
  File "/usr/bin/empy", line 2337, in file
    self.safe(scanner, done, locals)
  File "/usr/bin/empy", line 2379, in safe
    self.parse(scanner, locals)
  File "/usr/bin/empy", line 2399, in parse
    token.run(self, locals)
  File "/usr/bin/empy", line 1410, in run
    interpreter.execute(self.code, locals)
  File "/usr/bin/empy", line 2576, in execute
    exec statements in self.globals
  File "<string>", line 17, in <module>
  File "/usr/lib/pymodules/python2.7/catkin_pkg/topological_order.py", line 108, in topological_order
    for path, package in find_packages(workspace).items():
  File "/usr/lib/pymodules/python2.7/catkin_pkg/packages.py", line 96, in find_packages
    raise RuntimeError('\n'.join(duplicates))
RuntimeError: Multiple packages found with the same name "underlay_pkg":
- share/underlay_pkg
- src/underlay_pkg
CMake Error at /opt/ros/hydro/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/tmp/overlay_ws/build/catkin_generated/env_cached.sh
  "/usr/bin/empy" "--raw-errors" "-F"
  "/tmp/overlay_ws/build/catkin_generated/order_packages.py" "-o"
  "/tmp/overlay_ws/build/catkin_generated/order_packages.cmake"
  "/opt/ros/hydro/share/catkin/cmake/em/order_packages.cmake.em") returned
  error code 1
Call Stack (most recent call first):
  /opt/ros/hydro/share/catkin/cmake/em_expand.cmake:23 (safe_execute_process)
  /opt/ros/hydro/share/catkin/cmake/catkin_workspace.cmake:29 (em_expand)
  CMakeLists.txt:63 (catkin_workspace)


-- Configuring incomplete, errors occurred!
Invoking "cmake" failed

Used versions:

$ dpkg -l ros-hydro-catkin python-catkin-pkg 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                                       Description
+++-=============================================-=============================================-==========================================================================================================
ii  python-catkin-pkg                             0.2.2-1                                       catkin package library
ii  ros-hydro-catkin                              0.5.88-0precise-20140617-0052-+0000           Low-level build system macros and infrastructure for ROS.

Python3.2: Writing file fails

Bug #64 being locally fixed, we get:

Traceback (most recent call last):
File "/usr/local/bin/catkin_create_pkg", line 71, in
main()
File "/usr/local/bin/catkin_create_pkg", line 64, in main
newfiles={})
File "/usr/local/lib/python3.2/dist-packages/catkin_pkg/package_templates.py", line 213, in create_package_files
_safe_write_files(newfiles, target_path)
File "/usr/local/lib/python3.2/dist-packages/catkin_pkg/package_templates.py", line 189, in _safe_write_files
fhand.write(content)
TypeError: 'str' does not support the buffer interface

Reported using Ubuntu 12.04, python3.2 and latest python-catkin-pkg from apt.

According to StackOverflow, this can be fixed doing:

-fhand.write(content)
+fhand.write(bytes(content, 'UTF-8'))

but this code should be made python2/3 compatible.

catkin_create_pkg beginner_tutorials doesn't create src

Hello,
when running catkin_create_pkg beginner_tutorials std_msgs rospy roscpp, it just creates the files CMakeLists.txt and package.xml. In order to follow the tutorial, building a package, src should have been created, right?
Regards,
Oier

templates should also generate run_depend

Since it seems most of our build_depend tags will be run_depend tags as well in the foreseeable future, i suggest also generating those. Users will not see the point of having to copy, paste and replace every single time. Also IMHO the comment should explain that run_depend really means "install depend", as header-only packages also need to declare this. See ros/catkin#260

In any case fixing this will also impact
http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage
remember to fix there as well.

I can create a pull request if that helps, though it should not be a lot of changes.

add template for hydro

Apparently, this is needed for creating ROS Android repos. This is the error I get:

catkin_create_android_repo rocon_android_apps rosjava_core android_core android_extras android_apps
Created repo file: /opt/android_workspace/ros_android/src/rocon_android_apps/settings.gradle
Created repo file: /opt/android_workspace/ros_android/src/rocon_android_apps/build.gradle
Created repo file: /opt/android_workspace/ros_android/src/rocon_android_apps/CMakeLists.txt
[error] Could not read template for ROS distro 'hydro' at '/usr/local/lib/python2.7/dist-packages/catkin_pkg/templates/hydro/package.xml.in': no such file or directory : <type 'exceptions.IOError'>

And looking into /usr/share/pyshared/catkin_pkg/templates/ there is indeed nothing for hydro, but only groovy.

Document the package releasing workflow

I'm not sure where this should go, in the ros.org wiki, as a tutorial, along with the bloom tutorials, I dunno.

But this workflow should be documented:

$ catkin_generate_changelog [--all]
$ catkin_tag_changelog
# Edit and commit
$ catkin_prepare_release

catkin_create_package: doesn't install template resources

In the pip and debian distributions there are no templates:

∫ dpkg -L python-catkin-pkg
/.
/usr
/usr/bin
/usr/bin/catkin_create_pkg
/usr/share
/usr/share/python-support
/usr/share/python-support/python-catkin-pkg.public
/usr/share/pyshared
/usr/share/pyshared/catkin_pkg
/usr/share/pyshared/catkin_pkg/package.py
/usr/share/pyshared/catkin_pkg/packages.py
/usr/share/pyshared/catkin_pkg/package_templates.py
/usr/share/pyshared/catkin_pkg/__init__.py
/usr/share/pyshared/catkin_pkg/topological_order.py
/usr/share/pyshared/catkin_pkg-0.1.4.egg-info
/usr/share/doc
/usr/share/doc/python-catkin-pkg
/usr/share/doc/python-catkin-pkg/changelog.Debian.gz

Therefore when I run catkin_create_package I get this, incorrect, error:

∫ catkin_create_pkg foo catkin ros_comm
Traceback (most recent call last):
  File "/usr/bin/catkin_create_pkg", line 60, in <module>
    main()
  File "/usr/bin/catkin_create_pkg", line 53, in main
    newfiles={})
  File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 146, in create_package_files
    newfiles[os.path.join(target_path, PACKAGE_MANIFEST_FILENAME)] = create_package_xml(package_template, rosdistro)
  File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 205, in create_package_xml
    package_xml_template = read_template_file(PACKAGE_MANIFEST_FILENAME, rosdistro)
  File "/usr/lib/pymodules/python2.7/catkin_pkg/package_templates.py", line 97, in read_template_file
    raise ValueError('Unknown distro' % rosdistro)
TypeError: not all arguments converted during string formatting

python-catkin-pkg and python3-catkin-pkg cannot both be installed side-by-side

The root problem seems to be the fact that both packages install scripts in /usr/bin with the same names, like catkin_create_package and catkin_tag_changelog.

This is clearly contrary to the Debian and Ubuntu intention to support both Python dialects side by side. I did some poking around to see how they recommend doing it. I didn't find any good documentation on that, so I experimented with the .deb releases of python-sphinx and python3-sphinx.

Those packages can be installed side-by-side. Each version installs its scripts in different directories:

  • /usr/share/sphinx/scripts/python
  • /usr/share/sphinx/scripts/python3

Then, they symlink one or the other set of scripts into /usr/bin. So far, I don't see how that was done.

On my Trusty system, the python versions are selected. I don't know if that is because Python 2 is the default version, or because I installed python-sphinx first. I don't see anything in /etc/alternatives or /var/lib/dpkg/alternatives.

Surely, there is a reasonable solution to this packaging problem.

Python3.2: TypeError: unorderable types: Dependency()

There is a bug in package_templates.py, that in some cases leads to this error:

$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
Traceback (most recent call last):
  File "/usr/local/bin/catkin_create_pkg", line 71, in <module>
    main()
  File "/usr/local/bin/catkin_create_pkg", line 64, in main
    newfiles={})
  File "/usr/local/lib/python3.2/dist-packages/catkin_pkg/package_templates.py", line 208, in create_package_files
    create_package_xml(package_template, rosdistro)
  File "/usr/local/lib/python3.2/dist-packages/catkin_pkg/package_templates.py", line 395, in create_package_xml
    for dep in sorted(dep_map[dep_type], key=lambda x: x.name):
TypeError: unorderable types: Dependency() < Dependency() 

While the actual command runs fine for me, I can see the error in the code:

for dep in catkin_deps:
    ...
    pkg_catkin_deps.append(Dependency(dep))
for dep in pkg_catkin_deps:
    build_depends.append(Dependency(dep))

The first loop adds Dependency objects to pkg_catkin_deps, the second one adds new Dependency objects passing Dependency objects instead of strings to the constructor.

Not sure what exactly is required to reproduce, but I guess you can take it from here. Fix should be e.g.:

    -pkg_catkin_deps.append(Dependency(dep))
    +pkg_catkin_deps.append(dep)

catkin_generate_changelog should escape words ending with underscore

I automatically generated change logs for my packages using my git log using:

catkin_generate_changelog

Then I prepare the release and I get error messages like:

<string>:21: (ERROR/3) Unknown target name: "plugin_loaded".

After discussing this issue with @wjwwood in this issue: ros-infrastructure/bloom#189 I learned the error was because I had git commits saying things like

* gazebo_ros_api_plugin: set plugin_loaded_ flag to true in

Where plugin_loaded_ is a member variable that I am discussing.

This will throw an error with the RST Changelog format because RST treats those as link targets.

I propose that catkin_generate_changelog automatically escape these words to read, for example:

* gazebo_ros_api_plugin: set ``plugin_loaded_`` flag to true in

This seems to be the most intuitive default behavior because it won't generate unexpected errors without good explanations. In the meantime I have documented this issue in the bloom release tutorial.

Changelog generator should make runtime error more explicit

When changelog_generator cannot parse the previous version number, the raise here:

raise RuntimeError('Could neither find section "%s" nor any other section' % tag.name)

just prints

Updating forthcoming section of changelog files...
- updating '[...]/CHANGELOG.rst'
- updating '[...]/CHANGELOG.rst'
Could neither find section "None" nor any other section

The first time I saw this I did not recognize it as an error. Maybe the script should explicitly say "ERROR". It could also go on with updating the rest of the changelogs in the repository and print a summary at the end (e.g. "Updated changelogs in 4 packages, update of 2 packages failed: ")

Invalid package manifest because of version number convention

Hello,
I am trying to migrate my code to Groovy and encounter a strange error when running cmake.
Traceback (most recent call last):
File "/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py", line 50, in
main()
File "/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py", line 42, in main
package = parse_package(args.package_xml)
File "/usr/lib/pymodules/python2.7/catkin_pkg/package.py", line 309, in parse_package
return parse_package_string(f.read(), filename)
File "/usr/lib/pymodules/python2.7/catkin_pkg/package.py", line 439, in parse_package_string
pkg.validate()
File "/usr/lib/pymodules/python2.7/catkin_pkg/package.py", line 158, in validate
raise InvalidPackage('\n'.join(errors))
catkin_pkg.package.InvalidPackage: Invalid package manifest "/home/oier/bertsobot/bertsobot/package.xml": Package version "0.1" does not follow version conventions
CMake Error at /opt/ros/groovy/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python
/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py
/home/oier/bertsobot/bertsobot/package.xml
/home/oier/bertsobot/bertsobot/build/catkin_generated/package.cmake)
returned error code 1
Call Stack (most recent call first):
/opt/ros/groovy/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/groovy/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)
/opt/ros/groovy/share/catkin/cmake/catkin_package.cmake:74 (catkin_package_xml)
CMakeLists.txt:7 (catkin_package)

the offending code in package.xml:

bertsobot
0.1
bertsobot
....
Changing the version number doesn't affect it. I searched for a version numbering convention but didn't find anything, am I missing something?
Regards,
Oier

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.