From andrea.crotti.0 at gmail.com Wed Feb 1 16:08:19 2012 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Wed, 01 Feb 2012 15:08:19 +0000 Subject: [Distutils] getting the local site_packages Message-ID: <4F295563.8080803@gmail.com> With something like this site_packages = pkg_resources.get_python_lib() I get the python global path of the site-packages directory, is there a way to get also the local one, which for example on Linux might be something like $HOME/.local/lib/site-packages ? Thanks, Andrea From hanno at hannosch.eu Thu Feb 2 00:16:57 2012 From: hanno at hannosch.eu (Hanno Schlichting) Date: Thu, 2 Feb 2012 00:16:57 +0100 Subject: [Distutils] getting the local site_packages In-Reply-To: <4F295563.8080803@gmail.com> References: <4F295563.8080803@gmail.com> Message-ID: On Wed, Feb 1, 2012 at 4:08 PM, Andrea Crotti wrote: > With something like this > site_packages = pkg_resources.get_python_lib() > > I get the python global path of the site-packages directory, is there a way > to get also > the local one, which for example on Linux might be something like > > $HOME/.local/lib/site-packages What does import site; site.getusersitepackages() return - as per http://docs.python.org/library/site.html#site.getusersitepackages Hanno From andrea.crotti.0 at gmail.com Thu Feb 2 11:20:42 2012 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Thu, 02 Feb 2012 10:20:42 +0000 Subject: [Distutils] getting the local site_packages In-Reply-To: References: <4F295563.8080803@gmail.com> Message-ID: <4F2A637A.6050006@gmail.com> On 02/01/2012 11:16 PM, Hanno Schlichting wrote: > On Wed, Feb 1, 2012 at 4:08 PM, Andrea Crotti wrote: >> With something like this >> site_packages = pkg_resources.get_python_lib() >> >> I get the python global path of the site-packages directory, is there a way >> to get also >> the local one, which for example on Linux might be something like >> >> $HOME/.local/lib/site-packages > What does import site; site.getusersitepackages() return - as per > http://docs.python.org/library/site.html#site.getusersitepackages > > Hanno Sigh, the paleolitic python 2.5 didn't have that function.. but I guess it should be defined somewhere anyway, where else could it be? From janssen at parc.com Fri Feb 3 01:00:14 2012 From: janssen at parc.com (Bill Janssen) Date: Thu, 2 Feb 2012 16:00:14 PST Subject: [Distutils] where should one download distutils2 from? Message-ID: <8437.1328227214@parc.com> I just tried to download distutils2 from PyPI (1.0a3) for my OS X 10.5.8 system (that's Python 2.5). Errors out trying to run setup.py: % python setup.py build ... running build_scripts creating build/scripts-2.5 error: file 'distutils2/mkpkg.py' does not exist % This seems an unhappy state of affairs. So, where should I download a real copy from, and why isn't the package on PyPI up-to-date? Bill From pje at telecommunity.com Fri Feb 3 06:41:10 2012 From: pje at telecommunity.com (PJ Eby) Date: Fri, 3 Feb 2012 00:41:10 -0500 Subject: [Distutils] getting the local site_packages In-Reply-To: <4F2A637A.6050006@gmail.com> References: <4F295563.8080803@gmail.com> <4F2A637A.6050006@gmail.com> Message-ID: On Thu, Feb 2, 2012 at 5:20 AM, Andrea Crotti wrote: > Sigh, the paleolitic python 2.5 didn't have that function.. > but I guess it should be defined somewhere anyway, where else could it be? Not in 2.5, since 2.5 doesn't support user site packages. (Except maybe on OS X, but in that case I'm not sure where it's defined.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From merwok at netwok.org Fri Feb 3 17:44:33 2012 From: merwok at netwok.org (=?UTF-8?Q?=C3=89ric_Araujo?=) Date: Fri, 03 Feb 2012 17:44:33 +0100 Subject: [Distutils] =?utf-8?q?where_should_one_download_distutils2_from?= =?utf-8?q?=3F?= In-Reply-To: <8437.1328227214@parc.com> References: <8437.1328227214@parc.com> Message-ID: <04d11c9fd1561f2c8b5d35601cc7d165@netwok.org> Hi, Le 03/02/2012 01:00, Bill Janssen a ?crit : > I just tried to download distutils2 from PyPI (1.0a3) for my > OS X 10.5.8 system (that's Python 2.5). > > Errors out trying to run setup.py: > > % python setup.py build > ... > running build_scripts > creating build/scripts-2.5 > error: file 'distutils2/mkpkg.py' does not exist Strange that our tox runs did not catch this :/ > This seems an unhappy state of affairs. So, where should I > download a real copy from, hg.python.org/distutils2 > and why isn't the package on PyPI up-to-date? I need to fix http://bugs.python.org/issue13463 before releasing a4. Time/work/health/material (i.e. my Windows VM doesn?t start so I can?t test, the server I use for SSH tunnels is down) constraints have delayed me. Cheers From janssen at parc.com Fri Feb 3 18:25:37 2012 From: janssen at parc.com (Bill Janssen) Date: Fri, 3 Feb 2012 09:25:37 PST Subject: [Distutils] where should one download distutils2=?UTF-8?Q?from=3F?= In-Reply-To: <04d11c9fd1561f2c8b5d35601cc7d165@netwok.org> References: <8437.1328227214@parc.com> <04d11c9fd1561f2c8b5d35601cc7d165@netwok.org> Message-ID: <21971.1328289937@parc.com> ?ric Araujo wrote: > > This seems an unhappy state of affairs. So, where should I > > download a real copy from, > hg.python.org/distutils2 Yes, that seems to install properly on my OS X 10.5.8 machine. Thanks! I promised Andi Vajda over at PyLucene that I'd see if distutils2 is up to the job of replacing setuptools for the PyLucene JCC build. The basic requirement is that it knows how to build shared libraries, something which setuptools knows how to do and distutils doesn't. Bill From robert at altmansoftwaredesign.com Sat Feb 4 20:06:39 2012 From: robert at altmansoftwaredesign.com (Robert Altman) Date: Sat, 4 Feb 2012 13:06:39 -0600 Subject: [Distutils] trouble determining source for gcc command arguments Message-ID: I have two mac os/x computers, each up to date with the same compiler and environments, yet it appears that distutils is emitting different gcc arguments. Specifically, one of the computers is attempting to compile Mercurial using the -isysoot ... argument, effectively causing the build process to fail. Details: os/x 10.7 Python 2.7.2 (installed from 10.7 installer at python.org) Mercurial source is 2.1 I don't see any environment settings which would cause gcc to use to -isysroot argument and I cannot determine where else it might be coming from (it is not in the Mercurial project), so I believe it must be coming from distutils. Thanks! Robert From nad at acm.org Sun Feb 5 10:36:41 2012 From: nad at acm.org (Ned Deily) Date: Sun, 05 Feb 2012 10:36:41 +0100 Subject: [Distutils] trouble determining source for gcc command arguments References: Message-ID: In article , Robert Altman wrote: > I have two mac os/x computers, each up to date with the same compiler > and environments, yet it appears that distutils is emitting different > gcc arguments. Specifically, one of the computers is attempting to > compile Mercurial using the -isysoot ... argument, effectively causing > the build process to fail. > Details: os/x 10.7 > Python 2.7.2 (installed from 10.7 installer at python.org) > Mercurial source is 2.1 > I don't see any environment settings which would cause gcc to use to > -isysroot argument and I cannot determine where else it might be > coming from (it is not in the Mercurial project), so I believe it must > be coming from distutils. On OS/X, Distutils tries to ensure that any C extension modules it is asked to build are built with the same compiler options as Python itself was built with. There is no particular reason why -sysroot should be a problem for building hg. If you are seeing different results on the two machines with the same OS level and Pythons, most likely you aren't using the Pythons you think you are or you are setting environment variables to override the defaults. In any case, you need to provide more information. Exactly what errors are you seeing? -- Ned Deily, nad at acm.org From merwok at netwok.org Sun Feb 5 13:01:17 2012 From: merwok at netwok.org (=?UTF-8?B?w4lyaWMgQXJhdWpv?=) Date: Sun, 05 Feb 2012 13:01:17 +0100 Subject: [Distutils] where should one download distutils2 from? In-Reply-To: <21971.1328289937@parc.com> References: <8437.1328227214@parc.com> <04d11c9fd1561f2c8b5d35601cc7d165@netwok.org> <21971.1328289937@parc.com> Message-ID: <4F2E6F8D.3070909@netwok.org> Hi, >> hg.python.org/distutils2 > Yes, that seems to install properly on my OS X 10.5.8 machine. Great! I?m often worried because distutils2 does not get buildbots validation, unlike packaging. > I promised Andi Vajda over at PyLucene that I'd see if distutils2 is up > to the job of replacing setuptools for the PyLucene JCC build. Nice to see more people testing it with real projects. As long as you know that distutils2 is not supposed to be a drop-in replacement, and that you may have to adapt a few things, things should go okay. > The basic requirement is that it knows how to build shared libraries, > something which setuptools knows how to do and distutils doesn't. To quote my reply to you on fellowship a few months ago: This would be useful, please open a feature request on bugs.python.org. Currently d2 has no support for shared libraries, only ?C/C++ libraries??not sure if they?re static or something else. Cheers From merwok at netwok.org Sun Feb 5 13:00:22 2012 From: merwok at netwok.org (=?UTF-8?B?w4lyaWMgQXJhdWpv?=) Date: Sun, 05 Feb 2012 13:00:22 +0100 Subject: [Distutils] where should one download distutils2 from? In-Reply-To: <21971.1328289937@parc.com> References: <8437.1328227214@parc.com> <04d11c9fd1561f2c8b5d35601cc7d165@netwok.org> <21971.1328289937@parc.com> Message-ID: <4F2E6F56.7000808@netwok.org> Hi, >> hg.python.org/distutils2 > Yes, that seems to install properly on my OS X 10.5.8 machine. Great! I?m often worried because distutils2 does not get buildbots validation, unlike packaging. > I promised Andi Vajda over at PyLucene that I'd see if distutils2 is up > to the job of replacing setuptools for the PyLucene JCC build. Nice to see more people testing it with real projects. As long as you know that distutils2 is not supposed to be a drop-in replacement, and that you may have to adapt a few things, things should go okay. > The basic requirement is that it knows how to build shared libraries, > something which setuptools knows how to do and distutils doesn't. To quote my reply to you on fellowship a few months ago: This would be useful, please open a feature request on bugs.python.org. Currently d2 has no support for shared libraries, only ?C/C++ libraries??not sure if they?re static or something else. Cheers From merwok at netwok.org Sun Feb 5 13:11:59 2012 From: merwok at netwok.org (=?UTF-8?B?w4lyaWMgQXJhdWpv?=) Date: Sun, 05 Feb 2012 13:11:59 +0100 Subject: [Distutils] Is the Packaging Guide dead? In-Reply-To: References: <8e5f4c2bb0c03d9257605dfca18df100@netwok.org> Message-ID: <4F2E720F.2020009@netwok.org> Le 29/01/2012 17:28, Alex Clark a ?crit : > I wouldn't declare it dead based on that info (i.e. that > distutils2/packaging will replace distribute.) I was more judging from the fact that the guide has seen no update in a year. If not dead, it?s not moving much :) > Distribute is still the guiding force in getting everyone to > distutils/packaging IIUC. Is it? I see that development is still going on, but I don?t know what distribute?s plan is to support the transition: do you still want to implement the new PEPs (possibly using d2 under the cover)? Or should distribute get no new features and just continue to exist for people who use it, and when they want to switch they?d benefit from the compat layer in d2? > So, the documentation has not been updated recently, but everything in > the guide is still relevant AFAIK. Some facts in the guide are outdated, and some opinions I disagree with. If we put ourselves in the shoes of someone wanting to know what?s going on in the Python packaging world now and how they can distribute their code, the guide only partly helps. Regards From yegorslists at googlemail.com Mon Feb 6 11:57:35 2012 From: yegorslists at googlemail.com (Yegor Yefremov) Date: Mon, 6 Feb 2012 11:57:35 +0100 Subject: [Distutils] [RFC] real cross-compiling support for Distutils2 Message-ID: What is the state of real cross-compiling support in Distutils2? AFAIK cross-compiling is supported only for various Windows compilers Visual Studio, MinGW, Borland etc. What I need is an option to cross-compile software for other architecture like: host - x86, target - ARM. I encountered following problems trying to cross-compile netifaces 6.0 for ARM Linux: 1. the cross-compiler was not used for all compilation stages without following package: http://pypi.python.org/pypi/distutilscross 2. during header search process temp c files were created, compiled and executed. Execution led to an error (cross-compiled binary). What is the proper way of searching for required headers/libs aka autoconf? 3. Libraries search paths (LDFLAGS) were ignored at linking stage Version 7.0 fixes problems 2 to 3, but the first one still remains. Projects/distros that are using cross-compilation are: Yocto (http://www.yoctoproject.org/) Buildroot (http://buildroot.uclibc.org/) many others Regards, Yegor From vikashagrawal1990 at gmail.com Wed Feb 8 18:32:50 2012 From: vikashagrawal1990 at gmail.com (vikash agrawal) Date: Wed, 8 Feb 2012 23:02:50 +0530 Subject: [Distutils] Installation Message-ID: hi Everyone, - I am using Python 2.7, so how do I install pysetup. though when I install distutils1.0a3 I do see distutils module in my interactive session but I dont see any pysetup being installed - Also, I had previously come in contact with merwok and I would be applying in GSoC this year under PSF for distutils2 project (as I believe PSF will be under GSoC and distutils will surely be accepted), so I am writing to seek help on what all things should be my target, and how do I move ahead. - Currently, I am trying to work on the ]issue 12944 but due to certain constraints things are not geared up, though I hope they would soon be :) - Please guide me and drop-in all your suggestions Regards Vikash Agrawal -- sent via HTC Sensation -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.m.bray at gmail.com Wed Feb 8 18:53:49 2012 From: erik.m.bray at gmail.com (Erik Bray) Date: Wed, 8 Feb 2012 12:53:49 -0500 Subject: [Distutils] Installation In-Reply-To: References: Message-ID: On Wed, Feb 8, 2012 at 12:32 PM, vikash agrawal wrote: > hi Everyone, > > I am using Python 2.7, so how do I install pysetup. though when I install > distutils1.0a3 I do see distutils module in my interactive session but I > dont see any pysetup being installed That "release" is pretty old, and I'm not sure it even includes the pysetup script. If you're going to be doing d2 development you're best off getting the latest source from hg: https://bitbucket.org/tarek/distutils2 You should also make sure to get the latest cpython repo from http://hg.python.org/cpython to work on packaging. Though I don't know exactly what the current policy is on merging from packaging to distutils2 or vice-versa, so I'm not the best person to comment on that. Erik > Also, I had previously come in contact with merwok and I would be applying > in GSoC this year under PSF for distutils2 project (as I believe PSF will be > under GSoC and distutils will surely be accepted), so I am writing to seek > help on what all things should be my target, and how do I move ahead. > Currently, I am trying to work on the ]issue 12944 but due to certain > constraints things are not geared up, though I hope they would soon be :) > Please guide me and drop-in all your suggestions > > Regards > > Vikash Agrawal > > -- > sent via HTC Sensation > > > > _______________________________________________ > Distutils-SIG maillist ?- ?Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig > From amcnabb at mcnabbs.org Wed Feb 8 22:05:02 2012 From: amcnabb at mcnabbs.org (Andrew McNabb) Date: Wed, 8 Feb 2012 14:05:02 -0700 Subject: [Distutils] 2to3 and version numbers with distribute Message-ID: <20120208210502.GA19377@mcnabbs.org> I'm trying to use 2to3 in setup.py for the first time. I have distribute installed, so it sounds like I should be able to just add "use_2to3=True" to my call to setup, and things should just work. Unfortunately, the setup.py is currently importing the package in order to determine the version number. Specifically, setup.py has: from xyz import version setup(name='xyz', version=version.VERSION, ...) If I run "python3 setup.py build", this fails because the "from xyz import version" causes lots of python3-incompatible code to get called. It seems like there's probably an easy way around this that I'm missing. In theory, I could specify the version number in two different places and hope that they would stay synced, but I'm not smart enough to pull that off. :) Is there anything else I should try? Thanks. -- Andrew McNabb http://www.mcnabbs.org/andrew/ PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868 From barry at python.org Wed Feb 8 22:45:33 2012 From: barry at python.org (Barry Warsaw) Date: Wed, 8 Feb 2012 16:45:33 -0500 Subject: [Distutils] 2to3 and version numbers with distribute In-Reply-To: <20120208210502.GA19377@mcnabbs.org> References: <20120208210502.GA19377@mcnabbs.org> Message-ID: <20120208164533.4ceec377@resist.wooz.org> On Feb 08, 2012, at 02:05 PM, Andrew McNabb wrote: >I'm trying to use 2to3 in setup.py for the first time. I have >distribute installed, so it sounds like I should be able to just add >"use_2to3=True" to my call to setup, and things should just work. > >Unfortunately, the setup.py is currently importing the package in order >to determine the version number. Specifically, setup.py has: > >from xyz import version >setup(name='xyz', version=version.VERSION, ...) > >If I run "python3 setup.py build", this fails because the "from xyz >import version" causes lots of python3-incompatible code to get called. >It seems like there's probably an easy way around this that I'm missing. > >In theory, I could specify the version number in two different places >and hope that they would stay synced, but I'm not smart enough to pull >that off. :) Is there anything else I should try? Thanks. Take a look at informational PEP 396 for some thoughts: http://www.python.org/dev/peps/pep-0396/ I'll also mention that depending on the minimum version of Python you need to support, you might be able to do away with 2to3 and support both Python 2 and 3 from the same code base. This is what I'm doing whenever possible (with Python 2.6 as a minimum version), and it's not too hard to do. Michael Foord has some good recommendations for writing code compatible even back to 2.4. If you can't do that, try to minimize the amount of code that "from xyz import version" has to execute. Maybe stick an __version__ attribute in your xyz/__init__.py file, and nothing else. Or put the version number in a version.txt file and read from that in both your xyz.version module and your setup.py. Better yet, don't grab the version out of that module by importing. Instead, just parse the contents of the file. You might find the get_version() function from this little helper useful for that: http://bazaar.launchpad.net/~barry/flufl.enum/trunk/view/head:/setup_helpers.py HTH, -Barry From amcnabb at mcnabbs.org Wed Feb 8 23:16:24 2012 From: amcnabb at mcnabbs.org (Andrew McNabb) Date: Wed, 8 Feb 2012 15:16:24 -0700 Subject: [Distutils] 2to3 and version numbers with distribute In-Reply-To: <20120208164533.4ceec377@resist.wooz.org> References: <20120208210502.GA19377@mcnabbs.org> <20120208164533.4ceec377@resist.wooz.org> Message-ID: <20120208221624.GD18178@mcnabbs.org> On Wed, Feb 08, 2012 at 04:45:33PM -0500, Barry Warsaw wrote: > > Take a look at informational PEP 396 for some thoughts: > > http://www.python.org/dev/peps/pep-0396/ That was a very interesting read. If distribute provided a get_version function as described in the PEP, I would be very excited. It's a little obnoxious to include a custom function, although the example from setup_helpers.py that you provided doesn't look too bad. Are there any plans to include some sort of robust get_version function in distribute and distutils2? > I'll also mention that depending on the minimum version of Python you need to > support, you might be able to do away with 2to3 and support both Python 2 and > 3 from the same code base. This is what I'm doing whenever possible (with > Python 2.6 as a minimum version), and it's not too hard to do. Michael Foord > has some good recommendations for writing code compatible even back to 2.4. I've actually taken this approach for two or three projects in the past, and it's worked out well for me. With this particular project, I was hoping to keep compatibility with 2.5, but I might consider limiting support to 2.6. Getting exception handling to work in both Python 2.5 and Python 3 is unacceptably ugly to me, though I'm impressed that it's possible. > If you can't do that, try to minimize the amount of code that "from xyz import > version" has to execute. Maybe stick an __version__ attribute in your > xyz/__init__.py file, and nothing else. Or put the version number in a > version.txt file and read from that in both your xyz.version module and your > setup.py. > > Better yet, don't grab the version out of that module by importing. Instead, > just parse the contents of the file. You might find the get_version() > function from this little helper useful for that: > > http://bazaar.launchpad.net/~barry/flufl.enum/trunk/view/head:/setup_helpers.py Thanks for the comments. You've given me some good ideas, though I'm still a bit disappointed that there doesn't seem to be a standard solution for this. -- Andrew McNabb http://www.mcnabbs.org/andrew/ PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868 From vikashagrawal1990 at gmail.com Thu Feb 9 07:02:13 2012 From: vikashagrawal1990 at gmail.com (vikash agrawal) Date: Thu, 9 Feb 2012 11:32:13 +0530 Subject: [Distutils] Installation In-Reply-To: References: Message-ID: hi Erik On Wed, Feb 8, 2012 at 11:23 PM, Erik Bray wrote: > On Wed, Feb 8, 2012 at 12:32 PM, vikash agrawal > wrote: > > hi Everyone, > > > > I am using Python 2.7, so how do I install pysetup. though when I install > > distutils1.0a3 I do see distutils module in my interactive session but I > > dont see any pysetup being installed > > That "release" is pretty old, and I'm not sure it even includes the > pysetup script. If you're going to be doing d2 development you're > best off getting the latest source from hg: > https://bitbucket.org/tarek/distutils2 > > You should also make sure to get the latest cpython repo from > http://hg.python.org/cpython to work on packaging. Though I don't > know exactly what the current policy is on merging from packaging to > distutils2 or vice-versa, so I'm not the best person to comment on > that. > > Erik > [...] Ok, I will try installing it tonight from tarek's, and will let you know. Also some time ago, I was trying to package it for Fedora 16 and I faced similar problem with that, pysetup not getting installed. Also @tarek, if possible Please update python-side for the package And why do I need latest cython for distutils? I would be using 2.X and not 3.X [...] > > Also, I had previously come in contact with merwok and I would be > applying > > in GSoC this year under PSF for distutils2 project (as I believe PSF > will be > > under GSoC and distutils will surely be accepted), so I am writing to > seek > > help on what all things should be my target, and how do I move ahead. > > Currently, I am trying to work on the ]issue 12944 but due to certain > > constraints things are not geared up, though I hope they would soon be :) > > Please guide me and drop-in all your suggestions > > > > Regards > > > > Vikash Agrawal > > > [...] Waiting for guidance Regards Vikash Agrawal -- sent via HTC Sensation -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.m.bray at gmail.com Thu Feb 9 16:11:01 2012 From: erik.m.bray at gmail.com (Erik Bray) Date: Thu, 9 Feb 2012 10:11:01 -0500 Subject: [Distutils] Installation In-Reply-To: References: Message-ID: Hi Vikash, On Thu, Feb 9, 2012 at 1:02 AM, vikash agrawal wrote: > Ok, I will try installing it tonight from tarek's, and will let you know. > Also some time ago, I was trying to package it for Fedora 16 and I faced > similar problem with that, pysetup not getting installed. > > Also @tarek, if possible Please update python-side for the package > > And why do I need latest cython for distutils? I would be using 2.X and not > 3.X Distutils2 is included in Python 3 under the name 'packaging' which is where, I believe, most of its development is focused. The "distutils2" name is used for the backport of packaging to Python 2.x as well as Python 3.x prior to the availability of packaging in the standard library. Confused yet? There are some historical reasons for all that, but the main point is that if you're interested in working on distutils2, you really want to up and running on the main Python development branch and work on *packaging*. I think that most of the work is being done there, and then backported to distutils2. This post Tarek made a while back should help you get up and running: http://tarekziade.wordpress.com/2011/06/02/help-us-ironing-packaging/ Erik > [...] >> >> > Also, I had previously come in contact with merwok and I would be >> > applying >> > in GSoC this year under PSF for distutils2 project (as I believe PSF >> > will be >> > under GSoC and distutils will surely be accepted), so I am writing to >> > seek >> > help on what all things should be my target, and how do I move ahead. >> > Currently, I am trying to work on the ]issue 12944 but due to certain >> > constraints things are not geared up, though I hope they would soon be >> > :) >> > Please guide me and drop-in all your suggestions >> > >> > Regards >> > >> > Vikash Agrawal >> > > > [...] > > Waiting for guidance > > > Regards > Vikash Agrawal > > > -- > sent via HTC Sensation > > From torquil at gmail.com Thu Feb 9 20:01:27 2012 From: torquil at gmail.com (=?ISO-8859-1?Q?Torquil_Macdonald_S=F8rensen?=) Date: Thu, 09 Feb 2012 20:01:27 +0100 Subject: [Distutils] Installing to c:\Program Files\ Message-ID: <4F341807.3020701@gmail.com> Hi! Is the distutils system suited for installation of a python program to a subfolder of c:\Program Files\ ? I can generate an msi file using the bdist_msi method, but the resulting msi installer puts the files in c:\python27\lib\site-packages (or something like that). My python program basically consists of a python script, two python modules and some text files. None of this should be available to other python programs, so I want it all to be installed in a subdirectory of Program Files. This makes sense, right? The program itself is already capable to be launched from any folder. Can distutils create an msi file for my python program that does what I want? Or should I use some other tool? I want to create an installer that uses the Windows "Add/Remove programs" system, and hopefully allows upgrading to newer program versions without leaving multiple versions installed. Thanks, Torquil S?rensen From fuzzyman at gmail.com Fri Feb 10 00:29:42 2012 From: fuzzyman at gmail.com (Michael Foord) Date: Thu, 9 Feb 2012 23:29:42 +0000 Subject: [Distutils] Installing to c:\Program Files\ In-Reply-To: <4F341807.3020701@gmail.com> References: <4F341807.3020701@gmail.com> Message-ID: On 9 February 2012 19:01, Torquil Macdonald S?rensen wrote: > Hi! > > Is the distutils system suited for installation of a python program to a > subfolder of c:\Program Files\ ? > > I can generate an msi file using the bdist_msi method, but the resulting > msi installer puts the files in c:\python27\lib\site-packages (or something > like that). > > My python program basically consists of a python script, two python > modules and some text files. None of this should be available to other > python programs, so I want it all to be installed in a subdirectory of > Program Files. This makes sense, right? > > The program itself is already capable to be launched from any folder. > > Can distutils create an msi file for my python program that does what I > want? Or should I use some other tool? I want to create an installer that > uses the Windows "Add/Remove programs" system, and hopefully allows > upgrading to newer program versions without leaving multiple versions > installed. > Basically the answer is no, you can't use distutils to do this. Instead you should use a tool like py2exe to generate an executable for your program that bundles the Python binaries itself along with the program. You can then create an msi installer for your program using a free tool like WiX. Your bundled installers can then be installed into the standard Windows location and won't require your user to have Python installed to use your program: http://www.py2exe.org/ http://wix.sourceforge.net/ All the best, Michael Foord > > Thanks, > Torquil S?rensen > ______________________________**_________________ > 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 torquil at gmail.com Fri Feb 10 10:32:43 2012 From: torquil at gmail.com (=?ISO-8859-1?Q?Torquil_Macdonald_S=F8rensen?=) Date: Fri, 10 Feb 2012 10:32:43 +0100 Subject: [Distutils] Installing to c:\Program Files\ In-Reply-To: References: <4F341807.3020701@gmail.com> Message-ID: <4F34E43B.9090107@gmail.com> > Basically the answer is no, you can't use distutils to do this. Instead you > should use a tool like py2exe to generate an executable for your program that > bundles the Python binaries itself along with the program. You can then create > an msi installer for your program using a free tool like WiX. Your bundled > installers can then be installed into the standard Windows location and won't > require your user to have Python installed to use your program: > > http://www.py2exe.org/ > http://wix.sourceforge.net/ Thanks Michael, but I don't think I want to do it that way. Py2exe was familiar to me, but I don't like the idea of bundling Python together with my program. I'll start to investigate the different installer systems that are available for Windows. Best regards, Torquil S?rensen From torquil at gmail.com Fri Feb 10 10:39:14 2012 From: torquil at gmail.com (=?ISO-8859-1?Q?Torquil_Macdonald_S=F8rensen?=) Date: Fri, 10 Feb 2012 10:39:14 +0100 Subject: [Distutils] Installing to c:\Program Files\ In-Reply-To: References: <4F341807.3020701@gmail.com> Message-ID: <4F34E5C2.7080101@gmail.com> On 10/02/12 00:29, Michael Foord wrote: > Basically the answer is no, you can't use distutils to do this. Instead you > should use a tool like py2exe to generate an executable for your program that > bundles the Python binaries itself along with the program. You can then create > an msi installer for your program using a free tool like WiX. Your bundled > installers can then be installed into the standard Windows location and won't > require your user to have Python installed to use your program: > > http://www.py2exe.org/ > http://wix.sourceforge.net/ Hi again! That WIX looks like it is up for the job. I'll give it a try. Thanks for mentioning it! Best regards, Torquil S?rensen From sienkiew at stsci.edu Tue Feb 14 00:04:43 2012 From: sienkiew at stsci.edu (Mark Sienkiewicz) Date: Mon, 13 Feb 2012 18:04:43 -0500 Subject: [Distutils] What do I need to run setup.py on Windows? Message-ID: <4F39970B.2080408@stsci.edu> Hi, I'm trying to use "setup.py install" to install python packages that include C extensions. I have Windows/XP, the 32 bit Python 2.7 binary downloaded from python.org and the 32 bit numpy binary downloaded from numpy.org. I don't seem to be able to get a working C compiler. At first, I read that you need Microsoft Visual Studio Express 2008. This is a 32 bit only C/C++ compiler, but that is ok because the Python and Numpy that I need are 32 bit executables. Well, I still get errors about a missing "basetsd.h". The solution I found online is to install "Windows SDK", which I found at http://www.microsoft.com/download/en/details.aspx?id=18950 The heading at the top of the page says "Windows 7", but under "Supported Operating Systems" it lists Windows/XP. I still get errors because basetsd.h is not found. In the interests of seeing if anything works at all, I made an empty file named c:\Python27\include\basetsd.h hoping I might get to see some different errors. I did. Apparently, basetsd.h does not contain anything I need, because "setup.py build" can compile the C code now. The link stage fails like this: c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Pyth on27\PCbuild /EXPORT:init_combine build\temp.win32-2.7\Release\src/_combinemodule.obj /OUT:build\lib.win32-2.7\stsci\image\_combine. pyd /IMPLIB:build\temp.win32-2.7\Release\src\_combine.lib /MANIFESTFILE:build\temp.win32-2.7\Release\src\_combine.pyd.manifest LINK : fatal error LNK1104: cannot open file 'kernel32.lib' error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1104 So, somehow I need to have basetsd.h and kernel32.lib; neither of them is provided by the compiler and neither is provided by Windows SDK. I've run out of ideas about where to look for documentation and what other things to try. Can anybody offer me any suggestions? Mark S. From sienkiew at stsci.edu Tue Feb 14 19:56:41 2012 From: sienkiew at stsci.edu (Mark Sienkiewicz) Date: Tue, 14 Feb 2012 13:56:41 -0500 Subject: [Distutils] What do I need to run setup.py on Windows? In-Reply-To: <4F39970B.2080408@stsci.edu> References: <4F39970B.2080408@stsci.edu> Message-ID: <4F3AAE69.2090103@stsci.edu> Never mind this question. Somebody here noticed this item on the menu: Start->All Programs->Microsoft Windows SDK v7.1 ->Windows SDK 7.1 Command Prompt This runs a batch job that appears to set up a working environment for the compiler. From that prompt, you can type "setup.py build" or "setup.py install". On 02/13/12 18:04, Mark Sienkiewicz wrote: > Hi, > > I'm trying to use "setup.py install" to install python packages that include C extensions. I have Windows/XP, the 32 bit Python 2.7 binary downloaded from python.org and the 32 bit numpy binary downloaded from numpy.org. > > I don't seem to be able to get a working C compiler. > > At first, I read that you need Microsoft Visual Studio Express 2008. This is a 32 bit only C/C++ compiler, but that is ok because the Python and Numpy that I need are 32 bit executables. > > Well, I still get errors about a missing "basetsd.h". The solution I found online is to install "Windows SDK", which I found at http://www.microsoft.com/download/en/details.aspx?id=18950 > > The heading at the top of the page says "Windows 7", but under "Supported Operating Systems" it lists Windows/XP. > > I still get errors because basetsd.h is not found. In the interests of seeing if anything works at all, I made an empty file named c:\Python27\include\basetsd.h hoping I might get to see some different errors. > > I did. Apparently, basetsd.h does not contain anything I need, because "setup.py build" can compile the C code now. The link stage fails like this: > > c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Pyth > on27\PCbuild /EXPORT:init_combine build\temp.win32-2.7\Release\src/_combinemodule.obj /OUT:build\lib.win32-2.7\stsci\image\_combine. > pyd /IMPLIB:build\temp.win32-2.7\Release\src\_combine.lib /MANIFESTFILE:build\temp.win32-2.7\Release\src\_combine.pyd.manifest > LINK : fatal error LNK1104: cannot open file 'kernel32.lib' > error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1104 > > > So, somehow I need to have basetsd.h and kernel32.lib; neither of them is provided by the compiler and neither is provided by Windows SDK. > > I've run out of ideas about where to look for documentation and what other things to try. Can anybody offer me any suggestions? > > Mark S. > > _______________________________________________ > Distutils-SIG maillist - Distutils-SIG at python.org > http://mail.python.org/mailman/listinfo/distutils-sig From vincent at nexedi.com Tue Feb 21 09:38:45 2012 From: vincent at nexedi.com (Vincent Pelletier) Date: Tue, 21 Feb 2012 09:38:45 +0100 Subject: [Distutils] buildout: [PATCH] test extension precedence Message-ID: <201202210938.45271.vincent@nexedi.com> Hi. In my attempt to fix bug LP#605017, I broke "<=" precedence with patch on #2. I now submitted patch on #5 which preserves precedence. Also, I wrote attached tests for both extension forms: - <= ... - [buildout]\nextends = ... Please commit them if they are welcome. Note: I'm unsure of desired naming scheme, nor if there is any official naming unambiguously referring to each of those extensions, nor if it's the right file to put them in... Regards, -- Vincent Pelletier ERP5 - open source ERP/CRM for flexible enterprises -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Extension-precedence-tests.patch Type: text/x-patch Size: 1804 bytes Desc: not available URL: From vincent at nexedi.com Tue Feb 21 10:22:57 2012 From: vincent at nexedi.com (Vincent Pelletier) Date: Tue, 21 Feb 2012 10:22:57 +0100 Subject: [Distutils] buildout: supporting += and -= in <=-style extends Message-ID: <201202211022.57411.vincent@nexedi.com> Hi. To properly factorise a .cfg I write, I use <=-style section extension. Some of the properties I define would take advantage of += operator, but "[buildout]\nextends = ..."-style extension. Wouldn't it be convenient if it worked internally to a file as well ? I've poked around in the code, and found that it's not trivial to implement (calling existing _update_section function is not enough, as that calls "update" on its first parameter and expects values to be pairs). Also, it would create ambiguous outcome when a section would contain <= and its file would extend another file containing an homonym section... Do anyone have an idea of how to implement this feature ? The best I could come up with is based on doubling "+" or "-" (rightmost is for "[buildout]\nextends = ..." extension when used, leftmost is for "<="extension) when used. The outcome looks logical enough, but I'm not sure input is clear enough to be The Right Way. Same-name extends (already works in current code): a.cfg: [foo] color = blue b.cfg: [buildout] extends = a.cfg [foo] color += green Outcome: color = blue green Different-name extends: b.cfg: [bar] color = red [foo] <= bar color += green Outcome: color = red green Both extends: a.cfg: [foo] color = blue b.cfg: [buildout] extends = a.cfg [bar] color = red [foo] <= bar color ++= green Outcome: color = blue red green Another example: Input as above, except: [bar] color = red green blue [foo] <= bar color -+= green Outcome: color = red Also, a few rants over the current implementation: 1. foo ++= bar is the same as foo += bar (for any number of extra "+") Likewise for "--=" 2. foo += bar will create a "foo +" property if [buildout] doesn't contain "extends" (ie, wouldn't it be more consistent to always remove/strip all "+" and "-" ?) 3. foo -+=bar will create a "foo -" property if [buildout] contains an "extends" (and if it doesn't, see 2.). Likewise for "+-=", "+-+=", etc. 4. "foo\t+=bar" (I mean literal tab char) will create a "foo\t" property (because rstrip is called with a parameter which only contains space as a whitespace char) I'm not saying those inputs make sense. I think current handling gives surprising results, and that alone is bad IMHO. Regards, -- Vincent Pelletier ERP5 - open source ERP/CRM for flexible enterprises From ralf at systemexit.de Thu Feb 23 12:00:15 2012 From: ralf at systemexit.de (Ralf Schmitt) Date: Thu, 23 Feb 2012 12:00:15 +0100 Subject: [Distutils] [ANNOUNCE] pypiserver 0.5.1 - minimal pypi server Message-ID: <87hayhak74.fsf@winserver.brainbot.com> Hi, I've just uploaded pypiserver 0.5.1 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.1 ------------------------- - make 'pypi-server -U' compatible with pip 1.1 -- Cheers, Ralf