[python-uk] Python services within existing .Net infrastructure

Jonathan Hartley tartley at tartley.com
Wed Feb 1 09:26:34 EST 2017


On 02/01/2017 01:05 AM, Steve - Gadget Barnes wrote:
>
> On 01/02/2017 04:25, Jonathan Hartley wrote:
>> Thanks all.
>>
>> Hansel - Thank you, that makes sense. I actually already do a mini
>> version of that at the place I'm leaving, but devs are only using
>> Linux/Mac host machines, and we only a Linux VM. It's reassuring to hear
>> that sort of setup is still feasible when extended to Windows hosts, and
>> Windows VMs too.
>>
>> I'm tempted to reduce the number of dev configurations we need to
>> maintain by just holding my nose and using a Windows laptop, same as
>> everyone else, with a Linux VM on it. That way, I can easily replicate
>> my setup on any other dev's machine if they want to get involved in the
>> Python. Would get us up and running quicker, rather than figuring out
>> every combo of host and VM OS. But maybe expand into doing the full
>> monty you describe if there's ever more than just me who would like to
>> work from Linux (or if I get sick of working in a VM the whole time)
>>
>>      Jonathan
>>
>>
> Jonathan,
>
> Have you considered that python is extremely cross platform. Provided
> you are careful in the areas of:
>
>    - Paths
>    - Direct hardware interfaces
>    - Shell operations
>    - Maintaining your requires.txt file(s)
>    - A tiny number of libraries that are not (easily) available for
> Windows, (maybe it is worth having a blacklist). On that front Christoph
> Gohlke has http://www.lfd.uci.edu/~gohlke/pythonlibs/ which can save
> many hours of fun. Note that the introduction of the wheel library
> format has made things a lot simpler.
>
> You should be able to develop & test python code on Linux (where you are
> comfortable) including writing test suites - fire up a Windows VM with
> python installed, (complete with populating you library from
> requires.txt) & run your test suite. Then, assuming the tests all pass,
> either deploy to Windows machines with python already installed as a
> prerequisite or while you are in your VM use py2exe/pyinstaller or
> cxfreeze to produce a Windows deployment for machines that don't have
> python installed.  If you stick to good, cross platform, programming
> standards you should find it a breeze - pylint is your friend on this.
>
> Just as an example I had been developing a suite of (wx)Python based
> programs/utilities at work for quite a few years under Windows 7 and
> deploying it. as executables, to machines running XP though 10. When the
> whole lot was at about 80k lines I had an opportunity to try it for the
> first time on a Linux box - I had to change 3 lines of code to get it
> working.  Of course this was helped by the fact that I was testing both
> as source and as bundled executable.
>
> Many people swear by Anaconda for simplifying this sort of stuff you may
> wish to consider going that way personally I stick with pip and
> sometimes, rarely, have to re-think which library I am going to have to use.
>
> Of course deploying a docker using vagrant does give you a lot more
> control and Linux dockers with python & your libraries installed can be
> quite light weight.

Hey Steve, Thanks for the detailed thoughts.

My situation is a web application deployed to AWS, so I'm able to 
control the installed Python and other dependencies on the servers, so I 
won't need py2exe et al. In that situation, I agree that pip is even 
more appropriate than Anaconda.

It's great to hear that Python running on Windows is continuing to 
flourish, and you reassure me that's a healthy option. But to be honest, 
I'm more concerned about lacking the Linux system calls, ecosystem of 
services (e.g. supervisor) and philosophy that I'm used to. Clearly 
there are Windows equivalents of the tools I like, but figuring them out 
would be an extra burden, and I'd rather min/max my future skillset 
rather than knowing a little bit about each.

I very much hope that containers will be part of our strategy, as 
outlined by Hansel earlier. I only just learned that Windows containers 
are also now a thing! I had no idea. (They only run on Windows hosts, 
which is fair.)

Many thanks for the inputs, people.

     Jonathan

-- 
Jonathan Hartley    tartley at tartley.com    http://tartley.com
Made out of meat.   +1 507-513-1101        twitter/skype: tartley



More information about the python-uk mailing list