From enrico at fnal.gov Tue Jun 3 11:31:28 2003 From: enrico at fnal.gov (Enrico Ng) Date: Tue Jun 3 11:31:32 2003 Subject: [Distutils] Files not included Message-ID: <5.2.1.1.2.20030603102732.00bb97a8@bpmail.fnal.gov> I am trying a simple example: #/usr/bin/env python from distutils.core import setup, Extension from distutils.command.build_ext import build_ext setup(name="orbit", version="1.0", ext_package="orbit", ext_modules=[Extension("orbit", sources = ["Parallel.cc"])]) when I do "python setup.py sdist", the resulting tarfile only includes PKGINFO and setup.py, it does not include Parallel.cc. I tried this on a SunOS 5.7 using Python 2.2.2 (GCC 3.2.3) and it works fine. When I try it on a Linux 2.4.9 using Python 2.2.2 (GCC 3.2.3) it does not work. I do not know if this is related to the OS. I am thinking it may have something to do with different configure options, but I do not know. Any ideas? -- Enrico Ng From mal at lemburg.com Wed Jun 4 11:03:34 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Wed Jun 4 04:04:08 2003 Subject: [Distutils] Files not included In-Reply-To: <5.2.1.1.2.20030603102732.00bb97a8@bpmail.fnal.gov> References: <5.2.1.1.2.20030603102732.00bb97a8@bpmail.fnal.gov> Message-ID: <3EDDA7D6.4030707@lemburg.com> Enrico Ng wrote: > I am trying a simple example: > > #/usr/bin/env python > > from distutils.core import setup, Extension > from distutils.command.build_ext import build_ext > setup(name="orbit", version="1.0", > ext_package="orbit", > ext_modules=[Extension("orbit", sources = ["Parallel.cc"])]) > > when I do "python setup.py sdist", the resulting tarfile only includes > PKGINFO and setup.py, it does not include Parallel.cc. You need to create a file MANIFEST.in which includes all the files you wish to include in the tarball. > I tried this on a SunOS 5.7 using Python 2.2.2 (GCC 3.2.3) and it works > fine. > When I try it on a Linux 2.4.9 using Python 2.2.2 (GCC 3.2.3) it does > not work. > I do not know if this is related to the OS. I am thinking it may have > something to do with different configure options, but I do not know. > > Any ideas? -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 04 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 20 days left From enrico at fnal.gov Wed Jun 4 17:03:09 2003 From: enrico at fnal.gov (Enrico Ng) Date: Wed Jun 4 17:03:14 2003 Subject: [Distutils] Changing Compiler Arguments Message-ID: <5.2.1.1.2.20030604160118.01da0b10@bpmail.fnal.gov> Is there a way to change the compiler arguments that are added by distutils. NDEBUG is causing problems. The distutils documentation suggests undef_macros, but this does not do anything to help. -- Enrico Ng From mal at lemburg.com Thu Jun 5 15:35:22 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Jun 5 08:35:57 2003 Subject: [Distutils] Changing Compiler Arguments In-Reply-To: <5.2.1.1.2.20030604160118.01da0b10@bpmail.fnal.gov> References: <5.2.1.1.2.20030604160118.01da0b10@bpmail.fnal.gov> Message-ID: <3EDF390A.9000801@lemburg.com> Enrico Ng wrote: > Is there a way to change the compiler arguments that are added by > distutils. > NDEBUG is causing problems. > The distutils documentation suggests undef_macros, but this does not do > anything to help. There isn't: you have to edit msvccompiler.py (.compile_options) or use a hack like the following: # # mx MSVC Compiler extension # # We want some extra options for the MSVCCompiler, so we add them # here. This is an awful hack, but there seems to be no other way to # subclass a standard distutils C compiler class... from distutils.msvccompiler import MSVCCompiler # remember old __init__ old_MSVCCompiler__init__ = MSVCCompiler.__init__ def mx_msvccompiler__init__(self, *args, **kws): apply(old_MSVCCompiler__init__, (self,) + args, kws) self.compile_options.extend(['/O2','/Gf','/GB','/GD', '/Ob2']) # "Install" new __init__ MSVCCompiler.__init__ = mx_msvccompiler__init__ -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 05 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 19 days left From goodger at python.org Tue Jun 17 23:14:54 2003 From: goodger at python.org (David Goodger) Date: Tue Jun 17 22:15:29 2003 Subject: [Distutils] install packages & modules simultaneously? Message-ID: <3EEFCB1E.10807@python.org> Docutils relies on a few 3rd-party modules, and includes them as a convenience. They are only to be installed if they're not already present in a Python installation, so I have code in setup.py check for them. Distutils doesn't seem to be able to handle packages and individual modules simultaneously. Distutils complains if I specify both "packages" and "py_modules" in a single call. I got the script to work by calling distutils.core.setup twice: first for the third-party modules, then for the "docutils" packages (http://docutils.sf.net/setup.py). Installation isn't so bad, but doing "python setup.py sdist" creates 2 tarballs and feels very kludgey. Does anyone know of a better way? -- David Goodger http://starship.python.net/~goodger Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv From theller at python.net Wed Jun 18 10:13:16 2003 From: theller at python.net (Thomas Heller) Date: Wed Jun 18 04:10:27 2003 Subject: [Distutils] install packages & modules simultaneously? In-Reply-To: <3EEFCB1E.10807@python.org> (David Goodger's message of "Tue, 17 Jun 2003 22:14:54 -0400") References: <3EEFCB1E.10807@python.org> Message-ID: <7k7jvoxf.fsf@python.net> David Goodger writes: > Docutils relies on a few 3rd-party modules, and includes them as a > convenience. They are only to be installed if they're not already > present in a Python installation, so I have code in setup.py check for > them. > > Distutils doesn't seem to be able to handle packages and individual > modules simultaneously. Distutils complains if I specify both > "packages" and "py_modules" in a single call. I got the script to > work by calling distutils.core.setup twice: first for the third-party > modules, then for the "docutils" packages > (http://docutils.sf.net/setup.py). Installation isn't so bad, but > doing "python setup.py sdist" creates 2 tarballs and feels very > kludgey. Does anyone know of a better way? I found the following code (commented out) in one of my setup scripts. It might do what you want, but it is untested: from distutils.command import build_py # a class which will allow to distribute packages *and* # modules with one setup script, currently unused. class my_build_py(build_py.build_py): def run (self): if not self.py_modules and not self.packages: return if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.byte_compile(self.get_outputs(include_bytecode=0)) # run () Thomas From goodger at python.org Sun Jun 22 20:14:20 2003 From: goodger at python.org (David Goodger) Date: Sun Jun 22 19:14:54 2003 Subject: [Distutils] install packages & modules simultaneously? In-Reply-To: <7k7jvoxf.fsf@python.net> References: <3EEFCB1E.10807@python.org> <7k7jvoxf.fsf@python.net> Message-ID: <3EF6384C.2090009@python.org> [David Goodger] >> Distutils doesn't seem to be able to handle packages and individual >> modules simultaneously. Distutils complains if I specify both >> "packages" and "py_modules" in a single call. [Thomas Heller] > I found the following code (commented out) in one of my setup > scripts. It might do what you want, but it is untested: It does exactly what I want; thanks! New setup.py: . With this pointer, I looked up the Distutils source and found this comment in distutils.command.build_py.build_py.run: Two options control which modules will be installed: 'packages' and 'py_modules'. The former lets us work with whole packages, not specifying individual modules at all; the latter is for specifying modules one-at-a-time. Currently they are mutually exclusive: you can define one or the other (or neither), but not both. It remains to be seen how limiting this is. It seems (to me at least) that this is an arbitrary limitation. Is there any good reason not to allow both 'packages' and 'py_modules' in one call? If not, why not remove the limitation for everyone's benefit? -- David Goodger From amk at amk.ca Sun Jun 22 21:18:33 2003 From: amk at amk.ca (A.M. Kuchling) Date: Sun Jun 22 20:17:31 2003 Subject: [Distutils] install packages & modules simultaneously? In-Reply-To: <3EF6384C.2090009@python.org> References: <3EEFCB1E.10807@python.org> <7k7jvoxf.fsf@python.net> <3EF6384C.2090009@python.org> Message-ID: <20030623001833.GA1825@nyman.amk.ca> On Sun, Jun 22, 2003 at 07:14:20PM -0400, David Goodger wrote: >one call? If not, why not remove the limitation for everyone's >benefit? Removed in 2.3. --amk From fdrake at acm.org Sun Jun 22 22:12:44 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Sun Jun 22 21:13:14 2003 Subject: [Distutils] install packages & modules simultaneously? In-Reply-To: <20030623001833.GA1825@nyman.amk.ca> References: <3EEFCB1E.10807@python.org> <7k7jvoxf.fsf@python.net> <3EF6384C.2090009@python.org> <20030623001833.GA1825@nyman.amk.ca> Message-ID: <16118.21516.205246.803203@grendel.zope.com> A.M. Kuchling writes: > Removed in 2.3. Was this removed in 2.2.3? If not, it should also be removed in 2.2.4. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From theller at python.net Tue Jun 24 20:29:13 2003 From: theller at python.net (Thomas Heller) Date: Tue Jun 24 13:29:22 2003 Subject: [Distutils] Exceptions Message-ID: <65mvfkpi.fsf@python.net> distutils/core.py contains this code, in the setup() function: # And finally, run all the commands found on the command line. if ok: try: dist.run_commands() except KeyboardInterrupt: raise SystemExit, "interrupted" except (IOError, os.error), exc: error = grok_environment_error(exc) if DEBUG: sys.stderr.write(error + "\n") raise else: raise SystemExit, error except (DistutilsError, CCompilerError), msg: if DEBUG: raise else: raise SystemExit, "error: " + str(msg) In my case, I have a custom "test" command in my setup script, which imports test scripts from a unittests directory. As it goes, the importing of one of the script fails with an OSError. This is my fault, of course, but it seems distutils tries all to hide the error from the user. On Windows, the output of the setup script is: running test running build running build_py running build_ext error: Das angegebene Modul wurde nicht gefunden and on Linux, even worse: running test running build running build_py running build_ext error: None I've tried to find out what's wrong, and eventually found the DISTUTILS_DEBUG environment variable. When this is set, the full traceback is printed (among a lot of other output). IMO this behaviour is not helpful, and the DISTUTILS_DEBUG variable is undocumented. In which way should this be changed? Thomas From amk at amk.ca Wed Jun 25 11:03:19 2003 From: amk at amk.ca (A.M. Kuchling) Date: Wed Jun 25 10:03:52 2003 Subject: [Distutils] Exceptions In-Reply-To: <65mvfkpi.fsf@python.net> References: <65mvfkpi.fsf@python.net> Message-ID: <3EF9ABA7.2010309@amk.ca> Thomas Heller wrote: >IMO this behaviour is not helpful, and the DISTUTILS_DEBUG variable is >undocumented. > >In which way should this be changed? > > I believe the motivation for this was simply to reduce the depth of tracebacks; consider an administrator who doesn't know much about Python and is trying to install a package. If they get a big long traceback from deep inside the guts of Distutils, they may think the package or the Python installation is broken because they don't read all the way down to the bottom and see that it's a permission problem. I suggest just documenting the DISTUTILS_DEBUG variable, but otherwise leaving this alone. --amk From BEhle at ea.com Wed Jun 25 11:21:57 2003 From: BEhle at ea.com (Ehle, Brandon) Date: Wed Jun 25 13:22:31 2003 Subject: [Distutils] bdist_wininstall and --quiet Message-ID: <6F81CDDC6A5BB44CB7014770272C508901901C92@eahq-mb4.rws.ad.ea.com> Hello, I'm trying to create a setup programming that deploys python plus all the required extensions packages. Rather than have person who is installing click next four gazillion times, I'd like for the extension module packages to run in a quiet mode where it starts up, shows the install process and then exits without any user intervention (short of fatal errors). For most of the extensions I need to install, this seems to work ok (they are installing via InnoSetup and -veryquiet), but any packages that were released with bdist_wininst do not seem to support this feature. Is this a feature that could be added to future releases of distutils? The RPM packages install in a non-interactive mode so I believe it would make sense to offer this same functionality on windows. Obviously any old bdist_wininst packages aren't going to have this functionality yet. Is there some trick that I might be able to get this to work with any current bdist_wininst packages? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/distutils-sig/attachments/20030625/3929b268/attachment.htm From theller at python.net Thu Jun 26 11:23:50 2003 From: theller at python.net (Thomas Heller) Date: Thu Jun 26 04:24:07 2003 Subject: [Distutils] bdist_wininstall and --quiet In-Reply-To: <6F81CDDC6A5BB44CB7014770272C508901901C92@eahq-mb4.rws.ad.ea.com> (Brandon Ehle's message of "Wed, 25 Jun 2003 10:21:57 -0700") References: <6F81CDDC6A5BB44CB7014770272C508901901C92@eahq-mb4.rws.ad.ea.com> Message-ID: "Ehle, Brandon" writes: > I'm trying to create a setup programming that deploys python plus all > the required extensions packages. Rather than have person who is > installing click next four gazillion times, I'd like for the extension > module packages to run in a quiet mode where it starts up, shows the > install process and then exits without any user intervention (short of > fatal errors). For most of the extensions I need to install, this seems > to work ok (they are installing via InnoSetup and -veryquiet), but any > packages that were released with bdist_wininst do not seem to support > this feature. > > Is this a feature that could be added to future releases of distutils? > The RPM packages install in a non-interactive mode so I believe it would > make sense to offer this same functionality on windows. Sure it could ;-), but it requires major restructuring of the bdist_wininst C code. > Obviously any old bdist_wininst packages aren't going to have this > functionality yet. Is there some trick that I might be able to get this > to work with any current bdist_wininst packages? I see at least two possibilities: 1. Install Python and all packages you want to distribute on some machine, and repackage all of this in a new installer (inno, wise, nsis, whatever) and distribute that. IMO this is basically what ActiveState does. 2. bdist_wininst installers are zipfiles whith a small executable stub. You could write a Python script which opens the installer with zipfile.ZipFile, and do the unpacking and installation yourself. Should be a matter of one or two hours. Regards, Thomas From theller at python.net Thu Jun 26 22:54:58 2003 From: theller at python.net (Thomas Heller) Date: Thu Jun 26 15:55:15 2003 Subject: [Distutils] Exceptions In-Reply-To: <3EF9ABA7.2010309@amk.ca> (A. M. Kuchling's message of "Wed, 25 Jun 2003 10:03:19 -0400") References: <65mvfkpi.fsf@python.net> <3EF9ABA7.2010309@amk.ca> Message-ID: "A.M. Kuchling" writes: > Thomas Heller wrote: > >>IMO this behaviour is not helpful, and the DISTUTILS_DEBUG variable is >>undocumented. >> >>In which way should this be changed? >> > I believe the motivation for this was simply to reduce the depth of > tracebacks; consider an administrator who doesn't know much about > Python and is trying to install a package. If they get a big long > traceback from deep inside the guts of Distutils, they may think the > package or the Python installation is broken because they don't read > all the way down to the bottom and see that it's a permission problem. > > I suggest just documenting the DISTUTILS_DEBUG variable, but otherwise > leaving this alone. Suggested patch submitted as http://www.python.org/sf/761401. Thomas From robin at jessikat.fsnet.co.uk Sun Jun 29 16:17:34 2003 From: robin at jessikat.fsnet.co.uk (Robin Becker) Date: Sun Jun 29 10:17:49 2003 Subject: [Distutils] wordlength etc Message-ID: Are there standard ways to determine things like wordlength etc in distutils? I suppose one can use sys.maxint, but I thought this might be a standard kind of requirement now that we're slipping from 32 to 64 bits. -- Robin Becker From mal at lemburg.com Sun Jun 29 19:49:19 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jun 29 12:49:53 2003 Subject: [Distutils] wordlength etc In-Reply-To: References: Message-ID: <3EFF188F.3020607@lemburg.com> Robin Becker wrote: > Are there standard ways to determine things like wordlength etc in > distutils? > > I suppose one can use sys.maxint, but I thought this might be a standard > kind of requirement now that we're slipping from 32 to 64 bits. I'd use the struct module for these things. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 29 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ From robin at jessikat.fsnet.co.uk Sun Jun 29 20:00:09 2003 From: robin at jessikat.fsnet.co.uk (Robin Becker) Date: Sun Jun 29 14:01:46 2003 Subject: [Distutils] wordlength etc In-Reply-To: <3EFF188F.3020607@lemburg.com> References: <3EFF188F.3020607@lemburg.com> Message-ID: In article <3EFF188F.3020607@lemburg.com>, M.-A. Lemburg writes >Robin Becker wrote: >> Are there standard ways to determine things like wordlength etc in >> distutils? >> >> I suppose one can use sys.maxint, but I thought this might be a standard >> kind of requirement now that we're slipping from 32 to 64 bits. > >I'd use the struct module for these things. > So we assume struct units are 8 bits and then use calcsize("i")*8 as the wordlength. -- Robin Becker From mal at lemburg.com Sun Jun 29 21:14:01 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Sun Jun 29 14:14:33 2003 Subject: [Distutils] wordlength etc In-Reply-To: References: <3EFF188F.3020607@lemburg.com> Message-ID: <3EFF2C69.2080606@lemburg.com> Robin Becker wrote: > In article <3EFF188F.3020607@lemburg.com>, M.-A. Lemburg > writes > >>Robin Becker wrote: >> >>>Are there standard ways to determine things like wordlength etc in >>>distutils? >>> >>>I suppose one can use sys.maxint, but I thought this might be a standard >>>kind of requirement now that we're slipping from 32 to 64 bits. >> >>I'd use the struct module for these things. >> > > So we assume struct units are 8 bits and then use calcsize("i")*8 as the > wordlength. sizeofint = len(struct.pack('i',1)) -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 29 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ From NAIVS-CAPETOWNZACAPEX01 at verisign.com Mon Jun 30 05:11:48 2003 From: NAIVS-CAPETOWNZACAPEX01 at verisign.com (GroupShield for Exchange (ZACAPEX01)) Date: Sun Jun 29 22:20:10 2003 Subject: [Distutils] ALERT - GroupShield ticket number OA2755_1056939103_ZACAPEX01_3 was generated Message-ID: Action Taken: The attachment was quarantined from the message and replaced with a text file informing the recipient of the action taken. To: premium-server@thawte.com From: distutils-sig@python.org Sent: -196770176,29572780 Subject: Re: Application Attachment Details:- Attachment Name: your_details.zip File: your_details.zip Infected? No Repaired? No Blocked? Yes Deleted? No Virus Name: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 1940 bytes Desc: not available Url : http://mail.python.org/pipermail/distutils-sig/attachments/20030630/c6ea4608/attachment.bin From jeremy at zope.com Mon Jun 30 20:12:12 2003 From: jeremy at zope.com (Jeremy Hylton) Date: Mon Jun 30 15:12:13 2003 Subject: [Distutils] custom install directory with bdist_wininst Message-ID: <1057000270.17461.18.camel@slothrop.zope.com> I'd like to give the user control over where the files get installed. It looks like distutils installs into site-packages by default, and there's no way to override it. The UI shows the destination directory in a box that looks like it should be editable, but it isn't. If you run setup.py install, you can pass a --home that affects where files are installed. I'm looking for something similar on Windows. Jeremy From jeremy at alum.mit.edu Mon Jun 30 20:52:15 2003 From: jeremy at alum.mit.edu (Jeremy Hylton) Date: Mon Jun 30 15:52:16 2003 Subject: [Distutils] wordlength etc In-Reply-To: <3EFF2C69.2080606@lemburg.com> References: <3EFF188F.3020607@lemburg.com> <3EFF2C69.2080606@lemburg.com> Message-ID: <1057002701.17461.25.camel@slothrop.zope.com> On Sun, 2003-06-29 at 14:14, M.-A. Lemburg wrote: > > So we assume struct units are 8 bits and then use calcsize("i")*8 as the > > wordlength. > > sizeofint = len(struct.pack('i',1)) Why not sizeofint = struct.calcsize("i") ? Jeremy From mal at lemburg.com Mon Jun 30 23:14:56 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Mon Jun 30 16:15:28 2003 Subject: [Distutils] wordlength etc In-Reply-To: <1057002701.17461.25.camel@slothrop.zope.com> References: <3EFF188F.3020607@lemburg.com> <3EFF2C69.2080606@lemburg.com> <1057002701.17461.25.camel@slothrop.zope.com> Message-ID: <3F009A40.1040303@lemburg.com> Jeremy Hylton wrote: > On Sun, 2003-06-29 at 14:14, M.-A. Lemburg wrote: > >>>So we assume struct units are 8 bits and then use calcsize("i")*8 as the >>>wordlength. >> >>sizeofint = len(struct.pack('i',1)) > > Why not > > sizeofint = struct.calcsize("i") > > ? Even better :-) -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 30 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________