Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have created python package (using Ubuntu Quickly) and want to create deb package. Unfortunatelly Quickly builds package with source python files (.py) and I want not to include source files. The same problem is with Bazaar plugin for building packages.

How can I make deb package without sources which compiles .py files during installation, so there will be no source files in the system?

share|improve this question
    
Are you using distutils? –  Nathan Osman May 15 '12 at 0:03

2 Answers 2

up vote 6 down vote accepted

Python is an interpreted scripting language. You don't just distribute the intermediate .pyc files because they're compiled for your system and won't make sense elsewhere. You distribute the source and that's compiled on the fly.

That's not to say you can't just distribute .pyc files. PEP 3147 allows this and sets out a structure but it does come at a cost and I'm not even sure it would stop you regenerating the source (via various introspection methods) - but this is not what Quickly is designed for; it's not going to help you build a package like this.

If you're trying to distribute a closed source application there are things like py2exe (Windows only) and bbfreeze (all) but none of them are perfect or completely irreversible. You can look at obfuscation methods if you want to further protect your source.

share|improve this answer

There's really no way of hiding Python source code and prevent the users from being able to know what you do to their systems. However, that does not mean that the program has to be Open Source. That depends on the license and you can use which license you want. Being able to read the source code does not mean that the user is allowed to edit it, or redistribute it. That's up to you. This is true for all high-level languages. Web applications, for instance, always have their source code visible to the user. That doesn't mean you are allowed to use it in other projects without the developers permission.

You might want to have a look at the Geanie language. It is a new language that has features similar to Java/C#, but with a syntax that resembles Python. Genie compiles to C, which means it's platform independent, but also that it is extremely fast. And C, of course, compiles to native code.

Unfortunately, Quickly doesn't have templates for Genie yet.

share|improve this answer
1  
the Vala language (used in Gnome) is also similar to what you describe for Geanie... –  rigved Mar 27 '12 at 13:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.