Re: [Distutils] Egg name computation
On Mon, Oct 28, 2013 at 3:50 PM, PJ Eby wrote: > You could include a dummy extension that does nothing, I suppose. Or > which controls the building of your actual extensions. Setuptools has > long supported Pyrex and I think that Cython might also work, i.e., > that you could just specify your cython modules as extensions in > setup.py to start with. > Indeed -- recent versions of setuptools do support Cython. You also may want to use Cython's "cythonize" on your Extension objects to make it a bit "smarter". -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Egg name computation
On Mon, Oct 28, 2013 at 4:29 AM, Martin Fiers wrote: > I guess we'll have to > rename them manually after the setup() function, unless there's a way to > 'force' setup() to 'think' it has compiled extensions in them? You could include a dummy extension that does nothing, I suppose. Or which controls the building of your actual extensions. Setuptools has long supported Pyrex and I think that Cython might also work, i.e., that you could just specify your cython modules as extensions in setup.py to start with. ___ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Egg name computation
On 10/25/2013 04:25 AM, PJ Eby wrote: On Tue, Oct 15, 2013 at 8:07 AM, Martin Fiers wrote: So the platform argument now is self.distribution.has_ext_modules() and self.plat_name Shouldn't it just be self.plat_name ? No. The platform name is only included if the distribution has extension modules, because extension modules are what make the egg platform-specific. If there is only Python code and data, then the egg is considered platform independent. Ok, I understand the reasoning. Would there be a workaround? What do you want to work around this *for*? If the egg doesn't contain extension modules, what is platform-specific about it? Well, the way we build our extensions forces us to do this. We cythonize large parts of our modules. This is done in separate build scripts. It is included as package_data, which is 'agnostic' of the platform. For this reason, we want to force the naming. In any case, no harm is done by adding the platform name, as distutils recognizes them. I guess we'll have to rename them manually after the setup() function, unless there's a way to 'force' setup() to 'think' it has compiled extensions in them? Thanks, Martin ___ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
Re: [Distutils] Egg name computation
On Tue, Oct 15, 2013 at 8:07 AM, Martin Fiers wrote: > So the platform argument now is > self.distribution.has_ext_modules() and self.plat_name > Shouldn't it just be > self.plat_name > ? No. The platform name is only included if the distribution has extension modules, because extension modules are what make the egg platform-specific. If there is only Python code and data, then the egg is considered platform independent. > Would there be a workaround? What do you want to work around this *for*? If the egg doesn't contain extension modules, what is platform-specific about it? ___ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
[Distutils] Egg name computation
Hello, What's the preferred approach to having different eggs (for different platforms) in one folder? I noticed that fortunately easy_install recognizes the platform, so I can get away by having good filenames, such as mytest-2.1.2c1-py2.7-win32 mytest-2.1.2c1-py2.7-win-amd64 The problem is that the egg-generation does not include the platform name (so it is not compatible with the easy_install behavior, which is weird). When I look in bdist_egg.py, I can see this: # Compute filename of the output egg basename = Distribution( None, None, ei_cmd.egg_name, ei_cmd.egg_version, get_python_version(), self.distribution.has_ext_modules() and self.plat_name ).egg_name() So the platform argument now is self.distribution.has_ext_modules() and self.plat_name Shouldn't it just be self.plat_name ? Would there be a workaround? I can think of giving the full name to setup, without specifying a version: setup(name='mytest-2.1.2c1-py2.7-win32', version = '', ...) Thanks very much! Martin P.S. On an unrelated note, wouldn't it be more pythonic, and easier to read, to include keyword arguments in the basename = Distribution(...) line? ___ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig