Python version in egg name
When I create an egg the Python version used to create the egg is encoded in the egg filename, e.g. Whoosh-1.6.0-py2.7.egg. Is this version number used to decide what egg a user gets from PyPI? I didn't think it was, but a user is seeming to indicate that he got different versions based on what version of Python he was using. Is there a way to set this value to "py2.5" as a configuration option, other than running setup.py using the Python 2.5 executable? Or not have it be part of the egg filename at all? I'm using Python 2.7 as my default Python install but I make sure that the code in my library is compatible with 2.5+. I've already someone think the library is only for a later version of Python because that's what I used to build the egg. Sorry if this is an old question, I looked around but didn't find any docs on the subject. Thanks, Matt
When I create an egg the Python version used to create the egg is encoded in the egg filename, e.g. Whoosh-1.6.0-py2.7.egg. Is this version number used to decide what egg a user gets from PyPI? I didn't think it was, but a user is seeming to indicate that he got different versions based on what version of Python he was using. Is there a way to set this value to "py2.5" as a configuration option, other than running setup.py using the Python 2.5 executable? Or not have it be part of the egg filename at all? I'm using Python 2.7 as my default Python install but I make sure that the code in my library is compatible with 2.5+. I've already someone think the library is only for a later version of Python because that's what I used to build the egg. Sorry if this is an old question, I looked around but didn't find any docs on the subject. Thanks, Matt
On 02/03/2011 10:17 AM, Matt Chaput wrote:
When I create an egg the Python version used to create the egg is encoded in the egg filename, e.g. Whoosh-1.6.0-py2.7.egg.
Is this version number used to decide what egg a user gets from PyPI? I didn't think it was, but a user is seeming to indicate that he got different versions based on what version of Python he was using.
Is there a way to set this value to "py2.5" as a configuration option, other than running setup.py using the Python 2.5 executable? Or not have it be part of the egg filename at all? I'm using Python 2.7 as my default Python install but I make sure that the code in my library is compatible with 2.5+. I've already someone think the library is only for a later version of Python because that's what I used to build the egg.
Sorry if this is an old question, I looked around but didn't find any docs on the subject.
I use source distributions (python setup.py sdist) and then distribute the resulting .tar.gz file. Since it's a source (not binary) distribution, it can potentially run with any version of Python. You see this a lot on PyPI, where the only thing uploaded is a .tar.gz file. See http://pypi.python.org/pypi/buildout.dumppickedversions/0.4, for example. Eric.
On 03/02/2011 10:34 AM, Eric Smith wrote:
I use source distributions (python setup.py sdist) and then distribute the resulting .tar.gz file. Since it's a source (not binary) distribution, it can potentially run with any version of Python.
You see this a lot on PyPI, where the only thing uploaded is a .tar.gz file. See http://pypi.python.org/pypi/buildout.dumppickedversions/0.4, for example.
Can people still use easy_install/pip to install it if it's not an egg? Thanks, Matt
On 02/03/2011 11:24 AM, Matt Chaput wrote:
Can people still use easy_install/pip to install it if it's not an egg?
Yes. In fact, pip can only install from source distributions. A source .tar.gz is the most broadly-compatible distribution format available, unless your package includes compiled extensions and you're targeting a platform where compilation is problematic (i.e. Windows). Carl
I use buildout, which uses setuptools/distribute. So for that, the answer is yes.
"Matt Chaput"
On 03/02/2011 10:34 AM, Eric Smith wrote:
I use source distributions (python setup.py sdist) and then distribute the resulting .tar.gz file. Since it's a source (not binary) distribution, it can potentially run with any version of Python.
You see this a lot on PyPI, where the only thing uploaded is a .tar.gz file. See http://pypi.python.org/pypi/buildout.dumppickedversions/0.4, for example.
Can people still use easy_install/pip to install it if it's not an egg?
Thanks,
Matt _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Eric.
At 10:17 AM 2/3/2011 -0500, Matt Chaput wrote:
When I create an egg the Python version used to create the egg is encoded in the egg filename, e.g. Whoosh-1.6.0-py2.7.egg.
Is this version number used to decide what egg a user gets from PyPI? I didn't think it was, but a user is seeming to indicate that he got different versions based on what version of Python he was using.
Is there a way to set this value to "py2.5" as a configuration option, other than running setup.py using the Python 2.5 executable? Or not have it be part of the egg filename at all? I'm using Python 2.7 as my default Python install but I make sure that the code in my library is compatible with 2.5+. I've already someone think the library is only for a later version of Python because that's what I used to build the egg.
Sorry if this is an old question, I looked around but didn't find any docs on the subject.
I see you've already solved your issue by using source distributions, but for the archives I thought I should mention that the reason eggs are version specific is because they contained compiled .pyc or .pyo files, and those are only compatible with the Python version that compiled them. If you are distributing pure Python code through PyPI, though, there is usually no reason to ship it in an egg. Eggs were designed as a binary plugin format for rich application platforms, analagous to Java "jars" or Eclipse plugins. They're intended for scenarios where installing from source is overly complex and/or you want to make it so users can just drop a file into a plugin directory to get going. (easy_install came later, as a quick hack to automate building and installing eggs.)
On Feb 2, 2011, at 2:49 PM, Matt Chaput wrote:
Is there a way to set this value to "py2.5" as a configuration option, other than running setup.py using the Python 2.5 executable? Or not have it be part of the egg filename at all? I'm using Python 2.7 as my default Python install but I make sure that the code in my library is compatible with 2.5+. I've already someone think the library is only for a later version of Python because that's what I used to build the egg.
If you're building eggs, they're only going to be compatible with a single version of Python. Bytecode isn't compatible across multiple versions. If your module is pure python, you should just set up a linux VM old enough to have the Python versions you want or something :). So you might be able to hack something together that would cause a broken egg to be installed for users of other versions of python, but you won't be able to fix this issue, no. Otherwise, you can distribute some other format, like an sdist tarball, which has no pycs in it.
participants (6)
-
Carl Meyer
-
Eric Smith
-
Glyph Lefkowitz
-
Matt Chaput
-
Matt Chaput
-
P.J. Eby