Ask Your Question
4

procedure to get catkin_make install generate and copy only pyc and no .py

asked 2014-09-18 16:46:53 -0500

Damien gravatar image

Hi. I need to ship to some client ans application based on ROS. I don't want to provide my source code to this client. So I'm planning to ship a tar.gz of the /install folder of catkin_ws or a .deb.

One starting question: does a .pyc file dependent on my system settings? or will my client have the capability to execute my node since he uses the same version of ubuntu and ros?

Supposing it makes sense to ship a .pyc and not a .py file:

The package packing process will take as input the /install folder. The files that end-up in /install are set in the CMakeList.txt So if I want to ship on .pyc files, I should specify them explicitly in the install section of CmakeList

But

  • If I checkout my svn repo in a clean environment, run catkin_make, I get an error since no pyc files have been generated yet and my Camkefile is inconsistent.

  • This works fine if in Cmakefile I specify to install my_file.py but this is not what I want...

So is there a way to force catkin_make to build all the python in .pyc?

Otherwise I need to run this twice with a change in Cmakelist in between... I have lots of proprietary packages to ship, and this is just not OK.

Thanks for any insights

Damien

edit retag flag offensive close merge delete

Comments

Hi Damein,

Are you able to run your rospy node with this process? I am trying to do the same process for both C++ and python packages. However, it takes a lot of efforts to run a ros from install directory. Let me know if you have some simple way of doing this?

Jarvis gravatar image Jarvis  ( 2014-09-19 21:46:22 -0500 )edit

You can check my post at link text

Jarvis gravatar image Jarvis  ( 2014-09-19 21:46:47 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-09-19 17:33:05 -0500

ahendrix gravatar image

catkin doesn't have any functionality for this.

I'm not even sure compiled python bytecode (.pyc) will run without the original source code.

This stack overflow question has a reasonable overview of the ways to obfuscate and package your python source code.

edit flag offensive delete link more

Comments

The bytecode will run without the source code

Leander Stephen D'Souza gravatar image Leander Stephen D'Souza  ( 2021-01-12 12:56:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-09-18 16:46:53 -0500

Seen: 1,821 times

Last updated: Sep 19 '14