<html><head></head><body>I want the script to dynamically instantiate the venv is call activate this at execution time and deactivate when done.<br>
<br>
<br><br><div class="gmail_quote">On June 23, 2016 5:12:07 PM EDT, Doug Hellmann <doug@doughellmann.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Excerpts from Silence Dogood's message of 2016-06-23 15:45:34 -0400:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I know from conversations that a few folks package their python apps as<br /> distributable virtualenvs. spotify created dh-virtualenv for this. you<br /> can do it pretty simply by hand.<br /> <br /> I built a toolchain for building rpms as distributable virtualenvs and that<br /> works really well.<br /> <br /> What I'd like to do is make it so that every app that's built as a<br /> virtualenv gets setup to automatically execute at call time in their<br /> virtualenv.<br /> <br /> I see two options:<br /> <br /> 1) Dynamically generate a wrapper script during build and put it in the<br /> RPM. Call the wrapper.<br /> <br /> 2) Created a dependency global module ( as an rpm ) set it as a<br /> dependency. And basically it'd be an autoexecuting import that<br />
instantiates the virtualenv. it would probably know all it needs to<br /> because I am building all my packages to an internal standard. Then when<br /> building the APP rpm all I need to do is inject an import into the import<br /> chain if it's being built as a virtualenv. Then I have what are<br /> effectively statically compiled python apps.<br /> <br /> I like 2. But 1 isn't very bad. Both are a little hokey.<br /> <br /> Was curious if folks might have a preference, or a better idea.<br /> <br /> Thanks.<br /> <br /> Matt<br /></blockquote><br />I'm not sure what you mean by a "wrapper script". If you run the<br />Python console script from within the virtualenv you've packaged,<br />you shouldn't need to do anything to "activate" that environment<br />separately because it should have the correct shebang line.<br /><br />Are you seeing different behavior?<br /><br />Doug<br /><br /><hr /><br />OpenStack-operators mailing list<br
/>OpenStack-operators@lists.openstack.org<br /><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>