Re: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Christopher Reimer
On Oct 6, 2017, at 12:58 PM, Stephan Houben  
wrote:
> 
> Op 2017-10-06, Christopher Reimer schreef :
> 
>> So I got tox and tox-docker installed. When I went to install Docker
>> for Windows, it wouldn't work because Hyper-V wasn't available on
>> Windows 10 Home. After paying Microsoft $99 for the privilege, I got
>> Windows 10 Pro installed and Docker started working. I've read that
>> all the cool programming kids are using Docker these days. I certainly
>> hope it was worth the cost. O_o
> 
> You could have just used a Linux VM in Virtualbox for $0, and run Docker
> in that.
> 
> Stephan
> -- 
> https://mail.python.org/mailman/listinfo/python-lists 

My $200 Dell laptop couldn't handle that combo and it would add an extra layer 
of complexity to my programming setup.

Chris R.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Stephan Houben
Op 2017-10-06, Christopher Reimer schreef :

> So I got tox and tox-docker installed. When I went to install Docker
> for Windows, it wouldn't work because Hyper-V wasn't available on
> Windows 10 Home. After paying Microsoft $99 for the privilege, I got
> Windows 10 Pro installed and Docker started working. I've read that
> all the cool programming kids are using Docker these days. I certainly
> hope it was worth the cost. O_o

You could have just used a Linux VM in Virtualbox for $0, and run Docker
in that.

Stephan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Christopher Reimer
On Oct 5, 2017, at 3:34 PM, Christopher Reimer  
wrote:
> 
>> On Oct 5, 2017, at 1:11 PM, Irmen de Jong  wrote:
>> 
>>> On 10/05/2017 04:23 AM, Christopher Reimer wrote:
>>> 
>>> 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.
>> 
>> Perhaps you can use the service of Travis (travis-ci.org) to avoid 
>> installing the Python
>> versions yourself. They have lots of older versions available to run tests 
>> on.
>> 
>> Irmen
>> -- 
>> https://mail.python.org/mailman/listinfo/python-list
> 
> Travis might be a bit of an overkill for my project. Someone suggested docker 
> containers and there is a docker plugin for tox that looks promising.
> 
> Chris R. 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

So I got tox and tox-docker installed. When I went to install Docker for 
Windows, it wouldn't work because Hyper-V wasn't available on Windows 10 Home. 
After paying Microsoft $99 for the privilege, I got Windows 10 Pro installed 
and Docker started working. I've read that all the cool programming kids are 
using Docker these days. I certainly hope it was worth the cost. O_o

Chris R.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-05 Thread Christopher Reimer
On Oct 5, 2017, at 1:11 PM, Irmen de Jong  wrote:
> 
>> On 10/05/2017 04:23 AM, Christopher Reimer wrote:
>> 
>> 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.
> 
> Perhaps you can use the service of Travis (travis-ci.org) to avoid installing 
> the Python
> versions yourself. They have lots of older versions available to run tests on.
> 
> Irmen
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Travis might be a bit of an overkill for my project. Someone suggested docker 
containers and there is a docker plugin for tox that looks promising.

Chris R. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-05 Thread Irmen de Jong
On 10/05/2017 04:23 AM, Christopher Reimer wrote:

> 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.

Perhaps you can use the service of Travis (travis-ci.org) to avoid installing 
the Python
versions yourself. They have lots of older versions available to run tests on.

Irmen
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-05 Thread Steve D'Aprano
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.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-04 Thread Stephan Houben
Op 2017-10-05, Ben Finney schreef :
> Christopher Reimer  writes:
>
>> How do I determine the lowest version of Python to [declare that my
>> code supports]?
>
> You can determine that by installing all the Python versions you want to
> try, and running your code's unit test suite on each of them.

An easy way to get a bunch of different Python versions is 
to just pull the various Docker containers for them.

https://hub.docker.com/r/_/python/

Then run your unit tests in each of them.

Note that Python 3.3 support officially ended on 2017-09-29,
so at the moment I wouldn't bother to support anything lower than
3.4. That means testing 3.4, 3.5 and 3.6 (and 3.7 prerelease if
you want to be thorough).

Stephan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-04 Thread Ben Finney
Christopher Reimer  writes:

> How do I determine the lowest version of Python to [declare that my
> code supports]?

You can determine that by installing all the Python versions you want to
try, and running your code's unit test suite on each of them.

Those versions where the unit test suite fails, you can know that your
code does not run on that version of Python.

do this each time you make a significant change to the code; certainly
before you release any changes to the world.

Automate this procedure with an automated testing tool such as Tox
https://tox.readthedocs.org/>.

> 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 sounds to me like a good approach.

-- 
 \   “Working out the social politics of who you can trust and why |
  `\  is, quite literally, what a very large part of our brain has |
_o__)   evolved to do.” —Douglas Adams |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-04 Thread MRAB

On 2017-10-05 03:23, 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?

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.

Thank you,


If you want to know whether it'll run on 3.4, just run it on 3.4.
There may not be much point in running it on 3.5 because if it's OK on 
3.4, then it should also be OK on 3.5.


Of course, if you're talking about stuff that needs to be compiled, such 
as an extension written in C, then you'll need to test it on every 
version that you're willing to support.

--
https://mail.python.org/mailman/listinfo/python-list


Re: How to determine lowest version of Python 3 to run?

2017-10-04 Thread Chris Angelico
On Thu, Oct 5, 2017 at 1: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?
>
> 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.
>

By "major" and "minor", do you mean that you're testing on the latest
"3.5" (currently 3.5.4)? Usually a three-part version number is
described as "Major.Minor.Revision" [1], so you're working with the
single major version "3".

My recommendation is to quote only two-part version numbers. Test on
the last few, then say "Requires Python 3.4 or greater" if that's how
far back you tested. Generally, you won't have to test on multiple
revisions of the same minor version; if it runs on 3.5.2, it should
run on 3.5.3 and 3.5.1, unless you depend on some specific bug that
got fixed.

And how many versions back should you test? If you want to be
thorough, look at which versions are still in support - either with
your OS repositories or at Python.org - and test on all of those. If
you're like me, though, just test on whichever ones you happen to have
around, and then quote that :)

You can shortcut this whole process, though, if you know for certain
that you've used a newly-added feature. For example, if your code
depends on the order of arguments in **kwargs, don't bother testing on
3.5 and getting flaky results - that changed in 3.6, so just quote
that you need 3.6+. If you use the matrix multiplication operator "@",
test on 3.5 and 3.6 and that's it. Obviously this only helps if you
KNOW about a new feature, but I've had a number of projects where I
get all excited about a flashy new feature and immediately start using
it... :)

Hope that helps!

ChrisA

[1] The music nerd in me wants "minor" to be lower-cased, but I told
me to shut up.
-- 
https://mail.python.org/mailman/listinfo/python-list


How to determine lowest version of Python 3 to run?

2017-10-04 Thread Christopher Reimer
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?

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.

Thank you, 

Chris R.
-- 
https://mail.python.org/mailman/listinfo/python-list