How to package / distribute python applications

I spent countless hours trying to figure it out, and unfortunately, I haven't received an answer yet. Or at least I don’t think I have. First of all, I have to say that I am a Java developer. I just recently started working with Python, and the build process is a bit ... weird for me.

In my opinion, I am writing an application, I compile it, and I package it in .jar for other people. Either as a library, or for end users to execute and enjoy from it. (ignoring things like maven or gradle ...)

I wrote some CLT in python, which consists of ~ 6 files, and I wanted to distribute it. From what I could find, I had to write setup.py, and I found some guides on how to do this, but ... to be honest, I'm not even sure what I did. I could get the source code in tar.gz with some other metadata or create some strange files that I don't know what to do.

Then I found PyInstaller and it did a great job of packing everything in a binary file. However, I ran into some problems trying to create a Debian package, and it made me reevaluate and question the fact that in Python there is nothing (without using an external tool) that allows me to package / bundle / any of my application in one file to run.

And something I can’t omit. I mean ... before tools like PyInstaller and P2Exe appeared, and what not, how did people distribute their applications? Do I intend to write a C application, somehow include python code in it and compile it? Sorry if this seems like a dumb question, but I really ask. I walked a lot and spent so much time on it and did not find a satisfactory answer, so I hope that someone here will help me with this! Thank.

+4
source share

Source: https://habr.com/ru/post/1547758/


All Articles