From cool-rr at cool-rr.com Sun Jul 10 21:25:57 2011 From: cool-rr at cool-rr.com (cool-RR) Date: Sun, 10 Jul 2011 21:25:57 +0200 Subject: [Distutils] Using `pkg_resources` without importing the module Message-ID: Hello, I want to use `pkg_resources` to retrieve an image file from a Python package. But I want to do this without importing the actual package. Is this possible using `pkg_resources`, or does it import the package? Thanks, Ram. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pje at telecommunity.com Mon Jul 11 00:33:04 2011 From: pje at telecommunity.com (P.J. Eby) Date: Sun, 10 Jul 2011 18:33:04 -0400 Subject: [Distutils] Using `pkg_resources` without importing the module In-Reply-To: References: Message-ID: <20110710223321.E7A143A4100@sparrow.telecommunity.com> At 09:25 PM 7/10/2011 +0200, cool-RR wrote: >Hello, > >I want to use `pkg_resources` to retrieve an image file from a >Python package. But I want to do this without importing the actual >package. Is this possible using `pkg_resources`, or does it import the package? It imports the package, as it needs to know what loader object was used, to know whether it will be reading from a zipfile or whatever else. From cool-rr at cool-rr.com Mon Jul 11 00:38:49 2011 From: cool-rr at cool-rr.com (cool-RR) Date: Mon, 11 Jul 2011 00:38:49 +0200 Subject: [Distutils] Using `pkg_resources` without importing the module In-Reply-To: <20110710223321.E7A143A4100@sparrow.telecommunity.com> References: <20110710223321.E7A143A4100@sparrow.telecommunity.com> Message-ID: On Mon, Jul 11, 2011 at 12:33 AM, P.J. Eby wrote: > At 09:25 PM 7/10/2011 +0200, cool-RR wrote: > >> Hello, >> >> I want to use `pkg_resources` to retrieve an image file from a Python >> package. But I want to do this without importing the actual package. Is this >> possible using `pkg_resources`, or does it import the package? >> > > It imports the package, as it needs to know what loader object was used, to > know whether it will be reading from a zipfile or whatever else. > Hm. Are you familiar with any other method that can be used to get resources without importing? If you don't, then my next direction is to combine `pkg_resources` with my "module-tasting" technique; using an `__import__` hook to do a very minimialistic import of a module/package, without importing any other modules that it tries to import. Do you think that this minimalistic import will give `pkg_resources` enough data (about the loader or otherwise) to get the resources? Ram. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pje at telecommunity.com Mon Jul 11 04:36:15 2011 From: pje at telecommunity.com (P.J. Eby) Date: Sun, 10 Jul 2011 22:36:15 -0400 Subject: [Distutils] Using `pkg_resources` without importing the module In-Reply-To: References: <20110710223321.E7A143A4100@sparrow.telecommunity.com> Message-ID: <20110711023633.456DC3A4100@sparrow.telecommunity.com> At 12:38 AM 7/11/2011 +0200, cool-RR wrote: >On Mon, Jul 11, 2011 at 12:33 AM, P.J. Eby ><pje at telecommunity.com> wrote: >At 09:25 PM 7/10/2011 +0200, cool-RR wrote: >Hello, > >I want to use `pkg_resources` to retrieve an image file from a >Python package. But I want to do this without importing the actual >package. Is this possible using `pkg_resources`, or does it import the package? > > >It imports the package, as it needs to know what loader object was >used, to know whether it will be reading from a zipfile or whatever else. > > >Hm. Are you familiar with any other method that can be used to get >resources without importing? > >If you don't, then my next direction is to combine `pkg_resources` >with my "module-tasting" technique; using an `__import__` hook to do >a very minimialistic import of a module/package, without importing >any other modules that it tries to import. Do you think that this >minimalistic import will give `pkg_resources` enough data (about the >loader or otherwise) to get the resources? Dunno. It looks for a __loader__ attribute, so that's got to be there. (Unless it's a normal filesystem package or module; that's the case where __loader__ is not normally set.) From fernando at cmartins.nl Mon Jul 11 21:45:39 2011 From: fernando at cmartins.nl (Fernando Martins) Date: Mon, 11 Jul 2011 21:45:39 +0200 Subject: [Distutils] using ZSQLMethods pypi package in zope 2.13 Message-ID: <4E1B52E3.3020700@cmartins.nl> Hi, I am using zope 2.9.9 and I was trying a migration to 2.13.8 which I have installed with buildout. I am however struggling with this new system, much more complex than the simple old Products system. The zope instance contains a Products folder where I have been able to drop in a few packages (a subfolder in it, actually) from Pypi. However, ZSQLMethods contains the Shared subfolder which is a dependency for the ZSQLMethods and I don't know where to put Shared to make it work (it doesn't work under Products). Based on the buildout.cfg of ZSQLMethods, I did: [buildout] ... parts = ... zsql [zsql] recipe = zc.recipe.testrunner eggs = Products.ZSQLMethods However, running bin/buildout I got Error: Picked: Products.ZSQLMethods = 2.13.4 I guess it should not be so difficult to install ZSQLMethods, but I can't really figure it out. Suggestions? Fernando From tseaver at palladion.com Mon Jul 11 23:04:25 2011 From: tseaver at palladion.com (Tres Seaver) Date: Mon, 11 Jul 2011 17:04:25 -0400 Subject: [Distutils] using ZSQLMethods pypi package in zope 2.13 In-Reply-To: <4E1B52E3.3020700@cmartins.nl> References: <4E1B52E3.3020700@cmartins.nl> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/11/2011 03:45 PM, Fernando Martins wrote: > Hi, > > I am using zope 2.9.9 and I was trying a migration to 2.13.8 which I > have installed with buildout. I am however struggling with this new > system, much more complex than the simple old Products system. > > The zope instance contains a Products folder where I have been able > to drop in a few packages (a subfolder in it, actually) from Pypi. > > However, ZSQLMethods contains the Shared subfolder which is a > dependency for the ZSQLMethods and I don't know where to put Shared > to make it work (it doesn't work under Products). > > Based on the buildout.cfg of ZSQLMethods, I did: > > [buildout] ... parts = ... zsql > > [zsql] recipe = zc.recipe.testrunner eggs = Products.ZSQLMethods > > However, running bin/buildout I got > > Error: Picked: Products.ZSQLMethods = 2.13.4 That error comes from having 'allow-picked-versions = false' in buildout.cfg -- you then need to supply an explicit version for every package. > I guess it should not be so difficult to install ZSQLMethods, but I > can't really figure it out. Suggestions? I think you want 'Products.ZSQLMethods' added to the 'eggs' value for your 'instance' section, so that it is on the sys.path when running the 'instance' script. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4bZVgACgkQ+gerLs4ltQ7egACgsEvUswttXfNiW2HBKH3ethqV kbUAnRhB6F4zstK7FYnuNGIvMR0YO7UE =gKwx -----END PGP SIGNATURE----- From cool-rr at cool-rr.com Tue Jul 12 17:52:41 2011 From: cool-rr at cool-rr.com (cool-RR) Date: Tue, 12 Jul 2011 17:52:41 +0200 Subject: [Distutils] Using `pkg_resources` without importing the module In-Reply-To: <20110711023633.456DC3A4100@sparrow.telecommunity.com> References: <20110710223321.E7A143A4100@sparrow.telecommunity.com> <20110711023633.456DC3A4100@sparrow.telecommunity.com> Message-ID: On Mon, Jul 11, 2011 at 4:36 AM, P.J. Eby wrote: > At 12:38 AM 7/11/2011 +0200, cool-RR wrote: > > On Mon, Jul 11, 2011 at 12:33 AM, P.J. Eby <> **>pje at telecommunity.com> wrote: >> At 09:25 PM 7/10/2011 +0200, cool-RR wrote: >> Hello, >> >> I want to use `pkg_resources` to retrieve an image file from a Python >> package. But I want to do this without importing the actual package. Is this >> possible using `pkg_resources`, or does it import the package? >> >> >> It imports the package, as it needs to know what loader object was used, >> to know whether it will be reading from a zipfile or whatever else. >> >> >> Hm. Are you familiar with any other method that can be used to get >> resources without importing? >> >> If you don't, then my next direction is to combine `pkg_resources` with my >> "module-tasting" technique; using an `__import__` hook to do a very >> minimialistic import of a module/package, without importing any other >> modules that it tries to import. Do you think that this minimalistic import >> will give `pkg_resources` enough data (about the loader or otherwise) to get >> the resources? >> > > Dunno. It looks for a __loader__ attribute, so that's got to be there. > (Unless it's a normal filesystem package or module; that's the case where > __loader__ is not normally set.) > > Yes, I got it to work! So now I can use `pkg_resources` on a package without having to fully import you. After my code is finalized I'll describe the solution and show the code. Ram. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernando at cmartins.nl Tue Jul 12 21:17:48 2011 From: fernando at cmartins.nl (Fernando Martins) Date: Tue, 12 Jul 2011 21:17:48 +0200 Subject: [Distutils] using ZSQLMethods pypi package in zope 2.13 In-Reply-To: References: <4E1B52E3.3020700@cmartins.nl> Message-ID: <4E1C9DDC.6070400@cmartins.nl> On 07/11/2011 11:04 PM, Tres Seaver wrote: [I just realised I had only replied to Tres] >> Error: Picked: Products.ZSQLMethods = 2.13.4 > > That error comes from having 'allow-picked-versions = false' in > buildout.cfg -- you then need to supply an explicit version for every > package. My instance is out of buildout so I tried: [zopepy] recipe = zc.recipe.egg eggs = Zope2 Products.ZSQLMethods >= 2.13.4 gives the same error and Products.ZSQLMethods = 2.13.4 gives another error (I suspect "=" is not valid) ValueError: ('Expected version spec in', 'Products.ZSQLMethods=2.13.4', 'at', '=2.13.4') I commented out allow-picked-versions and I got no errors. However, I got no ZSQL Method in zope. > ... > I think you want 'Products.ZSQLMethods' added to the 'eggs' value for > your 'instance' section, so that it is on the sys.path when running the > 'instance' script. My instance is not in buildout and I would prefer to keep it separate, if possible. I tried [zopepy] because I saw it was making a custom sys.path with the eggs. ZSQLMethods is added to zopepy's sys.path but it does not appear in zope itself. Do I need some extra configuration in the zope instance? I installed ZMySQLDA in Products and it complained about missing Shared.DC.ZRDB. What to do to have the Sahred folder imported by Zope? Thanks, Fernando From johan.rade at gmail.com Thu Jul 14 09:44:51 2011 From: johan.rade at gmail.com (=?ISO-8859-1?Q?Johan_R=E5de?=) Date: Thu, 14 Jul 2011 09:44:51 +0200 Subject: [Distutils] How to specify header files for extension module? Message-ID: Is this the right mailing list for asking questions about how to use distutils? How do I specify the header files in a setup.py script for a Python extension module? Listing them with source files as follows does not work. from distutils.core import setup, Extension from glob import glob setup( name = "Foo", version = "0.1.0", ext_modules = [Extension('Foo', glob('Foo/*.cpp') + glob('Foo/*.h'))] ) But I can not figure out where else to list them. --Johan From leorochael at gmail.com Wed Jul 27 00:52:53 2011 From: leorochael at gmail.com (Leonardo Rochael Almeida) Date: Wed, 27 Jul 2011 00:52:53 +0200 Subject: [Distutils] using ZSQLMethods pypi package in zope 2.13 In-Reply-To: <4E1C9DDC.6070400@cmartins.nl> References: <4E1B52E3.3020700@cmartins.nl> <4E1C9DDC.6070400@cmartins.nl> Message-ID: Hi Fernando, Sorry for not being able to get to this earlier, but I didn't want to leave your message unanswered. It looks, from your message, that you haven't yet understood how to specify packages and versions in a buildout configuration. It also seems like you're trying to dismember python packages to attempt to put directories in certain points of the hierarchy (like directories in the Products folder). I suggest you first read-up on zc.buildout and how it treats python distributions[1], and then I suggest you simply use packages for Products.ZSQLMethods and Products.ZMySQLDA, instead of trying to dismember then and assemble them inside your Zope instance. To do this, simply follow the tutorial at [2], but adding Products.ZSQLMethods and Products.ZMySQLDA to the "eggs" parameter of the section that defines the Zope instance. I've attached to this e-mail one such buildout configuration for your convenience. The tutorial at [2] has some easy-to-fix errors (like creating a 'logs' instead of a 'log' directory, and not creating the initial user for the new Zope instance), but nothing you shouldn't be able to solve. And in case you're still stuck, I recommend you ask for help in one of the Zope lists, since it's likely you'll be stuck in non-buildout problems at that point. [1] http://pypi.python.org/pypi/zc.buildout/1.4.4 [2] http://docs.zope.org/zope2/releases/2.13/INSTALL-buildout.html#creating-a-buildout-based-zope-instance Cheers, Leo On Tue, Jul 12, 2011 at 21:17, Fernando Martins wrote: > On 07/11/2011 11:04 PM, Tres Seaver wrote: > [I just realised I had only replied to Tres] >>> >>> Error: Picked: Products.ZSQLMethods = 2.13.4 >> >> That error comes from having 'allow-picked-versions = false' in >> buildout.cfg -- you then need to supply an explicit version for every >> package. > > My instance is out of buildout so I tried: > > [zopepy] > recipe = zc.recipe.egg > eggs = Zope2 > ? ?Products.ZSQLMethods >= 2.13.4 > > gives the same error and > > Products.ZSQLMethods = 2.13.4 > > gives another error (I suspect "=" is not valid) > > ValueError: ('Expected version spec in', 'Products.ZSQLMethods=2.13.4', > 'at', '=2.13.4') > > I commented out allow-picked-versions and I got no errors. However, I got no > ZSQL Method in zope. >> >> ... >> I think you want 'Products.ZSQLMethods' added to the 'eggs' value for >> your 'instance' section, so that it is on the sys.path when running the >> 'instance' script. > > My instance is not in buildout and I would prefer to keep it separate, if > possible. I tried [zopepy] because I saw it was making a custom sys.path > with the eggs. ZSQLMethods is added to zopepy's sys.path but it does not > appear in zope itself. > > Do I need some extra configuration in the zope instance? > > I installed ZMySQLDA in Products and it complained about missing > Shared.DC.ZRDB. What to do to have the Sahred folder imported by Zope? > > Thanks, > Fernando > _______________________________________________ > Distutils-SIG maillist ?- ?Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig > -------------- next part -------------- A non-text attachment was scrubbed... Name: buildout.cfg Type: application/octet-stream Size: 325 bytes Desc: not available URL: From akabaila at pcug.org.au Wed Jul 27 09:01:21 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 27 Jul 2011 17:01:21 +1000 Subject: [Distutils] unable to upload to pypi Message-ID: <201107271701.21477.akabaila@pcug.org.au> Hi, Our 26 year old grand daughter on a visit from Sydney strongly suggested that I should upload my work to pypi. I think she is right, so I put up a real effort to learn the tools to make the package presentable. I think I did finally succeed to wrap my package in a respectable form. I attach the listing of the setup.py. I think that the install script, the documentation and the package (in Python 3.2) all work fine - as a test I placed it in my home page - documentation : http://akabaila.pcug.org.au/matalg-doc/index.html the package Matalg-0.1.0.tar.gz http://akabaila.pcug.org.au/downloads/ I am registered user of pypi and have downloaded some packages from there. However, try as I have, I can not upload to pypi. I attach the dialog between me and my PC of the last few minutes: I have a ".pypirc" file in my home directory (password obscured): [server-login] username:OldAl password:xxxxxx My PC is named (immodestly) "supremo", the os is kubuntu 11.04 natty, my user name on my PC is "ak", my login name on pypi is "OldAl", the package licence is LDPL - and here is the dialog: ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload running sdist running check reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' creating Matalg-0.1.0 creating Matalg-0.1.0/matalg-mod creating Matalg-0.1.0/matalg-pdf making hard links in Matalg-0.1.0... hard linking README.txt -> Matalg-0.1.0 hard linking setup.py -> Matalg-0.1.0 hard linking matalg-mod/Matalg.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/__init__.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/testMat.py -> Matalg-0.1.0/matalg-mod hard linking matalg-pdf/quickStart.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/referenceMatalg.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/userManual.pdf -> Matalg-0.1.0/matalg-pdf Creating tar archive removing 'Matalg-0.1.0' (and everything under it) running upload Submitting dist/Matalg-0.1.0.tar.gz to http://pypi.python.org/pypi Upload failed (403): Forbidden ak at supremo:/dat/work/py3/Matrix-Algebra$ It all seem to indicate that either my password is not recognised, my ID is in doubt - or the more mundane - I am making the same mistake over and over again. What can I do (other than banging my head against a wall)? Algis Kabaila, PhD, MEngSc (UNSW) http://akabaila.pcug.org.au/StructuralAnalysis.pdf -------------- next part -------------- A non-text attachment was scrubbed... Name: setup.py Type: text/x-python Size: 3075 bytes Desc: not available URL: From mailing at franzoni.eu Wed Jul 27 09:49:17 2011 From: mailing at franzoni.eu (Alan Franzoni) Date: Wed, 27 Jul 2011 09:49:17 +0200 Subject: [Distutils] unable to upload to pypi In-Reply-To: <201107271701.21477.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> Message-ID: <4E2FC2FD.7050004@franzoni.eu> On 07/27/2011 09:01 AM, Algis Kabaila wrote: > ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload I can't see Matalg on pypi. Have you tried registering before uploading? Can you see Matalg in the list of packages you own when you login into pypi website? python setup.py register sdist upload should do the trick. From wichert at wiggy.net Wed Jul 27 09:14:51 2011 From: wichert at wiggy.net (Wichert Akkerman) Date: Wed, 27 Jul 2011 09:14:51 +0200 Subject: [Distutils] unable to upload to pypi In-Reply-To: <201107271701.21477.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> Message-ID: <4E2FBAEB.3030701@wiggy.net> On 07/27/2011 09:01 AM, Algis Kabaila wrote: > I have a ".pypirc" file in my home directory (password obscured): > > [server-login] > username:OldAl > password:xxxxxx Can you try using "pypi" as section name instead of "server-login" ? Wichert. From reinout at vanrees.org Wed Jul 27 11:54:01 2011 From: reinout at vanrees.org (Reinout van Rees) Date: Wed, 27 Jul 2011 11:54:01 +0200 Subject: [Distutils] unable to upload to pypi In-Reply-To: <201107271701.21477.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> Message-ID: On 27-07-11 09:01, Algis Kabaila wrote: > ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload What I always do is not just "sdist upload", but "sdist upload register". I think the "register" step is what you're missing. Initially, you *need* to use register to get the package registered (and created) on pypi, afterwards you can upload. In my experience, sometimes you need to call the command twice: the first call registers the package but fails in the upload, the second call's upload succeeds. After that, everything is rosy. Reinout -- Reinout van Rees http://reinout.vanrees.org/ reinout at vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" From akabaila at pcug.org.au Wed Jul 27 13:24:57 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 27 Jul 2011 21:24:57 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E2FBAEB.3030701@wiggy.net> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FBAEB.3030701@wiggy.net> Message-ID: <201107272124.58096.akabaila@pcug.org.au> On Wed, 27 Jul 2011 05:14:51 PM Wichert Akkerman wrote: > On 07/27/2011 09:01 AM, Algis Kabaila wrote: > > I have a ".pypirc" file in my home directory (password obscured): > > > > [server-login] > > username:OldAl > > password:xxxxxx > > Can you try using "pypi" as section name instead of "server-login" ? > > Wichert. Sure - you mean to change the script to: [pypi] username .. etc? Will report back in a few minutes. Many thanks! Al. From akabaila at pcug.org.au Wed Jul 27 13:40:47 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 27 Jul 2011 21:40:47 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E2FBAEB.3030701@wiggy.net> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FBAEB.3030701@wiggy.net> Message-ID: <201107272140.48111.akabaila@pcug.org.au> On Wed, 27 Jul 2011 05:14:51 PM Wichert Akkerman wrote: > On 07/27/2011 09:01 AM, Algis Kabaila wrote: > > I have a ".pypirc" file in my home directory (password obscured): > > > > [server-login] > > username:OldAl > > password:xxxxxx > > Can you try using "pypi" as section name instead of "server-login" ? > > Wichert. Changed the .pypirc to: [pypi] username:OldAl password: xxxxx Of course, xxxx is actually my password - in the clear... I must confess that something seems to be missing from the ,pypirc file. It looks as if something is missing from it... Now the dialog is as follows: ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py register sdist upload running register running check We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit Your selection [default 1]: Username: OldAl Password: Registering Matalg to http://pypi.python.org/pypi Server response (400): Bad Request running sdist reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' creating Matalg-0.1.0 creating Matalg-0.1.0/matalg-mod creating Matalg-0.1.0/matalg-pdf making hard links in Matalg-0.1.0... hard linking README.txt -> Matalg-0.1.0 hard linking setup.py -> Matalg-0.1.0 hard linking matalg-mod/Matalg.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/__init__.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/testMat.py -> Matalg-0.1.0/matalg-mod hard linking matalg-pdf/quickStart.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/referenceMatalg.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/userManual.pdf -> Matalg-0.1.0/matalg-pdf Creating tar archive removing 'Matalg-0.1.0' (and everything under it) running upload Submitting dist/Matalg-0.1.0.tar.gz to http://pypi.python.org/pypi Upload failed (401): Unauthorized ak at supremo:/dat/work/py3/Matrix-Algebra$ I have tried to implement all the suggestions. Will try a few other variations, though I am not very optimistic. The gremlins must be after me... Thank you all for the suggestions. I will keep reporting my experiences. The time differences may put some space between us. I hope you will be patiend with me. I am truly grateful! Al. From akabaila at pcug.org.au Wed Jul 27 13:58:25 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 27 Jul 2011 21:58:25 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E2FC2FD.7050004@franzoni.eu> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FC2FD.7050004@franzoni.eu> Message-ID: <201107272158.25564.akabaila@pcug.org.au> On Wed, 27 Jul 2011 05:49:17 PM Alan Franzoni wrote: > On 07/27/2011 09:01 AM, Algis Kabaila wrote: > > ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload > > I can't see Matalg on pypi. > > Have you tried registering before uploading? Can you see Matalg in the > list of packages you own when you login into pypi website? > > > python setup.py register sdist upload > > > should do the trick. > No, I do not see Matalg registered - tried to search for it on the pypi website's search tool - not there. Tried to register, but failed. Removed the .pypirc script - it seems to me a convenience device. Itis also a possible source of errors. A minor security risk, too. The dialog is now: ******************************* ak at supremo:~$ rm .pypirc ak at supremo:~$ cd /dat/work/py3/Matrix-Algebra/ ak at supremo:/dat/work/py3/Matrix-Algebra$ ls COPYING.txt dist doc MANIFEST MANIFEST.in matalg-mod matalg-pdf matalg- rst README.txt setup.py ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py register running register running check We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit Your selection [default 1]: 1 Username: OldAl Password: Registering Matalg to http://pypi.python.org/pypi Server response (400): Bad Request ak at supremo:/dat/work/py3/Matrix-Algebra$ ********************************* Clearly, the registration has failed. I am bushed. If you can suggest anything else, I would dearly like to hear it. Thank you for your attention and help, Al. From akabaila at pcug.org.au Wed Jul 27 14:11:07 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 27 Jul 2011 22:11:07 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: References: <201107271701.21477.akabaila@pcug.org.au> Message-ID: <201107272211.07653.akabaila@pcug.org.au> On Wed, 27 Jul 2011 07:54:01 PM Reinout van Rees wrote: > On 27-07-11 09:01, Algis Kabaila wrote: > > ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload > > What I always do is not just "sdist upload", but "sdist upload > register". I think the "register" step is what you're missing. > > Initially, you *need* to use register to get the package registered (and > created) on pypi, afterwards you can upload. In my experience, sometimes > you need to call the command twice: the first call registers the package > but fails in the upload, the second call's upload succeeds. > > After that, everything is rosy. > > > > Reinout Changed .pypirc to the original: [server-login] username:OldAl password:xxxxxx The above seems to work, as the pypi server did not offer to choose an item on the list of options. As the following dialog shows, the registration was refused. ********************* ak at supremo:~$ cd /dat/work/py3/Matrix-Algebra/ ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py register running register running check Registering Matalg to http://pypi.python.org/pypi Server response (400): Bad Request ak at supremo:/dat/work/py3/Matrix-Algebra$ ********************* Thanks for trying. Al. From zvezdan at zope.com Wed Jul 27 14:34:03 2011 From: zvezdan at zope.com (Zvezdan Petkovic) Date: Wed, 27 Jul 2011 08:34:03 -0400 Subject: [Distutils] unable to upload to pypi In-Reply-To: <201107272140.48111.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FBAEB.3030701@wiggy.net> <201107272140.48111.akabaila@pcug.org.au> Message-ID: On Jul 27, 2011, at 7:40 AM, Algis Kabaila wrote: You ran this command, apparently: python setup.py register sdist upload > Now the dialog is as follows: > ... > Registering Matalg to http://pypi.python.org/pypi > Server response (400): Bad Request It does not know what to register at this point. There is no package built when it tries to register. > running sdist > ... > Creating tar archive > removing 'Matalg-0.1.0' (and everything under it) Now you have a source distribution built. > running upload > Submitting dist/Matalg-0.1.0.tar.gz to http://pypi.python.org/pypi > Upload failed (401): Unauthorized But you cannot upload it because it was not registered. In short, the order is important: 1. build a source distribution 2. register 3. upload So the command should be (notice the order): python setup.py sdist register upload > Thank you all for the suggestions. I will keep reporting my experiences. Please, tell us how the above works. Best regards, Zvezdan From mailing at franzoni.eu Wed Jul 27 15:34:39 2011 From: mailing at franzoni.eu (Alan Franzoni) Date: Wed, 27 Jul 2011 15:34:39 +0200 Subject: [Distutils] unable to upload to pypi In-Reply-To: References: <201107271701.21477.akabaila@pcug.org.au> <4E2FBAEB.3030701@wiggy.net> <201107272140.48111.akabaila@pcug.org.au> Message-ID: <4E3013EF.8020207@franzoni.eu> On Wed 27 Jul 2011 02:34:03 PM CEST, Zvezdan Petkovic wrote: > In short, the order is important: > > 1. build a source distribution > 2. register > 3. upload I'd object that. I've always used register without creating a source dist; the data used for registering just comes from the setup.py file AFAIK. I've tried downloading the .tar.gz and using its setup.py, I got this error: running register running check Registering Matalg to http://pypi.python.org/pypi Server response (400): Invalid classifier "Development Status :: Release 0.1.0" Take a look at those, you should use those values as classifier, I was able to register Matalg without issues (I'll now delete it) http://pypi.python.org/pypi?%3Aaction=list_classifiers From zvezdan at zope.com Wed Jul 27 16:23:32 2011 From: zvezdan at zope.com (Zvezdan Petkovic) Date: Wed, 27 Jul 2011 10:23:32 -0400 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E3013EF.8020207@franzoni.eu> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FBAEB.3030701@wiggy.net> <201107272140.48111.akabaila@pcug.org.au> <4E3013EF.8020207@franzoni.eu> Message-ID: On Jul 27, 2011, at 9:34 AM, Alan Franzoni wrote: > On Wed 27 Jul 2011 02:34:03 PM CEST, Zvezdan Petkovic wrote: >> In short, the order is important: >> >> 1. build a source distribution >> 2. register >> 3. upload > > I'd object that. I've always used register without creating a source > dist; the data used for registering just comes from the setup.py file > AFAIK. I stand corrected. :-) The above is my usual workflow and I never had issues with registering/uploading. The OPs recorded session with pypi looked as if it had the problem because of the ordering. Hence my suggestion above. > I've tried downloading the .tar.gz and using its setup.py, I got this > error: > > running register > running check > Registering Matalg to http://pypi.python.org/pypi > Server response (400): Invalid classifier "Development Status :: > Release 0.1.0" This is obviously the problem, but it wasn't shown in the recorded session he posted. As I was quickly skimming through thread, I did not even notice that the source was posted (and did not have time to try it even if I did). Thank you for researching this. I'm sure the OP will appreciate your findings as well. Best regards, Zvezdan From akabaila at pcug.org.au Wed Jul 27 18:10:21 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 28 Jul 2011 02:10:21 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E3013EF.8020207@franzoni.eu> References: <201107271701.21477.akabaila@pcug.org.au> <4E3013EF.8020207@franzoni.eu> Message-ID: <201107280210.22216.akabaila@pcug.org.au> On Wed, 27 Jul 2011 11:34:39 PM Alan Franzoni wrote: > On Wed 27 Jul 2011 02:34:03 PM CEST, Zvezdan Petkovic wrote: > > In short, the order is important: > > 1. build a source distribution > > 2. register > > 3. upload > > I'd object that. I've always used register without creating a source > dist; the data used for registering just comes from the setup.py file > AFAIK. > > I've tried downloading the .tar.gz and using its setup.py, I got this > error: > > > running register > running check > Registering Matalg to http://pypi.python.org/pypi > Server response (400): Invalid classifier "Development Status :: > Release 0.1.0" > > Take a look at those, you should use those values as classifier, I was > able to register Matalg without issues (I'll now delete it) > > http://pypi.python.org/pypi?%3Aaction=list_classifiers > Thank your for the fine detective work. The biggest finds from my viewpoint are: 1. The registration uploads the data from setup.py and checks its validity and in my case rejects it because it finds it faulty. 2. Trying to download it gives some information about the attempted registration. And a question: How to attempt a download? So the failure to register is a simple mistake, which needs to be corrected. My 86 years of age are showing... There are other shorcomings in the setup.py. For instance, a long description is missing. Big thank you to you! I will correct the setup.py and report to the list of the result somewhat later - the time here is 2 am and I better return to bed so that I do not make an even biger mess. Al. From akabaila at pcug.org.au Wed Jul 27 18:57:19 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 28 Jul 2011 02:57:19 +1000 Subject: [Distutils] unable to upload to pypi In-Reply-To: <4E2FC2FD.7050004@franzoni.eu> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FC2FD.7050004@franzoni.eu> Message-ID: <201107280257.20245.akabaila@pcug.org.au> On Wed, 27 Jul 2011 05:49:17 PM Alan Franzoni wrote: > On 07/27/2011 09:01 AM, Algis Kabaila wrote: > > ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload > > I can't see Matalg on pypi. > > Have you tried registering before uploading? Can you see Matalg in the > list of packages you own when you login into pypi website? > > > python setup.py register sdist upload > > > should do the trick. I am afraid I could not resist the temptation. I changed all qualifiers to "standard": ********************************* ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py register running register running check Registering Matalg to http://pypi.python.org/pypi Server response (200): OK ********************************* ********************************* ak at supremo:/dat/work/py3/Matrix-Algebra$ python setup.py sdist upload running sdist running check reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' creating Matalg-0.1.0 creating Matalg-0.1.0/matalg-mod creating Matalg-0.1.0/matalg-pdf making hard links in Matalg-0.1.0... hard linking README.txt -> Matalg-0.1.0 hard linking setup.py -> Matalg-0.1.0 hard linking matalg-mod/Matalg.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/__init__.py -> Matalg-0.1.0/matalg-mod hard linking matalg-mod/testMat.py -> Matalg-0.1.0/matalg-mod hard linking matalg-pdf/quickStart.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/referenceMatalg.pdf -> Matalg-0.1.0/matalg-pdf hard linking matalg-pdf/userManual.pdf -> Matalg-0.1.0/matalg-pdf Creating tar archive removing 'Matalg-0.1.0' (and everything under it) running upload Submitting dist/Matalg-0.1.0.tar.gz to http://pypi.python.org/pypi Server response (200): OK ak at supremo:/dat/work/py3/Matrix-Algebra$ ********************************* It is through your kind help that it ended that way! Thank you all and good night! Al. From fernando at cmartins.nl Thu Jul 28 00:24:58 2011 From: fernando at cmartins.nl (Fernando) Date: Wed, 27 Jul 2011 23:24:58 +0100 Subject: [Distutils] using ZSQLMethods pypi package in zope 2.13 In-Reply-To: References: <4E1C9DDC.6070400@cmartins.nl> Message-ID: <20110727222458.F21C2B2DC2E79@bmail03.one.com> Leo, thanks for your feedback. I can't work on it right now but I hope to give it another go in about a week. Cheers, Fernando On Jul 26, 2011 23:52 "Leonardo Rochael Almeida" wrote: > Hi Fernando, > > Sorry for not being able to get to this earlier, but I didn't want to > leave your message unanswered. > > It looks, from your message, that you haven't yet understood how to > specify packages and versions in a buildout configuration. It also > seems like you're trying to dismember python packages to attempt to > put directories in certain points of the hierarchy (like directories > in the Products folder). > > I suggest you first read-up on zc.buildout and how it treats python > distributions[1], and then I suggest you simply use packages for > Products.ZSQLMethods and Products.ZMySQLDA, instead of trying to > dismember then and assemble them inside your Zope instance. > > To do this, simply follow the tutorial at [2], but adding > Products.ZSQLMethods and Products.ZMySQLDA to the "eggs" parameter of > the section that defines the Zope instance. I've attached to this > e-mail one such buildout configuration for your convenience. > > The tutorial at [2] has some easy-to-fix errors (like creating a > 'logs' instead of a 'log' directory, and not creating the initial user > for the new Zope instance), but nothing you shouldn't be able to > solve. > > And in case you're still stuck, I recommend you ask for help in one of > the Zope lists, since it's likely you'll be stuck in non-buildout > problems at that point. > > [1] > > [2] > ng-a-buildout-based-zope-instance> > > Cheers, > > Leo > > On Tue, Jul 12, 2011 at 21:17, Fernando Martins > wrote: > > On 07/11/2011 11:04 PM, Tres Seaver wrote: > > [I just realised I had only replied to Tres] > > > > > > > > Error: Picked: Products.ZSQLMethods = 2.13.4 > > > > > > That error comes from having 'allow-picked-versions = false' in > > > buildout.cfg -- you then need to supply an explicit version for > > > every > > > package. > > > > My instance is out of buildout so I tried: > > > > [zopepy] > > recipe = zc.recipe.egg > > eggs = Zope2 > > Products.ZSQLMethods >= 2.13.4 > > > > gives the same error and > > > > Products.ZSQLMethods = 2.13.4 > > > > gives another error (I suspect "=" is not valid) > > > > ValueError: ('Expected version spec in', > > 'Products.ZSQLMethods=2.13.4', > > 'at', '=2.13.4') > > > > I commented out allow-picked-versions and I got no errors. However, > > I got no > > ZSQL Method in zope. > > > > > > ... > > > I think you want 'Products.ZSQLMethods' added to the 'eggs' value > > > for > > > your 'instance' section, so that it is on the sys.path when > > > running the > > > 'instance' script. > > > > My instance is not in buildout and I would prefer to keep it > > separate, if > > possible. I tried [zopepy] because I saw it was making a custom > > sys.path > > with the eggs. ZSQLMethods is added to zopepy's sys.path but it does > > not > > appear in zope itself. > > > > Do I need some extra configuration in the zope instance? > > > > I installed ZMySQLDA in Products and it complained about missing > > Shared.DC.ZRDB. What to do to have the Sahred folder imported by > > Zope? > > > > Thanks, > > Fernando > > _______________________________________________ > > Distutils-SIG maillist - > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From reinout at vanrees.org Fri Jul 29 13:58:41 2011 From: reinout at vanrees.org (Reinout van Rees) Date: Fri, 29 Jul 2011 13:58:41 +0200 Subject: [Distutils] unable to upload to pypi In-Reply-To: <201107280257.20245.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> <4E2FC2FD.7050004@franzoni.eu> <201107280257.20245.akabaila@pcug.org.au> Message-ID: On 27-07-11 18:57, Algis Kabaila wrote: > It is through your kind help that it ended that way! > > Thank you all and good night! And... thanks for reporting back that it all worked! Reinout -- Reinout van Rees http://reinout.vanrees.org/ reinout at vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" From akabaila at pcug.org.au Sat Jul 30 09:35:37 2011 From: akabaila at pcug.org.au (Algis Kabaila) Date: Sat, 30 Jul 2011 17:35:37 +1000 Subject: [Distutils] unable to upload to pypi [SOLVED] In-Reply-To: <201107271701.21477.akabaila@pcug.org.au> References: <201107271701.21477.akabaila@pcug.org.au> Message-ID: <201107301735.37501.akabaila@pcug.org.au> On Wed, 27 Jul 2011 05:01:21 PM Algis Kabaila wrote: > Hi, > This is a *thank you* note for all who participated in this thread: Wichert Akkerman Zvezdan Petkovic Alan Franzoni Reinout van Rees and anyone else that I missed :) I am truly grateful to you all. Finally, apologies for my "noise" on this list, but the the this list is not very busy otherwise. Special thank you to Alan Franzoni, who did solve the problem and to Zvezdan Petkovic, who was mostly right all along. Al.