Your advice sounds exactly right for someone who is delivering software
into the Solaris WOS.  And I would only give my previously stated advice to
someone who was outside the Solaris WOS.  So perhaps we're not really
disagreeing, although I can't be sure.

--chris



On Friday October 28, at    2:55PM, Brock Pytlik wrote:

> On 10/28/11 14:39, Chris Quenelle wrote:
>> I misspoke, sorry.  Obviously pkgdepend should add a dependency on
>> the centralized mediator package for python.  /usr/bin/python
>> must exist.  I intended to say that pkgdepend should not worry about
>> which version of python is installed.
>> 
>> I think it's possible and useful for pkgdepend to require that there is
>> a file at /usr/bin/python.  But I don't think it's useful to require
>> that pkgdepend knows which one it's going to be.
>> 
>> Why does pkgdepend care which version of python is installed anyway?
>> What kind of difference does it make to *my* package with a script
>> if the end user installs 2.4 or 2.6?
> It makes a difference to pkgdepend because the modules imported when your 
> script is run under python 2.4 could be very different than when it's run 
> under python 2.6.
>> Does pkgdepend grovel through my python use statements to make
>> sure they are also satisfied?
> If you mean python import statements, then yes, it does it's best (halting 
> problem kept in mind), to determine what modules your program imports and 
> adding dependencies on the packages that deliver those modules.
>> If a user asked me how to write a python script on Solaris, I would tell 
>> them this:
>> If your script is fairly simple and expected to run on any contemporary 
>> version of python,
> Of course, this is always the tricky bit isn't it? There are certainly things 
> that change between python 2.6 and 2.7, and the change to 3.X is obviously 
> large. Being sure that your simple script that works now on 2.6 is going to 
> work when the user sets /usr/bin/python to point to version 3.4 is a bit 
> difficult. All the advice I've encountered when it comes to writing python 
> scripts seems to be that if you're writing a python program that's expected 
> to stick around for a while (ie, you're not writing it and discarding it 
> shortly after), then you should version the python you're using.
>> then use #!/usr/bin/python.  If you tie it to a specific version, you'll 
>> need to come back
>> and update it when Solaris changes, and the package you publish today might 
>> not
>> run on newer Solaris releases.  And by the way you'll have to work around a 
>> pkgdepend
>> bug...
> Sounds like you and I would give (and have been given) very different advice 
> to someone on how to write their python program since my advice would look 
> like:
> 
> Use a versioned python, since that's what you've actually tested it on. If 
> you've tested it on multiple versions of python, you can A) deliver multiple 
> packages or B) deliver a mediated link. When a new release of solaris comes 
> out you can be certain that your program will work as desired as long as the 
> needed version(s) of python are delivered for that release. You will not have 
> to worry about your program being silently broken or behaving badly because 
> the new version of python has some subtle difference. When the new release of 
> solaris appears, you should create a new package/deliver another mediate link 
> once you've tested your program on the python version(s) in that release.
> 
> Brock
>> --chris
>> 
>> 
>> 
> [snip]

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to