[Distutils] Fwd: setup('postinstall'='my.py')

Paul Moore p.f.moore at gmail.com
Fri Feb 5 13:23:03 EST 2016

On 5 February 2016 at 16:39, AltSheets Dev
<altsheets+mailinglists at gmail.com> wrote:
> Would it be a valid feature request to make those two useful options
> (pre-install-script/install-script)  available platform-independent?

It's something that has been discussed under the "Metadata 2.0"
banner. It's certainly a valid request - but addressing the various
concerns and issues that come up is complex, and (AFAIK) no-one has
really come up with a satisfactory solution yet.


>> Have you thought of maybe not relying on the UID being generated at
>> "install" time, but rather having a "coinq init" command that the user
>> runs *once* to set up his/her UID? The other commands could then
>> check for that UID wherever you choose to store it, and if they don't
>> find it [...] automatically run init if they find no UID.
> Yes. I know, that is the other way to go.
> But then I need to understand where I am allowed to write persistent files
> - outside the place where the other .py files are installed anyways.
> And as that UUID.py has to be created only once in the lifetime of
> my tool on their computers, I had thought the /site-packages/... folder
> is the best place for it.   But perhaps it is really not.
> Do you know a Python package that abstracts from the platform ... with which
> I can write to (would those be the right places?)
>    (username/AppData/Roaming/myfolder) on Windows, and
>    (~/.myfolder) on Linux - and is it
>    (~/Library/myfolder) on Mac?

The "appdirs" project (https://pypi.python.org/pypi/appdirs) is one
I've seen used/recommended a lot.


More information about the Distutils-SIG mailing list