How to configure setup.py to distribute egg

James Kelly <[email protected]> Wed, 31 Mar 2021 12:16:00 -0500
Newsgroups gmane.comp.lang.jython.user
Message-ID <CANio7e-fLUq8fvATCLOxE_S3p38_7E3dHFrhBhYZC1wjKz+-7A@mail.gmail.com>
--===============2815881434543098295==
Content-Type: multipart/alternative; boundary="00000000000076615f05bed845a9"

--00000000000076615f05bed845a9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I=E2=80=99m using Netbeans with Python and jython plugins. I started a pyth=
on
project and wrote my code. I import standard JAVA packages and only one
Java add-in

import gnu.io

import gnu.io.RXTXPort as RXTX      (RXTX is added to JDK/JRE and JRE I
assume this will be a dependency)

The program runs fine from within Netbeans and now I want to make an egg.

The project SRC folder contains 29 .py  + 25 .class + 7 .jpg + 2 .XML
files  and   __INIT__.py

I right-click the project and use CLEAN and BUILD EGG

This puts a setup.py file in the source directory and creates a built and
info folder.

I also issued the Jython command from within the project SRC
folder            jython setup.py  bdist_egg

Both methods run to completion and produce the following

<folder> build>

               <subfolder> bdist.java1.80_251     (which is empty)

+ <folder> dist

           <file> JythonProject0.1-py2.7.egg      (contents =3D list of
egg-info files)

+  <folder>JythonProject.egg-info  with

          <file>  dependency_links.txt          (no content)

          <file> PKG-INFO                                (summary of
setup.py entries)

          <file> SOURCES.txt                           (setup.py + list of
these files)

          <file> top_level.txt                           (no content)



I=E2=80=99ve studied about the structure of the setup.py file but I=E2=80=
=99ll admit that
without an example I=E2=80=99m left confused about the syntax of filling in=
 the
blanks.

QUESTION: how do I add my source data to get a working egg?

Setup.py =3D

from setuptools import setup, find_packages



setup (

       name=3D'JythonProject',

       version=3D'0.1',

       packages=3Dfind_packages(),   ***  (supposed to find all .PY files ?=
)

                                                          *** how to
include CLASS files?

       # Declare your packages' dependencies here, for eg:

       install_requires=3D[],   *** my RXTX?  <path>xx.JAR?

       # Fill in these to make your Egg ready for upload to

       # PyPI

       author=3D'jwkel',

       author_email=3D'[email protected]',

       #summary =3D 'Just another Python package for the cheese shop',

       url=3D'', *** none

       license=3D'', *** I understand

       long_description=3D'Long description of the package',

--00000000000076615f05bed845a9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:large"><p =
class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-size=
:11pt;font-family:Calibri,sans-serif"><span style=3D"font-size:14.6667px">I=
=E2=80=99m using Netbeans with Python and jython plu</span><span style=3D"f=
ont-size:11pt">gins. I started
a python project and wrote my code. I import standard JAVA packages and onl=
y
one Java add-in</span><br></p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">import <a href=3D"http://gnu.io">g=
nu.io</a></p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">import gnu.io.RXTXPort as RXTX=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 (RXTX is added to JDK/JRE and JRE I
assume this will be a dependency)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">The program runs fine from within =
Netbeans and now I want to
make an egg.</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">The project SRC folder contains 29=
 .py=C2=A0 + 25 .class + 7 .jpg + 2 .XML files=C2=A0 and=C2=A0=C2=A0
__INIT__.py</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">I right-click the project and use =
CLEAN and BUILD EGG</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">This puts a setup.py file in the s=
ource directory and
creates a built and info folder.</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">I also issued the Jython command f=
rom within the project SRC
folder=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0jy=
thon setup.py =C2=A0<span style=3D"font-size:10pt;line-height:115%;font-fam=
ily:&quot;Lucida Console&quot;;color:black;background-image:initial;backgro=
und-position:initial;background-size:initial;background-repeat:initial;back=
ground-origin:initial;background-clip:initial">bdist_egg</span></p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">Both methods run to completion and=
 produce the following</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">&lt;folder&gt; build&gt;=C2=A0
</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &lt;subfolder&gt;
bdist.java1.80_251 =C2=A0=C2=A0=C2=A0=C2=A0(which is empty) </p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">+ &lt;folder&gt; dist=C2=A0=C2=A0
=C2=A0</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0
&lt;file&gt; JythonProject0.1-py2.7.egg=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cont=
ents =3D list of egg-info files)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">+=C2=A0
&lt;folder&gt;JythonProject.egg-info=C2=A0
with</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0&lt;file&gt;=C2=A0 dependency_links.txt=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (no content)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 &lt;file&gt;
PKG-INFO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
(summary of setup.py entries)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 &lt;file&gt;
SOURCES.txt=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0
(setup.py + list of these files)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 &lt;file&gt;
top_level.txt=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0
(no content)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">I=E2=80=99ve studied about the str=
ucture of the setup.py file but
I=E2=80=99ll admit that without an example I=E2=80=99m left confused about =
the syntax of
filling in the blanks.</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">QUESTION: how do I add my source d=
ata to get a working egg?</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">Setup.py =3D</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">from setuptools import setup, find=
_packages</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">setup (</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0
name=3D&#39;JythonProject&#39;,</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 version=3D&#39;0.1&#39;,</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0
packages=3Dfind_packages(),=C2=A0=C2=A0
***=C2=A0 (supposed to find all .PY
files ?)</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0
*** how to include CLASS files?</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 # Declare your
packages&#39; dependencies here, for eg:</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0
install_requires=3D[],=C2=A0=C2=A0 *** my
RXTX?=C2=A0 &lt;path&gt;xx.JAR?</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 # Fill in these
to make your Egg ready for upload to</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 # PyPI</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 author=3D&#39;jwkel&#39;,</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 author_email=3D&#39;<a href=3D"mailto:[email protected]">jwkelly49@gm=
ail.com</a>&#39;,</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 #summary =3D
&#39;Just another Python package for the cheese shop&#39;,</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 url=3D&#39;&#39;, ***
none</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 license=3D&#39;&#39;, ***
I understand</p>

<p class=3D"MsoNormal" style=3D"margin:0in 0in 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0
long_description=3D&#39;Long description of the package&#39;,</p></div></di=
v>

--00000000000076615f05bed845a9--


--===============2815881434543098295==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2815881434543098295==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users

--===============2815881434543098295==--