osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to determine lowest version of Python 3 to run?


On Thu, 5 Oct 2017 01:23 pm, Christopher Reimer wrote:

> Greetings,
> 
> I've always installed the latest and greatest version of Python 3 to develop
> my own programs. I'm planning to release a program to the public. I could
> toss in a note that the program runs on the latest version of Python 3.6 but
> I haven't tested on earlier versions (i.e., 3.4 and 3.5). AFAIK, I haven't
> written any version-specific code.
> 
> How do I determine the lowest version of Python to run?

If you know your code uses a feature introduced in version X, then X is the
lowest version it will run in. E.g. if you use the u'' syntax for Unicode
strings, which was re-introduced in 3.3 to make it easier to write Python 2/3
compatible code, then it won't run it Python 3.1 or 3.2.


> I'm leaning towards installing the latest minor version of each available
> major version, running tox to run the unit tests against each one, and
> seeing what blows up.

That seems reasonable to me, except I think you mean latest release of each
minor version e.g.:

3.5.1 = major.minor.release

I'd also consider testing against the *earliest* release, rather than the
latest. If it works with (say) 3.5.0, then you should be safe to claim it
works for all 3.5. But if it works for 3.5.4, say, you aren't *quite* so safe
to make the same claim.



-- 
Steve
?Cheer up,? they said, ?things could be worse.? So I cheered up, and sure
enough, things got worse.