Hey Chris,
as far as I am informed the more modern standard for distribution in Python is 
python wheels. Which already contains the precompiled sources for the platforms 
in case of C extensions and is more or less a plain ZIP for pure Python 
(https://pypi.org/project/wheel/).

The mechanisms for building though are more or less the same as with eggs.

I personally would prefer the 2nd option even if it is slightly more 
uncomfortable for Python users but we avoid confusion with versions and other 
stuff.

Björn

-----Ursprüngliche Nachricht-----
Von: Christofer Dutz <[email protected]> 
Gesendet: Dienstag, 30. April 2019 16:04
An: [email protected]
Betreff: [Python] Adding build support for Python

Hi all,

After streamlining the build for C++ I now started to have a look at the Python 
part.

So in the python world it seems as if usually a setup.py is created and then 
python executes that script to build the project.
From a look at some sample python projects, it looks as if it generally 
contains some information we already have in the maven metadata.

When executing an example build and looking at the result, it looked as if the 
build generates a “egg” (Zip with ending “egg”) that contains unmodified 
versions of the sources and resources. In addition the script seems to generate 
a “egg-info” directory which contains a lot of different text files, these are 
then also included in the egg-zip.

So I think we have multiple options here:

  *   Have maven generate the egg-files from Maven exclusively
  *   Have maven generate a setup.py (by including data from maven to that 
file) and then run “python setup.py install” which then generates everything
  *   Write a setup.py (duplicating data from the pom) and executing a python 
build in the maven build

The last option has the benefit of working out of the box with Python and 
probably any Python IDE (If there is such a thing) but would have the drawback 
that we need to manually adjust it to pom changes (Version during releases) The 
first option would eliminate the need for another build tool (but would also 
eliminate the running of tests or other fancy python stuff) The middle option 
would be a compromise … it wouldn’t work out of the box, but after running 
“mvnw generate-resources” it could generate the missing files and the Python 
IDEs would pick it up.

I think the middle approach sort of feels like the sweet spot at the moment … 
or am I missing something here?
Are there other options, I didn’t mention?

What do you think?


Chris


Reply via email to