[Tutor] Am I missing something on module pyversions?

Steven D'Aprano steve at pearwood.info
Mon Jun 10 09:52:13 CEST 2013


On 10/06/13 10:57, Jim Mooney wrote:
> I look at modules online and sometimes it's clear if they're for Py
> 2.7 or Py3.3, usually in Requirements. Or if not, it's literally on
> the download package, which will actually have 2.7 or 3.3 in the zip
> or tar name. But on some sites it's totally unclear. They don't say it
> at all up-front. I'll hunt around and still can't find it.
>
> Is there some standard I'm just overlooking that definitively says
> which Py version a module is for? Or something in the module package
> itself? I'm surprised this isn't a real up-front item. Or do I have to
> search, guess, and download to find out?


The standard is that it should be documented on the PyPI page, if they are on PyPI, or otherwise documented as a requirement, or mentioned on the project home page or FAQ page. But not all projects document, either due to laziness, incompetence, forgetfulness, or hope that it will work for any version of Python under the sun.

Documenting the version as part of the file name is definitely *not* a standard. Most modules will work for a whole series of Python versions. What do you do?

     mymodule-2.4-2.5-2.6-2.7.zip

which is ugly and silly, or:

     mymodule-2.4.zip

which looks like it hasn't been updated in six years, or:

     mymodule-2.7.zip

which looks like it doesn't support 2.4 through 2.6.

The exception is, if you actually do have a separate version of your package for each Python release. Then it is wise to mirror the Python version in your version.



-- 
Steven


More information about the Tutor mailing list