Re: Packaging a private project

2013-12-17 Thread Thomas Heller

Am 16.12.2013 12:18, schrieb Nicholas Cole:

Dear List,

What is the best way to distribute a private, pure python, Python 3
project that needs several modules (some available on pypi but some
private and used by several separate projects) in order to run?

I'd like to include everything that my project needs to run in a
single package.  The best way to do this seems to be to be to create
symlinks to the source code of the 3rd party modules I need and
create a setup.py file that includes them in its packages list.  Is
this what other people do?

But even more ideally, I'd like to package my script and its
dependencies in a single zip file that can be executed by python
directly.  I see several declarations that this is possible online,
but I can't find a simple recipe for converting a script and its
dependencies into this kind of distribution. Could someone give me a
pointer to a description of the right way to do it.

I'm making life harder for myself by using python 3 (PyInstaller still
only supports Python 2) and by the fact that I can't release some of
the necessary code publicly.  Releasing modules and scripts on pypi
has become very easy -- I'd forgotten how hard packaging private code
is!


Well, pyzzer comes to mind (you find it on pypi).  It creates an
executable zip-archive containing all the stuff that you need (at least
the pure python modules).

The problem remains: how to find all the modules and packages that need
to be included?

Python's modulefinder can do this for you.  If you want to live on the
cutting edge you could try the new one that I've written for Python3.
It currently lives in

http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/py2exe/mf3.py

It has several advantages against the standard library's modulefinder;
for example it finds and is able to extract the bytecode even from
zipped eggs.
For examples how it can be used, you could peek into the runtime.py
module in the same directory, method build_library of class Runtime.

I guess for an experienced developer it takes around one day to take
these pieces and build a script that scans a python script, finds all
the needed modules and packages, and uses pyzzer to build an executable
archive from it.

Thomas
--
https://mail.python.org/mailman/listinfo/python-list


Packaging a private project

2013-12-16 Thread Nicholas Cole
Dear List,

What is the best way to distribute a private, pure python, Python 3
project that needs several modules (some available on pypi but some
private and used by several separate projects) in order to run?

I'd like to include everything that my project needs to run in a
single package.  The best way to do this seems to be to be to create
symlinks to the source code of the 3rd party modules I need and
create a setup.py file that includes them in its packages list.  Is
this what other people do?

But even more ideally, I'd like to package my script and its
dependencies in a single zip file that can be executed by python
directly.  I see several declarations that this is possible online,
but I can't find a simple recipe for converting a script and its
dependencies into this kind of distribution. Could someone give me a
pointer to a description of the right way to do it.

I'm making life harder for myself by using python 3 (PyInstaller still
only supports Python 2) and by the fact that I can't release some of
the necessary code publicly.  Releasing modules and scripts on pypi
has become very easy -- I'd forgotten how hard packaging private code
is!

Thank you for any help.

N.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging a private project

2013-12-16 Thread Oscar Benjamin
On Dec 16, 2013 11:20 AM, Nicholas Cole nicholas.c...@gmail.com wrote:

 Dear List,

 What is the best way to distribute a private, pure python, Python 3
 project that needs several modules (some available on pypi but some
 private and used by several separate projects) in order to run?

 I'd like to include everything that my project needs to run in a
 single package.  The best way to do this seems to be to be to create
 symlinks to the source code of the 3rd party modules I need and
 create a setup.py file that includes them in its packages list.  Is
 this what other people do?

 But even more ideally, I'd like to package my script and its
 dependencies in a single zip file that can be executed by python
 directly.  I see several declarations that this is possible online,
 but I can't find a simple recipe for converting a script and its
 dependencies into this kind of distribution. Could someone give me a
 pointer to a description of the right way to do it.

For pure python code it's as simple as putting the code in a zip file with
a script called __main__.py. Then you can run the zip file with python as
if it was a python script.

Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list