<div dir="ltr"><div>Hi,</div><div><br></div><div>The thing about setup.py is that it only runs at "build time".</div><div><br></div><div>However, it looks like you want to generate a unique id at every install.</div><div><br></div><div>Since you mentioned a windows installer, consider adding some code to the installer itself so that it calls an entry point in your library to generate this unique id at that moment.</div><div><br></div><div>Sorry, there isn't any support in setuptools to do this from within setup.py itself.</div><div><br></div><div>Regards,</div><div><br></div><div>Leo</div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On 3 February 2016 at 13:31, AltSheets Dev <span dir="ltr"><<a href="mailto:altsheets+mailinglists@gmail.com" target="_blank">altsheets+mailinglists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks a lot!</div><div><br></div><div>I could get that working! <br>See setup.py lines 13 and 69 in <br><a href="https://github.com/altsheets/coinquery/blob/f1759a6dd5cd891f493da343c52e8184b45fc926/setup.py" target="_blank">https://github.com/altsheets/coinquery/blob/f1759a6dd5cd891f493da343c52e8184b45fc926/setup.py</a><br></div><div><br></div><div>BUT </div><div>my custom install routines are called </div><div>when the windows installer binary is CREATED,<br>not when it is UNPACKED on the target machine.</div><div><br></div><div>e.g. this coinquery-0.2.4.win-amd64.exe<br><a href="https://github.com/altsheets/coinquery/tree/master/debug" target="_blank">https://github.com/altsheets/coinquery/tree/master/debug</a><br></div><div><br></div><div>when unpacked ... always results in the same UID sz4u0zrqkas3q8s3t0se </div><div>you can see that when you type</div><div><br></div><div>hello</div><div><br></div><div><br></div><div>Any hints?</div><div><br></div><div>Thanks.</div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On 3 February 2016 at 00:00, Robert T. McGibbon <span dir="ltr"><<a href="mailto:rmcgibbo@gmail.com" target="_blank">rmcgibbo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">One very simple technique used by some projects like numpy is just to have ``setup.py`` write a file into the source tree before calling setup().<div><br></div><div>example: <a href="https://github.com/numpy/numpy/blob/master/setup.py#L338-L339" target="_blank">https://github.com/numpy/numpy/blob/master/setup.py#L338-L339</a><br></div><div><br></div><div>-Robert</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 2, 2016 at 1:48 PM, AltSheets Dev <span dir="ltr"><<a href="mailto:altsheets+mailinglists@gmail.com" target="_blank">altsheets+mailinglists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello everyone on distutils-sig@,<div>this is a first timer, please be gentle to me *g*</div><div><br></div><div>I am just starting with setuptools, <br>and I just cannot get my idea working:</div><div><br></div><div>At install time, <br>I'd like to generate a file with a random UID, <br>which will later always be the same. </div><div><br></div><div>I had hoped for a setup('postinstall'='my.py') or setup('preinstall'= ...) but there isn't one. </div><div><br></div><div>Then I have been trying with a customized<br><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:13.44px;white-space:pre-wrap">distutils.command.install.install</span></div><div>class - but so far with no success.</div><div><br></div><div>Here is a detailed explanation of my futile attempts:</div><div><a href="https://github.com/altsheets/coinquery/blob/master/README-setupCustom.md" target="_blank">https://github.com/altsheets/coinquery/blob/master/README-setupCustom.md</a><br></div><div><br></div><div>I guess this is be a pretty frequent question?</div><div><br></div><div>Happy about any hints. <br></div><div><br></div><div>Thanks.</div><div>:-)</div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div>-Robert</div></div></div>
</font></span></font></span></div>
</blockquote></div><br></div></div>
<br>_______________________________________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
<br></blockquote></div><br></div></div>