From ralf at systemexit.de Mon Dec 5 22:44:57 2011 From: ralf at systemexit.de (Ralf Schmitt) Date: Mon, 05 Dec 2011 22:44:57 +0100 Subject: [Distutils] [ANNOUNCE] pypiserver 0.5.0 - minimal pypi server Message-ID: <87r50ivgkm.fsf@myhost.localnet> Hi, I've just uploaded pypiserver 0.5.0 to the python package index. pypiserver is a minimal PyPI compatible server. It can be used to serve a set of packages and eggs to easy_install or pip. pypiserver is easy to install (i.e. just easy_install pypiserver). It doesn't have any external dependencies. http://pypi.python.org/pypi/pypiserver/ should contain enough information to easily get you started running your own PyPI server in a few minutes. The code is available on github: https://github.com/schmir/pypiserver Changes in version 0.5.0 ------------------------- - make setup.py install without calling 2to3 by changing source code to be compatible with both python 2 and python 3. We now ship a slightly patched version of bottle. The upcoming bottle 0.11 also contains these changes. - make the single-file pypi-server-standalone.py work with python 3 -- Cheers, Ralf From martin at v.loewis.de Mon Dec 5 22:58:43 2011 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Mon, 05 Dec 2011 22:58:43 +0100 Subject: [Distutils] [ANNOUNCE] pypiserver 0.5.0 - minimal pypi server In-Reply-To: <87r50ivgkm.fsf@myhost.localnet> References: <87r50ivgkm.fsf@myhost.localnet> Message-ID: <4EDD3E93.70400@v.loewis.de> > pypiserver is a minimal PyPI compatible server. It can be used to serve > a set of packages and eggs to easy_install or pip. I wonder why it needs to be a specialized server. The PyPI API is designed deliberately to avoid the need for custom servers; any web server capable of serving static pages (including SimpleHTTPServer) is capable of serving packages to easy_install or pip. Regards, Martin From ralf at systemexit.de Mon Dec 5 23:39:49 2011 From: ralf at systemexit.de (Ralf Schmitt) Date: Mon, 05 Dec 2011 23:39:49 +0100 Subject: [Distutils] [ANNOUNCE] pypiserver 0.5.0 - minimal pypi server In-Reply-To: <4EDD3E93.70400@v.loewis.de> ("Martin v. =?utf-8?Q?L=C3=B6wis?= =?utf-8?Q?=22's?= message of "Mon, 05 Dec 2011 22:58:43 +0100") References: <87r50ivgkm.fsf@myhost.localnet> <4EDD3E93.70400@v.loewis.de> Message-ID: <87ipluve16.fsf@myhost.localnet> "Martin v. L?wis" writes: >> pypiserver is a minimal PyPI compatible server. It can be used to serve >> a set of packages and eggs to easy_install or pip. > > I wonder why it needs to be a specialized server. The PyPI API is > designed deliberately to avoid the need for custom servers; any > web server capable of serving static pages (including SimpleHTTPServer) > is capable of serving packages to easy_install or pip. IMHO it's much easier to start my pypiserver package, which requires near zero configuration than running e.g. apache in order to serve a package index (especially when python is already installed on the machine). SimpleHTTPServer may work with something like http://pypi.python.org/pypi/basketweaver, but then you'll have to periodically update the index. pypiserver does that on the fly. Besides I may decide to implement some features like automatic proxying that are not possible to do with apache serving a set of static files. -- Cheers Ralf From andrea.crotti.0 at gmail.com Tue Dec 13 12:40:35 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Tue, 13 Dec 2011 11:40:35 +0000 Subject: [Distutils] pkg_resources on Windows Message-ID: <4EE739B3.8050702@gmail.com> I have a script installed with "python setup.py develop" on windows 7 in the directory c:\python25\scripts. The script looks like: #!c:\python25\python.exe # EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.py' __requires__ = 'psi.devsonly==0.1' from pkg_resources import require; require('psi.devsonly==0.1') del require __file__ = 'h:\\long\\path\\bin\\dev_main.py' execfile(__file__) c:\python25\script is actually in the $PATH, but if I try to launch that command it doesn't work because it tries with c:\Python27. long\path\git_projs\Psi>dev_main.py -h dev_main.py -h Traceback (most recent call last): File "C:\python25\scripts\dev_main.py", line 4, in from pkg_resources import require; require('psi.devsonly==0.1') File "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 2603, in File "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 666, in require File "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: psi.devsonly==0.1 This makes me thing that - the shebang is absolutely ignored - some other weird bug Is there a way to solve this thing? From fuzzyman at gmail.com Tue Dec 13 14:08:23 2011 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 13 Dec 2011 13:08:23 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE739B3.8050702@gmail.com> References: <4EE739B3.8050702@gmail.com> Message-ID: On 13 December 2011 11:40, Andrea Crotti wrote: > I have a script installed with "python setup.py develop" on windows 7 in > the directory c:\python25\scripts. > > The script looks like: > > #!c:\python25\python.exe > # EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.**py' > __requires__ = 'psi.devsonly==0.1' > from pkg_resources import require; require('psi.devsonly==0.1') > del require > __file__ = 'h:\\long\\path\\bin\\dev_**main.py' > execfile(__file__) > > c:\python25\script is actually in the $PATH, but if I try to launch > that command it doesn't work because it tries with c:\Python27. > > long\path\git_projs\Psi>dev_**main.py -h > dev_main.py -h > Traceback (most recent call last): > File "C:\python25\scripts\dev_main.**py", line 4, in > from pkg_resources import require; require('psi.devsonly==0.1') > File "C:\Python27\lib\site-**packages\setuptools-0.6c11-**py2.7.egg\pkg_resources.py", > line 2603, in > File "C:\Python27\lib\site-**packages\setuptools-0.6c11-**py2.7.egg\pkg_resources.py", > line 666, in require > File "C:\Python27\lib\site-**packages\setuptools-0.6c11-**py2.7.egg\pkg_resources.py", > line 565, in resolve > pkg_resources.**DistributionNotFound: psi.devsonly==0.1 > > > This makes me thing that > - the shebang is absolutely ignored > Yes, Windows ignores shebang lines, they're a UNIX convention. Windows uses file associations to decide what program to launch scripts with. The Windows Python installer associates .py files with python.exe - so the most recent version of Python you installed will have the file association. For scripts on Windows I *thought* setuptools created .exe wrappers to get round this problem. It may not do this when you use "setup.py develop" though. All the best, Michael Foord - some other weird bug > > Is there a way to solve this thing? > ______________________________**_________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/**mailman/listinfo/distutils-sig > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Tue Dec 13 15:11:16 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Tue, 13 Dec 2011 14:11:16 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: References: <4EE739B3.8050702@gmail.com> Message-ID: <4EE75D04.5060905@gmail.com> On 12/13/2011 01:08 PM, Michael Foord wrote: > > > On 13 December 2011 11:40, Andrea Crotti > wrote: > > I have a script installed with "python setup.py develop" on > windows 7 in > the directory c:\python25\scripts. > > The script looks like: > > #!c:\python25\python.exe > # EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.py' > __requires__ = 'psi.devsonly==0.1' > from pkg_resources import require; require('psi.devsonly==0.1') > del require > __file__ = 'h:\\long\\path\\bin\\dev_main.py' > execfile(__file__) > > c:\python25\script is actually in the $PATH, but if I try to launch > that command it doesn't work because it tries with c:\Python27. > > long\path\git_projs\Psi>dev_main.py -h > dev_main.py -h > Traceback (most recent call last): > File "C:\python25\scripts\dev_main.py", line 4, in > from pkg_resources import require; require('psi.devsonly==0.1') > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 2603, in > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 666, in require > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 565, in resolve > pkg_resources.DistributionNotFound: psi.devsonly==0.1 > > > This makes me thing that > - the shebang is absolutely ignored > > > > Yes, Windows ignores shebang lines, they're a UNIX convention. Windows > uses file associations to decide what program to launch scripts with. > > The Windows Python installer associates .py files with python.exe - so > the most recent version of Python you installed will have the file > association. > > For scripts on Windows I *thought* setuptools created .exe wrappers to > get round this problem. It may not do this when you use "setup.py > develop" though. > > All the best, > > Michael Foord > I thought so, but I was surprised to see the shebang line in the script file, so I supposed that it was actually working. So if I just make sure that every py file is associated with that particular version of python everything should work, right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From guy at rzn.co.il Tue Dec 13 15:25:51 2011 From: guy at rzn.co.il (Guy Rozendorn) Date: Tue, 13 Dec 2011 16:25:51 +0200 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE75D04.5060905@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> Message-ID: <4EE7606F.3080209@rzn.co.il> If your console_scripts section in setup.py point to a correct entry point, then distribute should've created a dev_main.exe executable wrapper, and a dev_main-script.py under C:\Python25\Scripts. The executable wrapper reads the generated python file and extracts the pyhton executable path from the shebang file, and calls CreateProcess with that python executable. If you don't have these two files, then, I can guess that either: * You're using an old version of distribute * Your setup.py is incorrect. - Guy > Andrea Crotti > December 13, 2011 4:11 PM > > I thought so, but I was surprised to see the shebang line in the > script file, so I supposed that it was actually working. > So if I just make sure that every py file is associated with that > particular version of python everything should work, > right? > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig > Michael Foord > December 13, 2011 3:08 PM > > > On 13 December 2011 11:40, Andrea Crotti > wrote: > > I have a script installed with "python setup.py develop" on > windows 7 in > the directory c:\python25\scripts. > > The script looks like: > > #!c:\python25\python.exe > # EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.py' > __requires__ = 'psi.devsonly==0.1' > from pkg_resources import require; require('psi.devsonly==0.1') > del require > __file__ = 'h:\\long\\path\\bin\\dev_main.py' > execfile(__file__) > > c:\python25\script is actually in the $PATH, but if I try to launch > that command it doesn't work because it tries with c:\Python27. > > long\path\git_projs\Psi>dev_main.py -h > dev_main.py -h > Traceback (most recent call last): > File "C:\python25\scripts\dev_main.py", line 4, in > from pkg_resources import require; require('psi.devsonly==0.1') > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 2603, in > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 666, in require > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 565, in resolve > pkg_resources.DistributionNotFound: psi.devsonly==0.1 > > > This makes me thing that > - the shebang is absolutely ignored > > > > Yes, Windows ignores shebang lines, they're a UNIX convention. Windows > uses file associations to decide what program to launch scripts with. > > The Windows Python installer associates .py files with python.exe - so > the most recent version of Python you installed will have the file > association. > > For scripts on Windows I *thought* setuptools created .exe wrappers to > get round this problem. It may not do this when you use "setup.py > develop" though. > > All the best, > > Michael Foord > > - some other weird bug > > Is there a way to solve this thing? > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > > http://mail.python.org/mailman/listinfo/distutils-sig > > > > > -- > http://www.voidspace.org.uk/ > > May you do good and not evil > May you find forgiveness for yourself and forgive others > > May you share freely, never taking more than you give. > -- the sqlite blessinghttp://www.sqlite.org/different.html > > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig > Andrea Crotti > December 13, 2011 1:40 PM > I have a script installed with "python setup.py develop" on windows 7 in > the directory c:\python25\scripts. > > The script looks like: > > #!c:\python25\python.exe > # EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.py' > __requires__ = 'psi.devsonly==0.1' > from pkg_resources import require; require('psi.devsonly==0.1') > del require > __file__ = 'h:\\long\\path\\bin\\dev_main.py' > execfile(__file__) > > c:\python25\script is actually in the $PATH, but if I try to launch > that command it doesn't work because it tries with c:\Python27. > > long\path\git_projs\Psi>dev_main.py -h > dev_main.py -h > Traceback (most recent call last): > File "C:\python25\scripts\dev_main.py", line 4, in > from pkg_resources import require; require('psi.devsonly==0.1') > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 2603, in > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 666, in require > File > "C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", > line 565, in resolve > pkg_resources.DistributionNotFound: psi.devsonly==0.1 > > > This makes me thing that > - the shebang is absolutely ignored > - some other weird bug > > Is there a way to solve this thing? > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: postbox-contact.jpg Type: image/jpeg Size: 1211 bytes Desc: not available URL: From andrea.crotti.0 at gmail.com Tue Dec 13 15:42:24 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Tue, 13 Dec 2011 14:42:24 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE7606F.3080209@rzn.co.il> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> Message-ID: <4EE76450.7060907@gmail.com> On 12/13/2011 02:25 PM, Guy Rozendorn wrote: > If your console_scripts section in setup.py point to a correct entry > point, then distribute should've created a dev_main.exe executable > wrapper, and a dev_main-script.py under C:\Python25\Scripts. > The executable wrapper reads the generated python file and extracts > the pyhton executable path from the shebang file, and calls > CreateProcess with that python executable. > > If you don't have these two files, then, I can guess that either: > * You're using an old version of distribute > * Your setup.py is incorrect. > > - Guy > The version of setuptools is rather old right. Anyway this is the setup.py: from setuptools import setup from psi.devsonly.api import build_config #TODO: what if this module is having some nasty side effects?? import os from os.path import join config = build_config() config['setup_requires'] = [] config['package_data'] = { # any package containing this file should be included '': ['windows_easy_install.pth'] } bindir = join('psi', 'devsonly', 'bin') scripts = [join(bindir, x) for x in os.listdir(bindir) if x.endswith('.py')] # networkx in particular is very hard to build extra_requires = ('rope', 'pygraphviz', 'networkx') # we might need to be able to find out the version number at setup time # so the egg telling this should have to be there in setup_requires config['scripts'] = scripts setup(**config) Where build_config is something done somewhere else constructing a similar dictionary: # entry points should also be an external file config = { 'name': modname('.'), 'version': '0.1', # 'version': get_svn_revision_cmd(), 'author': "Airbus", 'test_suite': 'nose.collector', 'packages': find_packages(), 'install_requires': requires, 'zip_safe': False, 'entry_points': entry_points, 'setup_requires': ['psi.devsonly'], # this is somehow late because every 'namespace_packages': list(modname_generator(modname('.'))), 'tests_require': test_requires + filename_to_list(TESTS_REQUIRE_FILE) } Any hint is welcome -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.ingoglia at gmail.com Tue Dec 13 22:17:29 2011 From: charles.ingoglia at gmail.com (Charles Ingoglia) Date: Tue, 13 Dec 2011 13:17:29 -0800 Subject: [Distutils] options file not found Message-ID: When attempting to run 'setup.py' to install mySQL-python on my windows laptop, I get this error message about the options file not found. See below. Can someone tell me what this means and how to resolve it? Thanks! C:\mysqlpython\MySQL-python-1.2.3>setup.py Traceback (most recent call last): File "C:\mysqlpython\MySQL-python-1.2.3\setup.py", line 15, in metadata, options = get_config() File "C:\mysqlpython\MySQL-python-1.2.3\setup_windows.py", line 7, in get_config serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key']) WindowsError: [Error 2] The system cannot find the file specified -- Charles Ingoglia Mobile Phone: 650-743-1788 My Linkedin Profile: http://www.linkedin.com/in/charlesingoglia -------------- next part -------------- An HTML attachment was scrubbed... URL: From pje at telecommunity.com Wed Dec 14 06:10:01 2011 From: pje at telecommunity.com (PJ Eby) Date: Wed, 14 Dec 2011 00:10:01 -0500 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE76450.7060907@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> Message-ID: On Tue, Dec 13, 2011 at 9:42 AM, Andrea Crotti wrote: > bindir = join('psi', 'devsonly', 'bin') > scripts = [join(bindir, x) for x in os.listdir(bindir) if > x.endswith('.py')] > This is your problem: specifying scripts in this fashion will not cause an .exe wrapper to be generated. See: http://peak.telecommunity.com/DevCenter/setuptools#automatic-script-creation for more details. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Wed Dec 14 15:33:34 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Wed, 14 Dec 2011 14:33:34 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> Message-ID: <4EE8B3BE.2080900@gmail.com> On 12/14/2011 05:10 AM, PJ Eby wrote: > On Tue, Dec 13, 2011 at 9:42 AM, Andrea Crotti > > wrote: > > bindir = join('psi', 'devsonly', 'bin') > scripts = [join(bindir, x) for x in os.listdir(bindir) if > x.endswith('.py')] > > > This is your problem: specifying scripts in this fashion will not > cause an .exe wrapper to be generated. See: > > http://peak.telecommunity.com/DevCenter/setuptools#automatic-script-creation > > for more details. Thanks a lot, it's create to get an actual exe file in the PATH :) The problem is that now everything seems to work but I get an error from PyQt which I normally should not really have. File "C:\python25\lib\site-packages\traitsbackendqt-3.1.0n1-py2.5-win32.egg\enthought\pyface\ui\qt4\workbench\split_tab_widget.py", line 32, in __init__ QtGui.QSplitter.__init__(self, *args) TypeError: argument 1 of QSplitter() has an invalid type QEventDispatcherWin32::unregisterTimer: invalid argument QEventDispatcherWin32::unregisterTimer: invalid argument Looks like it's loading something different than what it should do, but it's weird because launching the command everything works normally. Any idea of what it could be? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Wed Dec 14 15:37:09 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Wed, 14 Dec 2011 14:37:09 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE8B3BE.2080900@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> <4EE8B3BE.2080900@gmail.com> Message-ID: <4EE8B495.8060905@gmail.com> On 12/14/2011 02:33 PM, Andrea Crotti wrote: > > Thanks a lot, it's create to get an actual exe file in the PATH :) > > The problem is that now everything seems to work but I get an error > from PyQt which > I normally should not really have. > > File > "C:\python25\lib\site-packages\traitsbackendqt-3.1.0n1-py2.5-win32.egg\enthought\pyface\ui\qt4\workbench\split_tab_widget.py", > line 32, in __init__ > QtGui.QSplitter.__init__(self, *args) > TypeError: argument 1 of QSplitter() has an invalid type > QEventDispatcherWin32::unregisterTimer: invalid argument > QEventDispatcherWin32::unregisterTimer: invalid argument > > Looks like it's loading something different than what it should do, > but it's weird because launching the command everything > works normally. > Any idea of what it could be? Sorry my fault, I had if __name__ == '__main__': do_something_important() main() and of course given the main() function as entry point the other thing was not executed... Works perfectly now thanks again -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.schoenborn at gmail.com Wed Dec 14 22:30:27 2011 From: oliver.schoenborn at gmail.com (oliver) Date: Wed, 14 Dec 2011 16:30:27 -0500 Subject: [Distutils] easy_install unable to install from sourceforge? Message-ID: Any idea how to get "easy_install " to work when is stored on SourceForge.net? I have a python package, pypubsub, that I have been hosting on SourceForge. I would rather leave the files there as I prefer the stats available, rather than storing the files on pypi. I am able to install pubsub several ways: via "python setup.py install", by downloading the egg/zip to my computer and easy_install on egg/zip, or by storing the file on pypi (tested just to see if it was an SF.net issue). So there is nothing wrong with pubsub's setup.py. But I am unable to install Pubsub using "easy_install pypubsub". This is what I get from "easy_install pypubsub" (latest setuptools, python 2.6): C:\Program Files\wxPython2.8 Docs and Demos\demo>easy_install pypubsub Searching for pypubsub Reading http://pypi.python.org/simple/pypubsub/ Reading http://pubsub.wiki.sourceforge.net Reading http://sourceforge.net/project/showfiles.php?group_id=197063 Reading http://pubsub.sourceforge.net Reading http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/ Reading http://downloads.sourceforge.net/pubsub Best match: PyPubSub 3.1.1b1.win32 Downloading http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1.win32.zip/download Processing download error: Couldn't find a setup script in c:\docume~1\schoenb\locals~1\temp\easy_install-sa7vdr\download Firstly the best match should be 3.1.2, available from several of those http links. Secondly easy_install complains about a missing setup script, this is bogus because it works fine directly on the file. Setuptools 0.6.11c code shows that it does extra step when installing a python dist stored on SourceForge.net that ends in "download", but given the above I don't think that bit of code works. I notice that matplotlib, also stored on sourceforge, has same issue; and that all packages I tried that are hosted on pypi can be easy_installed via "easy_install ". Any ideas how to get "easy_install pypubsub" to work properly when the egg/zips are on SourceForge.net? Oliver -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.goebel at goebel-consult.de Fri Dec 16 13:26:36 2011 From: h.goebel at goebel-consult.de (Hartmut Goebel) Date: Fri, 16 Dec 2011 13:26:36 +0100 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: References: Message-ID: <4EEB38FC.6090209@goebel-consult.de> Am 14.12.2011 22:30, schrieb oliver: > > Downloading > http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1.win32.zip/download > Processing download > error: Couldn't find a setup script in > c:\docume~1\schoenb\locals~1\temp\easy_install-sa7vdr\download > This file is an egg, but has the wrong extension (.zip). Hus easy_install thinks, this is a source archive. You need to mkae the pysub maintainers fixing it. -- Sch?nen Gru? - Regards Hartmut Goebel Dipl.-Informatiker (univ.), CISSP, CSSLP Goebel Consult Spezialist f?r IT-Sicherheit in komplexen Umgebungen http://www.goebel-consult.de Monatliche Kolumne: http://www.cissp-gefluester.de/ Goebel Consult ist Mitglied bei http://www.7-it.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6347 bytes Desc: S/MIME Cryptographic Signature URL: From andrea.crotti.0 at gmail.com Fri Dec 16 13:30:56 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Fri, 16 Dec 2011 12:30:56 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EE8B495.8060905@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> <4EE8B3BE.2080900@gmail.com> <4EE8B495.8060905@gmail.com> Message-ID: <4EEB3A00.7000903@gmail.com> Another question, suppose that I have something like dev_main -a myapplication where myapplication is a certain path. Would it be possible to create a console_script setting in the entry points, that passes that option to dev_main automatically? It would be quite nice to get executables out of the box, that under the hood run the development version.. From pje at telecommunity.com Fri Dec 16 17:10:03 2011 From: pje at telecommunity.com (PJ Eby) Date: Fri, 16 Dec 2011 11:10:03 -0500 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EEB3A00.7000903@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> <4EE8B3BE.2080900@gmail.com> <4EE8B495.8060905@gmail.com> <4EEB3A00.7000903@gmail.com> Message-ID: On Fri, Dec 16, 2011 at 7:30 AM, Andrea Crotti wrote: > Another question, suppose that I have something like > > dev_main -a myapplication > > where myapplication is a certain path. > Would it be possible to create a console_script setting in the entry > points, that > passes that option to dev_main automatically? > > It would be quite nice to get executables out of the box, that under the > hood > run the development version.. > I don't know what 'dev_main' is, but if you're asking, "can I have an .exe that runs my development code?", then the answer is yes. Use "setup.py develop". It will install script .exe's and stub .py files to the target directory, but the actual code that's run by the .exe will be your original source code. Any changes you make to the source will take effect the next time you run that exe. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Fri Dec 16 18:42:47 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Fri, 16 Dec 2011 17:42:47 +0000 Subject: [Distutils] pkg_resources on Windows In-Reply-To: References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> <4EE8B3BE.2080900@gmail.com> <4EE8B495.8060905@gmail.com> <4EEB3A00.7000903@gmail.com> Message-ID: <4EEB8317.4000101@gmail.com> On 12/16/2011 04:10 PM, PJ Eby wrote: > On Fri, Dec 16, 2011 at 7:30 AM, Andrea Crotti > > wrote: > > Another question, suppose that I have something like > > dev_main -a myapplication > > where myapplication is a certain path. > Would it be possible to create a console_script setting in the > entry points, that > passes that option to dev_main automatically? > > It would be quite nice to get executables out of the box, that > under the hood > run the development version.. > > > I don't know what 'dev_main' is, but if you're asking, "can I have an > .exe that runs my development code?", then the answer is yes. Use > "setup.py develop". It will install script .exe's and stub .py files > to the target directory, but the actual code that's run by the .exe > will be your original source code. Any changes you make to the > source will take effect the next time you run that exe. > Yes yes I knew this, the real question was more if I can pass something to the entry point function in the console_scripts. The simple way would be to simply create another module which calls the dev_main with the right parameter, and use that as an entry point. But in general it looks like it's not possible to pass arguments, right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pje at telecommunity.com Fri Dec 16 19:50:54 2011 From: pje at telecommunity.com (PJ Eby) Date: Fri, 16 Dec 2011 13:50:54 -0500 Subject: [Distutils] pkg_resources on Windows In-Reply-To: <4EEB8317.4000101@gmail.com> References: <4EE739B3.8050702@gmail.com> <4EE75D04.5060905@gmail.com> <4EE7606F.3080209@rzn.co.il> <4EE76450.7060907@gmail.com> <4EE8B3BE.2080900@gmail.com> <4EE8B495.8060905@gmail.com> <4EEB3A00.7000903@gmail.com> <4EEB8317.4000101@gmail.com> Message-ID: On Fri, Dec 16, 2011 at 12:42 PM, Andrea Crotti wrote: > > > Yes yes I knew this, the real question was more if I can pass something to > the entry > point function in the console_scripts. > If you want to access command-line arguments, use sys.argv as usual. Script entry points are not called with any arguments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at simplistix.co.uk Fri Dec 16 19:35:25 2011 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 16 Dec 2011 18:35:25 +0000 Subject: [Distutils] Fwd: Re: [TIP] [tox] how to specify which "extras" to install when testing my package In-Reply-To: <4EE84D1B.5070705@simplistix.co.uk> References: <4EE84D1B.5070705@simplistix.co.uk> Message-ID: <4EEB8F6D.8080001@simplistix.co.uk> I guess this question belongs here: -------- Original Message -------- > since distutils2/packaging will not have extra requirements at all So what's the distutils2 plan for supporting differing optional requirements in a package? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk _______________________________________________ testing-in-python mailing list testing-in-python at lists.idyll.org http://lists.idyll.org/listinfo/testing-in-python ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ From luc.saffre at gmx.net Sat Dec 17 21:19:50 2011 From: luc.saffre at gmx.net (Luc Saffre) Date: Sat, 17 Dec 2011 22:19:50 +0200 Subject: [Distutils] dist-dir option missing in docs Message-ID: <4EECF966.1070604@gmx.net> Hi, AFAICS the `dist-dir` option of the `setup.py sdist` command is not documented in http://docs.python.org/distutils/sourcedist.html. You might smile when hearing that I had to analyze the code to find out that "python setup.py --help sdist" would have given me the answer. I suggest at least simple screenshot of that command on the above page. Best regards Luc Saffre From oliver.schoenborn at gmail.com Sun Dec 18 06:07:47 2011 From: oliver.schoenborn at gmail.com (oliver) Date: Sun, 18 Dec 2011 00:07:47 -0500 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: <4EEB38FC.6090209@goebel-consult.de> References: <4EEB38FC.6090209@goebel-consult.de> Message-ID: Hartmut, thanks for reply. However that is not the problem; look: C:\Documents and Settings\schoenb\My Documents\Downloads>easy_install -U pypubsub Searching for pypubsub Reading http://pypi.python.org/simple/pypubsub/ Reading http://pubsub.wiki.sourceforge.net Reading http://sourceforge.net/project/showfiles.php?group_id=197063 Reading http://pubsub.sourceforge.net Reading http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/ Reading http://downloads.sourceforge.net/pubsub Best match: PyPubSub 3.1.1b1 Downloading http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download Processing download error: Couldn't find a setup script in c:\docume~1\schoenb\locals~1\temp\easy_install-m52ynu\download Now the same file, after downloading manually: C:\Documents and Settings\schoenb\My Documents\Downloads>easy_install "Z:\Documents on Host\PyPubSub-3.1.1b1-py2.6.egg" Processing PyPubSub-3.1.1b1-py2.6.egg creating c:\python26\lib\site-packages\PyPubSub-3.1.1b1-py2.6.egg Extracting PyPubSub-3.1.1b1-py2.6.egg to c:\python26\lib\site-packages Adding PyPubSub 3.1.1b1 to easy-install.pth file Installed c:\python26\lib\site-packages\pypubsub-3.1.1b1-py2.6.egg Processing dependencies for PyPubSub==3.1.1b1 Finished processing dependencies for PyPubSub==3.1.1b1 So easy_install is unable to process what it gets from sourceforge. Again, if I upload that same file to pypi, easy_install will succeed: C:\Documents and Settings\schoenb\My Documents\Downloads>easy_install http://pypi.python.org/packages/2.6/P/PyPubSub/PyPubSub-3.1.1b1-py2.6.egg Downloading http://pypi.python.org/packages/2.6/P/PyPubSub/PyPubSub-3.1.1b1-py2.6.egg Processing PyPubSub-3.1.1b1-py2.6.egg creating c:\python26\lib\site-packages\PyPubSub-3.1.1b1-py2.6.egg Extracting PyPubSub-3.1.1b1-py2.6.egg to c:\python26\lib\site-packages Adding PyPubSub 3.1.1b1 to easy-install.pth file Installed c:\python26\lib\site-packages\pypubsub-3.1.1b1-py2.6.egg Processing dependencies for PyPubSub==3.1.1b1 Finished processing dependencies for PyPubSub==3.1.1b1 The following also works: C:\Documents and Settings\schoenb\My Documents\Downloads>easy_install " https://downloads.sourceforge.net/project/pubsub/pubsub/3.1.1b1/PyPubSub-3.1.1b 1-py2.6.egg" Downloading https://downloads.sourceforge.net/project/pubsub/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg Processing PyPubSub-3.1.1b1-py2.6.egg removing 'c:\python26\lib\site-packages\PyPubSub-3.1.1b1-py2.6.egg' (and everything under it) creating c:\python26\lib\site-packages\PyPubSub-3.1.1b1-py2.6.egg Extracting PyPubSub-3.1.1b1-py2.6.egg to c:\python26\lib\site-packages PyPubSub 3.1.1b1 is already the active version in easy-install.pth Installed c:\python26\lib\site-packages\pypubsub-3.1.1b1-py2.6.egg Processing dependencies for PyPubSub==3.1.1b1 Finished processing dependencies for PyPubSub==3.1.1b1 So again, the main issue is that "easy_install pypubsub" is unable to process what it obtains from http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download, but it is able to process PyPubSub-3.1.1b1-py2.6.egg when obtained several other ways. Oliver On Fri, Dec 16, 2011 at 7:26 AM, Hartmut Goebel wrote: > ** > Am 14.12.2011 22:30, schrieb oliver: > > > Downloading > http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1.win32.zip/download > Processing download > error: Couldn't find a setup script in > c:\docume~1\schoenb\locals~1\temp\easy_install-sa7vdr\download > > This file is an egg, but has the wrong extension (.zip). Hus > easy_install thinks, this is a source archive. You need to mkae the pysub > maintainers fixing it. > > -- > Sch?nen Gru? - Regards > Hartmut Goebel > Dipl.-Informatiker (univ.), CISSP, CSSLP > > Goebel Consult > Spezialist f?r IT-Sicherheit in komplexen Umgebungenhttp://www.goebel-consult.de > > Monatliche Kolumne: http://www.cissp-gefluester.de/ > Goebel Consult ist Mitglied bei http://www.7-it.de > > > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.schoenborn at gmail.com Sun Dec 18 07:59:33 2011 From: oliver.schoenborn at gmail.com (oliver) Date: Sun, 18 Dec 2011 01:59:33 -0500 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: References: <4EEB38FC.6090209@goebel-consult.de> Message-ID: On Sun, Dec 18, 2011 at 12:07 AM, oliver wrote: > Hartmut, thanks for reply. However that is not the problem; look: > > ... > > So again, the main issue is that "easy_install pypubsub" is unable to > process what it obtains from > http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download, > but it is able to process PyPubSub-3.1.1b1-py2.6.egg when obtained several > other ways. > > Oliver > So I finally found a way to make it work. Use the direct download links that sf.net provides, on the pypi page of the package. More details at http://schollii.blogspot.com/2011/12/how-to-make-easyinstall-work-with-dists.html . Oliver > > On Fri, Dec 16, 2011 at 7:26 AM, Hartmut Goebel < > h.goebel at goebel-consult.de> wrote: > >> ** >> Am 14.12.2011 22:30, schrieb oliver: >> >> >> Downloading >> http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1.win32.zip/download >> Processing download >> error: Couldn't find a setup script in >> c:\docume~1\schoenb\locals~1\temp\easy_install-sa7vdr\download >> >> This file is an egg, but has the wrong extension (.zip). Hus >> easy_install thinks, this is a source archive. You need to mkae the pysub >> maintainers fixing it. >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Sun Dec 18 12:35:28 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Sun, 18 Dec 2011 11:35:28 +0000 Subject: [Distutils] parallelize setup.py develop/build Message-ID: <4EEDD000.4090808@gmail.com> Since I have to run many setup.py develop/build I wanted to try to parallelize the calls. The normal setup.py is something like from setuptools import setup setup(...) But I was wondering, why isn't it from setuptools import setup if __name__ == '__main__': setup(...) In this way it would be possible to import the setup file without actually running any code. What I don't really like in fact is to be forced to call an external subprocess call just to run some other python code.. And in that way I would have more control also on the output and the errors that I receive, does it make sense? Going back to the original question, parallelizing many build/develop calls can be actually faster or is the same in case the hard disk is still only one? From andrea.crotti.0 at gmail.com Sun Dec 18 14:07:32 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Sun, 18 Dec 2011 13:07:32 +0000 Subject: [Distutils] parallelize setup.py develop/build In-Reply-To: <4EEDD000.4090808@gmail.com> References: <4EEDD000.4090808@gmail.com> Message-ID: <4EEDE594.4010903@gmail.com> On 12/18/2011 11:35 AM, Andrea Crotti wrote: > Since I have to run many setup.py develop/build I wanted to try to > parallelize the calls. > The normal setup.py is something like > > from setuptools import setup > > setup(...) > > But I was wondering, why isn't it > > from setuptools import setup > > if __name__ == '__main__': > setup(...) > > In this way it would be possible to import the setup file without > actually running any code. > What I don't really like in fact is to be forced to call an external > subprocess call just to run > some other python code.. > And in that way I would have more control also on the output and the > errors that I receive, > does it make sense? > > Going back to the original question, parallelizing many build/develop > calls can be actually > faster or is the same in case the hard disk is still only one? Ok in theory is possible to import the setup code from another module, on error however, setuptools call sys.exit, so I have to do something like this: if __name__ == '__main__': from setup import call_setup # try to fetch the errors produced try: call_setup() except SystemExit: print("catched exception") # do something useful From h.goebel at goebel-consult.de Sun Dec 18 16:32:27 2011 From: h.goebel at goebel-consult.de (Hartmut Goebel) Date: Sun, 18 Dec 2011 16:32:27 +0100 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: References: <4EEB38FC.6090209@goebel-consult.de> Message-ID: <4EEE078B.5020201@goebel-consult.de> Am 18.12.2011 06:07, schrieb oliver: > > Processing download > error: Couldn't find a setup script in > c:\docume~1\schoenb\locals~1\temp\easy_install-m52ynu\download > > Downloading > http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download > > The filename is "download", no .egg extension > Now the same file, after downloading manually: > > C:\Documents and Settings\schoenb\My > Documents\Downloads>easy_install "Z:\Documents on > Host\PyPubSub-3.1.1b1-py2.6.egg" > Processing PyPubSub-3.1.1b1-py2.6.egg > The filename has extension .egg > So easy_install is unable to process what it gets from sourceforge. > Again, if I upload that same file to pypi, easy_install will succeed: > > C:\Documents and Settings\schoenb\My > Documents\Downloads>easy_install > http://pypi.python.org/packages/2.6/P/PyPubSub/PyPubSub-3.1.1b1-py2.6.egg > Downloading > http://pypi.python.org/packages/2.6/P/PyPubSub/PyPubSub-3.1.1b1-py2.6.egg > The filename has extension .egg > > > The following also works: > > C:\Documents and Settings\schoenb\My > Documents\Downloads>easy_install > "https://downloads.sourceforge.net/project/pubsub/pubsub/3.1.1b1/PyPubSub-3.1.1b > 1-py2.6.egg" > Downloading > https://downloads.sourceforge.net/project/pubsub/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg > Processing PyPubSub-3.1.1b1-py2.6.egg > The filename has extension .egg > So again, the main issue is that "easy_install pypubsub" is unable to > process what it obtains > from http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download, > but it is able to process PyPubSub-3.1.1b1-py2.6.egg when obtained > several other ways. This *reall* issue is sourceforge adding a "/download" to the URL. I filed a bug a few years ago, but as expected, it has been ignored. Nevertheless I once wrote a script for handling this bug. I'll prepre a patch for easy_install when I find some time. -- Sch?nen Gru? - Regards Hartmut Goebel Dipl.-Informatiker (univ.), CISSP, CSSLP Goebel Consult Spezialist f?r IT-Sicherheit in komplexen Umgebungen http://www.goebel-consult.de Monatliche Kolumne: http://www.cissp-gefluester.de/ Goebel Consult ist Mitglied bei http://www.7-it.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6347 bytes Desc: S/MIME Cryptographic Signature URL: From oliver.schoenborn at gmail.com Sun Dec 18 20:39:03 2011 From: oliver.schoenborn at gmail.com (oliver) Date: Sun, 18 Dec 2011 14:39:03 -0500 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: <4EEE078B.5020201@goebel-consult.de> References: <4EEB38FC.6090209@goebel-consult.de> <4EEE078B.5020201@goebel-consult.de> Message-ID: On Sun, Dec 18, 2011 at 10:32 AM, Hartmut Goebel wrote: > ** > Am 18.12.2011 06:07, schrieb oliver: > > > Processing download > error: Couldn't find a setup script in > c:\docume~1\schoenb\locals~1\temp\easy_install-m52ynu\download > > Downloading > http://sourceforge.net/projects/pubsub/files/pubsub/3.1.1b1/PyPubSub-3.1.1b1-py2.6.egg/download > > The filename is "download", no .egg extension > > ... > This *reall* issue is sourceforge adding a "/download" to the URL. I filed > a bug a few years ago, but as expected, it has been ignored. > > Nevertheless I once wrote a script for handling this bug. I'll prepre a > patch for easy_install when I find some time. > > Thanks Hartmut, that would be awesome. There is some code in package_index.py that attempts to handle it but maybe the issue is other (btw the "Yuck" is not mine!): def egg_info_for_url(url): scheme, server, path, parameters, query, fragment = urlparse.urlparse(url) base = urllib2.unquote(path.split('/')[-1]) if server=='sourceforge.net' and base=='download': # XXX Yuck base = urllib2.unquote(path.split('/')[-2]) if '#' in base: base, fragment = base.split('#',1) return base,fragment Oliver -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at v.loewis.de Sun Dec 18 20:47:01 2011 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 18 Dec 2011 20:47:01 +0100 Subject: [Distutils] parallelize setup.py develop/build In-Reply-To: <4EEDD000.4090808@gmail.com> References: <4EEDD000.4090808@gmail.com> Message-ID: <4EEE4335.30000@v.loewis.de> > What I don't really like in fact is to be forced to call an external > subprocess call just to run some other python code.. Why do you want to run this in parallel in the first place? If it's for speed, and to use multiple processors efficiently, then you absolutely need subprocesses. > Going back to the original question, parallelizing many build/develop > calls can be actually faster or is the same in case the hard disk is still only one? I think your approach to parallelization would also suffer from the global interpreter lock, in addition to probably experiencing an IO bound. It may be that you can increase IO utilization with a threaded approach also, but I really suggest that using subprocesses is much better. Regards, Martin From pje at telecommunity.com Sun Dec 18 21:01:18 2011 From: pje at telecommunity.com (PJ Eby) Date: Sun, 18 Dec 2011 15:01:18 -0500 Subject: [Distutils] easy_install unable to install from sourceforge? In-Reply-To: <4EEE078B.5020201@goebel-consult.de> References: <4EEB38FC.6090209@goebel-consult.de> <4EEE078B.5020201@goebel-consult.de> Message-ID: On Sun, Dec 18, 2011 at 10:32 AM, Hartmut Goebel wrote: > ** > This *reall* issue is sourceforge adding a "/download" to the URL. I filed > a bug a few years ago, but as expected, it has been ignored. > FYI, it's fixed in the trunk, has been for almost two years. "easy_install setuptools==dev06" to install the fixed version. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.crotti.0 at gmail.com Sun Dec 18 22:04:12 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Sun, 18 Dec 2011 21:04:12 +0000 Subject: [Distutils] parallelize setup.py develop/build In-Reply-To: <4EEE4335.30000@v.loewis.de> References: <4EEDD000.4090808@gmail.com> <4EEE4335.30000@v.loewis.de> Message-ID: <4EEE554C.5070205@gmail.com> On 12/18/2011 07:47 PM, "Martin v. L?wis" wrote: > I think your approach to parallelization would also suffer from the > global interpreter lock, in addition to probably experiencing an > IO bound. It may be that you can increase IO utilization with a > threaded approach also, but I really suggest that using subprocesses > is much better. > > Regards, > Martin Well they were two complementary questions, I know that using a pure-python approach can't help much with parallelization.. I can still use multiprocessing/subprocess/therading also if I use this approach, but at least I might have control on what is happening. If I still have to catch SystemExit and check the return codes then I don't gain much though. So the other question is, why setuptools doesn't have a clear API which can be used from other programs? I had a look of the code too and it was quite hard to understand anything, so I gave up and apparently everyone else is using it in the same way... From pje at telecommunity.com Sun Dec 18 22:25:45 2011 From: pje at telecommunity.com (PJ Eby) Date: Sun, 18 Dec 2011 16:25:45 -0500 Subject: [Distutils] parallelize setup.py develop/build In-Reply-To: <4EEDD000.4090808@gmail.com> References: <4EEDD000.4090808@gmail.com> Message-ID: On Sun, Dec 18, 2011 at 6:35 AM, Andrea Crotti wrote: > Since I have to run many setup.py develop/build Why do you need to run many of them? Develop only needs to be re-run if you add a new script to your project, change your setup.py, or change any extensions that are written in C. Otherwise, you do not need to re-run it when your code changes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at simplistix.co.uk Thu Dec 29 12:43:31 2011 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 29 Dec 2011 11:43:31 +0000 Subject: [Distutils] [buildout] latest bootstrap.py fails on all 3 pythons that ship with Mac OS X Lion Message-ID: <4EFC5263.8050008@simplistix.co.uk> Hi All, I just upgraded a machine I want to use as a build server to Mac OS X Lion. It appears that Lion ships with Python 2.5, 2.6 and 2.7, but bootstrap.py fails with each of these: $ python2.5 bootstrap.py The required version of setuptools (>=0.6c11) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'. (Currently using setuptools 0.6c9 (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python)) Okay, so lets try doing what we're told: $ sudo /usr/bin/easy_install-2.5 -U setuptools ... Using /Library/Python/2.5/site-packages/setuptools-0.6c12dev_r88846-py2.5.egg ... $ python2.5 ... >>> import setuptools >>> setuptools.__version__ '0.6c12' Right, so we're all good to go? $ python2.5 bootstrap.py The required version of setuptools (>=0.6c11) is not available, and ... Wha? My guess here is that the setuptools that ships with MacOS is in /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python, and so while the bootstrap does all its hard work to get rid of site-packages, all it's actually doing is getting rid of the setuptools it can work with. Any ideas on what needs to be done to fix the bootstrap? Now, the failures in python2.6 and 2.7 are similar and all the more bizarre: $ python2.6 bootstrap.py Traceback (most recent call last): File "bootstrap.py", line 159, in import pkg_resources ... File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plistlib.py", line 436, in getData LookupError: unknown encoding: ascii Which is odd, since importing pkg_resources outside of the bootstrap works fine: $ python2.6 Python 2.6.7 (r267:88850, Jul 31 2011, 19:30:54) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pkg_resources >>> 2.7 fails in the same way: $ python2.7 bootstrap.py Traceback (most recent call last): File "bootstrap.py", line 159, in import pkg_resources ... File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 436, in getData LookupError: unknown encoding: ascii Any ideas? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk From jon at multani.info Thu Dec 29 16:04:37 2011 From: jon at multani.info (Jonathan Ballet) Date: Thu, 29 Dec 2011 23:04:37 +0800 Subject: [Distutils] Best practices to package a desktop application Message-ID: <20111229150435.GA18461@localhost> Hi, I hav a desktop application which currently runs only on Linux using pyGtk, and is packaged using setuptools/distribute. It ships with a number of non-Python files: * documentation (README, Changelog, Authors, etc.) * .desktop file * application specific's icons * one man file * translation files * and one executable script The setup.py file looks like this so far: setup( name='myapp', ... packages=["myapp"], package_dir={"myapp": "myapp/"}, data_files=[ ('share/myapp', ['README', 'Changelog', 'Authors']), ('share/applications', ['myapp.desktop']), ('share/pixmaps', glob.glob('myapp/pixmaps/*')), ('share/man/man1', ['myapp.1']), ('share/locale/fr/LC_MESSAGES', ['mo/fr/myapp.mo']), ... numerous other translation files ... ], entry_points={'console_scripts': ['myapp=myapp:run']}, ) but I somehow have a bad feeling about this, except for the entry point (which does a great job). When I run ``python setup.py install --prefix="local"``, everything gets installed into ``site-packages/myapp/``, Python files and data files, which seems to be a feature of setuptools/distribute over plain Distutils, whereas it seems to be "cleaner" to split things as described by the ``data_files`` setting (and AFAIK, Distutils does just that). To be clear, I end up with install/lib/python2.7/site-packages/myapp.egg/myapp.py ... install/lib/python2.7/site-packages/myapp.egg/share/myapp/README ... install/lib/python2.7/site-packages/myapp.egg/share/pixmaps/myapp.png ... install/lib/python2.7/site-packages/myapp.egg/share/locale/fr/LC_MESSAGES/myapp.mo ... Whereas I "think" I would like to have this instead, which looks more organized to me: install/lib/python2.7/site-packages/myapp.egg/myapp.py ... install/share/myapp/README ... install/share/pixmaps/myapp.png ... install/share/locale/fr/LC_MESSAGES/myapp.mo ... Actually, someone reported this "bug" to me, as he was expecting the latter whereas he got the former. Also, the application currently uses a custom method to find the location of those data files (mainly the icons which are used at run-time). It does a "terrible" job of trying several well-known locations until it either reaches the file or fails with a laconic error. I guess using ``pkg_resources`` data-access API would be much better, right? Finally, I'm also concerned about Linux distribution packagers, and I would like to package the application so that it also useful and easy for them to repackage and distribute it. After reading setuptools/distribute and distutils documentations, I'm still not what is the best way to proceed. Any hints would be greatly appreciated. Regards, Jonathan From pje at telecommunity.com Thu Dec 29 20:47:44 2011 From: pje at telecommunity.com (PJ Eby) Date: Thu, 29 Dec 2011 14:47:44 -0500 Subject: [Distutils] Best practices to package a desktop application In-Reply-To: <20111229150435.GA18461@localhost> References: <20111229150435.GA18461@localhost> Message-ID: On Thu, Dec 29, 2011 at 10:04 AM, Jonathan Ballet wrote: > Hi, > > I hav a desktop application which currently runs only on Linux using > pyGtk, and is packaged using setuptools/distribute. > > It ships with a number of non-Python files: > > * documentation (README, Changelog, Authors, etc.) > * .desktop file > * application specific's icons > * one man file > * translation files > * and one executable script > > The setup.py file looks like this so far: > > setup( > name='myapp', > ... > packages=["myapp"], > package_dir={"myapp": "myapp/"}, > data_files=[ > ('share/myapp', ['README', 'Changelog', 'Authors']), > ('share/applications', ['myapp.desktop']), > ('share/pixmaps', glob.glob('myapp/pixmaps/*')), > ('share/man/man1', ['myapp.1']), > ('share/locale/fr/LC_MESSAGES', ['mo/fr/myapp.mo']), > ... numerous other translation files ... > > ], > entry_points={'console_scripts': ['myapp=myapp:run']}, > ) > > but I somehow have a bad feeling about this, except for the entry point > (which does a great job). > > When I run ``python setup.py install --prefix="local"``, everything gets > installed into ``site-packages/myapp/``, Python files and data files, > which seems to be a feature of setuptools/distribute over plain > Distutils, whereas it seems to be "cleaner" to split things as described > by the ``data_files`` setting (and AFAIK, Distutils does just that). > > To be clear, I end up with > > install/lib/python2.7/site-packages/myapp.egg/myapp.py > ... > install/lib/python2.7/site-packages/myapp.egg/share/myapp/README > ... > install/lib/python2.7/site-packages/myapp.egg/share/pixmaps/myapp.png > ... > > install/lib/python2.7/site-packages/myapp.egg/share/locale/fr/LC_MESSAGES/myapp.mo > ... > > Whereas I "think" I would like to have this instead, which looks more > organized to me: > > install/lib/python2.7/site-packages/myapp.egg/myapp.py > ... > install/share/myapp/README > ... > install/share/pixmaps/myapp.png > ... > install/share/locale/fr/LC_MESSAGES/myapp.mo > ... > > Actually, someone reported this "bug" to me, as he was expecting the > latter whereas he got the former. > > > Also, the application currently uses a custom method to find the > location of those data files (mainly the icons which are used at > run-time). It does a "terrible" job of trying several well-known > locations until it either reaches the file or fails with a laconic > error. I guess using ``pkg_resources`` data-access API would be much > better, right? > Well, it'd certainly be One Obvious Way to do it. ;-) The way I look at it is, if the "data" file is really just a code constant (i.e., not user-modifiable, nor modified by the program), then it's not really data, it's part of the code. A "resource" rather than data. That's what the pkg_resources API is for: resources. Now, if it's data or configuration -- something the user or program will touch -- then resources don't cut it. You need a way to set that stuff up. Same for documentation, unless it's a program-served resource. Setuptools doesn't handle those so well; eggs and easy_install were designed for application *plugins* more than applications; it was assumed that when you install the self-contained .egg, the application platform would provide documentation browsing and configuration support. So, there was no real provision for installing things to multiple places; even scripts were a bit of an afterthought. Finally, I'm also concerned about Linux distribution packagers, and I > would like to package the application so that it also useful and easy > for them to repackage and distribute it. > If you actually build a system package (e.g. via bdist_rpm), you'll notice that your package will actually be installed the way you want: the data files will go to the right place. That's because "setup.py install --root /somepath" or "setup.py install --single-version-externally-managed" will use distutils conventions for installation. So, don't worry about the system packagers, you're doing it right (enough) with your current mechanism. After reading setuptools/distribute and distutils documentations, I'm > still not what is the best way to proceed. Any hints would be greatly > appreciated. > Based on what you're trying to accomplish, I'd suggest: 1. Use pkg_resources to access constant "resource" files that are not user-changeable 2. Leave configuration, data, or documentation files as 'data_files' in your setup.py 3. If your package doesn't need easy_install support (i.e., it has no dependencies to download), add a setup.cfg with: [install] single_version_externally_managed = 1 record = RECORD And tell people to install it using "setup.py install". This will install it in a flat (no .egg subdirectory) fashion, and with data files to the share/ location you expect. If you *do* need easy_install support, then it's a bit more complex, so I'm not going to spell that out unless you first say that you do need it. ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From chester_lab at fltg.net Fri Dec 30 14:19:42 2011 From: chester_lab at fltg.net (CT) Date: Fri, 30 Dec 2011 08:19:42 -0500 Subject: [Distutils] Problem Using Python 2.7 and Py2Exe with Pygame Module Message-ID: <716BC830FA9A48FD8516F31AAC21DA6E@bruce956f5b965> Hi! I am getting errors and missing modules now that I have loaded Python2.7 and the Pygame modules, but works fine on my old machine using Python2.5 I would like to know what is going wrong here? I also looked on the web and lots of people are having the same problems. Does this mean that Python 2.7 is not wise to use along with Py2Exe when using Pygame modules? Below is the errors and at the end is my Setup file: *** copy extensions *** *** copy dlls *** copying c:\python27\lib\site-packages\py2exe\run.exe -> C:\Make\dist\MusicPlayer.exe The following modules appear to be missing ['AppKit', 'Foundation', 'Numeric', 'OpenGL.GL', '_scproxy', 'copyreg', 'dummy.Process', 'numpy', 'pkg_resources', 'queue', 'winreg', 'pygame.sdlmain_osx'] *** binary dependencies *** Your executable(s) also depend on these dlls which are not included, you may or may not need to distribute them. Make sure you have the license if you distribute any of them, and make sure you don't distribute files belonging to the operating system. OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll USER32.dll - C:\WINDOWS\system32\USER32.dll SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll ole32.dll - C:\WINDOWS\system32\ole32.dll WINMM.DLL - C:\WINDOWS\system32\WINMM.DLL ADVAPI32.DLL - C:\WINDOWS\system32\ADVAPI32.DLL WS2_32.DLL - C:\WINDOWS\system32\WS2_32.DLL GDI32.dll - C:\WINDOWS\system32\GDI32.dll libogg-0.dll - c:\python27\lib\site-packages\pygame\libogg-0.dll KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll SDL_ttf.dll - c:\python27\lib\site-packages\pygame\SDL_ttf.dll The MusicPlayer.exe Has Been Made And Is Located In The Dist Directory! Setup.py File: PY_PROG = "music.py" APP_NAME = "MusicPlayer" cfg = { 'name':APP_NAME, 'version':'1.0', 'description':'', 'author':'', 'author_email':'', 'url':'', 'py2exe.target':'', # 'py2exe.icon':'icon.ico', #64x64 'py2exe.binary':APP_NAME, #leave off the .exe, it will be added 'py2app.target':'', 'py2app.icon':'icon.icns', #128x128 'cx_freeze.cmd':'~/src/cx_Freeze-3.0.3/FreezePython', 'cx_freeze.target':'', 'cx_freeze.binary':APP_NAME, } # usage: python setup.py command # # sdist - build a source dist # py2exe - build an exe # py2app - build an app # cx_freeze - build a linux binary (not implemented) # # the goods are placed in the dist dir for you to .zip up or whatever... from distutils.core import setup, Extension try: import py2exe except: pass import sys import glob import os import shutil try: cmd = sys.argv[1] except IndexError: print 'Usage: setup.py py2exe|py2app|cx_freeze' raise SystemExit # utility for adding subdirectories def add_files( dest, generator): for dirpath, dirnames, filenames in generator: for name in 'CVS', '.svn': if name in dirnames: dirnames.remove(name) for name in filenames: if '~' in name: continue suffix = os.path.splitext(name)[1] if suffix in ('.pyc', '.pyo'): continue if name[0] == '.': continue filename = os.path.join(dirpath, name) dest.append(filename) # define what is our data data = [] add_files( data, os.walk('data')) data.extend( glob.glob('*.txt')) # define what is our source src = [] add_files( src, os.walk('lib')) src.extend( glob.glob('*.py')) # build the sdist target if cmd == 'sdist': f = open( "MANIFEST.in", "w") for l in data: f.write("include "+l+"\n") for l in src: f.write("include "+l+"\n") f.close() setup( name=cfg['name'], version=cfg['version'], description=cfg['description'], author=cfg['author'], author_email=cfg['author_email'], url=cfg['url'], ) # build the py2exe target if cmd in ('py2exe',): dist_dir = os.path.join('dist',cfg['py2exe.target']) data_dir = dist_dir src = PY_PROG dest = cfg['py2exe.binary']+'.py' shutil.copy(src,dest) setup( options={'py2exe':{ 'dist_dir':dist_dir, 'dll_excludes':['_dotblas.pyd','_numpy.pyd'] }}, # windows=[{ console=[{ 'script':dest, # 'icon_resources':[(1,cfg['py2exe.icon'])], }], ) # build the py2app target if cmd == 'py2app': dist_dir = os.path.join('dist',cfg['py2app.target']+'.app') data_dir = os.path.join(dist_dir,'Contents','Resources') from setuptools import setup src = PY_PROG dest = cfg['py2app.target']+'.py' shutil.copy(src,dest) APP = [dest] DATA_FILES = [] OPTIONS = {'argv_emulation': True, 'iconfile':cfg['py2app.icon']} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) # make the cx_freeze target if cmd == 'cx_freeze': dist_dir = os.path.join('dist',cfg['cx_freeze.target']) data_dir = dist_dir os.system('%s --install-dir %s --target-name %s %s' % (cfg['cx_freeze.cmd'], cfg['cx_freeze.binary'], dist_dir, PY_PROG)) # recursively make a bunch of folders def make_dirs(dname_): parts = list(os.path.split(dname_)) dname = None while len(parts): if dname == None: dname = parts.pop(0) else: dname = os.path.join(dname,parts.pop(0)) if not os.path.isdir(dname): os.mkdir(dname) # copy data into the binaries if cmd in ('py2exe','cx_freeze','py2app'): dest = data_dir for fname in data: dname = os.path.join(dest,os.path.dirname(fname)) make_dirs(dname) if not os.path.isdir(fname): shutil.copy(fname,dname)  From chris at simplistix.co.uk Sat Dec 31 11:28:18 2011 From: chris at simplistix.co.uk (Chris Withers) Date: Sat, 31 Dec 2011 10:28:18 +0000 Subject: [Distutils] [buildout] latest bootstrap.py fails on all 3 pythons that ship with Mac OS X Lion In-Reply-To: <4EFC5263.8050008@simplistix.co.uk> References: <4EFC5263.8050008@simplistix.co.uk> Message-ID: <4EFEE3C2.5060306@simplistix.co.uk> On 29/12/2011 11:43, Chris Withers wrote: > I just upgraded a machine I want to use as a build server to Mac OS X > Lion. It appears that Lion ships with Python 2.5, 2.6 and 2.7, but > bootstrap.py fails with each of these: The workaround I'm using is to create a virtualenv with the system python and then use the virtualenv's bin/python to run the bootstrap. This works fine, but it's a bit sad that this is now needed because, I suspect, of the changes which were designed to avoid the need to wrap a buildout in a virtualenv in order to exclude stuff in site-packages. Can anyone else verify my findings? Where should I submit a bug report? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk From greg.ewing at canterbury.ac.nz Sat Dec 31 22:37:08 2011 From: greg.ewing at canterbury.ac.nz (Greg) Date: Sun, 01 Jan 2012 10:37:08 +1300 Subject: [Distutils] Problem Using Python 2.7 and Py2Exe with Pygame Module In-Reply-To: <716BC830FA9A48FD8516F31AAC21DA6E@bruce956f5b965> References: <716BC830FA9A48FD8516F31AAC21DA6E@bruce956f5b965> Message-ID: <4EFF8084.8030003@canterbury.ac.nz> CT wrote: > The following modules appear to be missing > ['AppKit', 'Foundation', 'Numeric', 'OpenGL.GL', '_scproxy', 'copyreg', > 'dummy.Process', 'numpy', 'pkg_resources', 'queue', 'winreg', > 'pygame.sdlmain_osx'] Have you tried running the resulting exe anyway? It's likely that these are dynamically-selected modules that aren't actually needed at run time. Certainly AppKit and Foundation won't be needed on windows, since they're OSX-specific. -- Greg