Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; '16,': 0.03; '"the': 0.07; 'pypi': 0.07; 'executed': 0.09; 'setup.py': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'declarations': 0.16; 'ideally,': 0.16; 'it".': 0.16; 'recipe': 0.16; 'wrote:': 0.18; 'subject:project': 0.19; 'seems': 0.21; 'email addr:gmail.com>': 0.22; 'putting': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'package.': 0.24; 'pointer': 0.24; 'script.': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'script': 0.25; '>': 0.26; 'distribute': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'converting': 0.30; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'file': 0.32; 'run': 0.32; '"the': 0.34; "i'd": 0.34; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'possible': 0.36; 'project': 0.37; 'list.': 0.37; 'skip:& 10': 0.38; 'list,': 0.38; 'skip:& 20': 0.39; 'called': 0.40; 'even': 0.60; 'simple': 0.61; 'kind': 0.63; 'zip': 0.64; 'more': 0.64; 'dear': 0.65; 'to:addr:gmail.com': 0.65; 'oscar': 0.84; 'directly.': 0.95; 'online,': 0.96; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=E+r9Iwgxe4MdMxtI7n+OwXr1Mj/iviBJUP/C6UF2qF4=; b=F/xhH1EOaiTSIxTXo5ZKvKtnMf0MwdWLMzTcInsO1QBrvjjoRvAMGpwVndtoF+cSgv Ni2eejb5TfTrawpdSczkT3WmHh4f+OUZpOZeAGMcLOSv74q2VRxWFxUWYkSb5Ldp1zKJ 3pNR/yy/cyXhQNQ5U0V7zi5sxyBt4oOdTsGOy3QU7sbrVcHzHHZVhnzrwaBNW43uuM/t TLYko92SQ0+FIoYGOzuBNs2rPCpeFr7d7r2wW94wxN8g2gQD0vXeAJVBJ3+e1dRLZMbm ++qFa8sGXm9Q45WYFsqlv5APqsI0zacjfZZp+BXNN0oP9uVSE0GnpQEN17KAcg/5J6Tl rS3A== MIME-Version: 1.0 X-Received: by 10.52.36.51 with SMTP id n19mr2336224vdj.54.1387233576282; Mon, 16 Dec 2013 14:39:36 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Dec 2013 22:39:36 +0000 Subject: Re: Packaging a private project From: Oscar Benjamin To: Nicholas Cole Content-Type: multipart/alternative; boundary=20cf307cfd1688f16804edae7cda Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 71 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387233579 news.xs4all.nl 2875 [2001:888:2000:d::a6]:59053 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62112 --20cf307cfd1688f16804edae7cda Content-Type: text/plain; charset=ISO-8859-1 On Dec 16, 2013 11:20 AM, "Nicholas Cole" 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 --20cf307cfd1688f16804edae7cda Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Dec 16, 2013 11:20 AM, "Nicholas Cole" <nicholas.cole@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. =A0The best way to do this seems to be to be to create=
> symlinks to the source code of the "3rd party" modules I nee= d and
> create a setup.py file that includes them in its "packages" = list. =A0Is
> 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. =A0I see several declarations that this is possible online,<= br> > 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 fil= e with a script called __main__.py. Then you can run the zip file with pyth= on as if it was a python script.

Oscar

--20cf307cfd1688f16804edae7cda--