Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flux python command to run configured python #1766

Merged
merged 2 commits into from Oct 29, 2018

Conversation

Projects
None yet
4 participants
@trws
Copy link
Member

trws commented Oct 25, 2018

This adds a command, flux python, to invoke the interpreter flux was configured with under the flux environment as it is set by the flux command. It's a convenience wrapper essentially, but given the number of pythons that sometimes end up laying around in one's path, it can be helpful to get directly to the right one with a fixed PYTHON_PATH.

This also adjusted the environment setup to fix running python against
the build tree for out-of-tree builds.

@trws trws requested review from garlick and SteVwonder Oct 25, 2018

@trws trws force-pushed the trws:add-python-command branch 2 times, most recently from 5aaccff to 3f70082 Oct 25, 2018

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Oct 25, 2018

Codecov Report

Merging #1766 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1766      +/-   ##
==========================================
+ Coverage   79.56%   79.58%   +0.01%     
==========================================
  Files         185      186       +1     
  Lines       34477    34483       +6     
==========================================
+ Hits        27433    27442       +9     
+ Misses       7044     7041       -3
Impacted Files Coverage Δ
src/cmd/builtin/python.c 100% <100%> (ø)
src/broker/modservice.c 78.84% <0%> (-0.97%) ⬇️
src/common/libflux/message.c 81.26% <0%> (+0.12%) ⬆️
src/modules/barrier/barrier.c 78.62% <0%> (+2.06%) ⬆️
@@ -34,7 +34,7 @@ intree_conf_cppflags = \
-DINTREE_EXEC_PATH=\"$(abs_top_builddir)/src/cmd:$(abs_top_srcdir)/src/cmd:$(abs_top_builddir)/src/broker\" \
-DINTREE_LUA_PATH_ADD=\"$(abs_top_srcdir)/src/bindings/lua/?.lua\" \
-DINTREE_LUA_CPATH_ADD=\"$(abs_top_builddir)/src/bindings/lua/?.so\" \
-DINTREE_PYTHON_PATH=\"$(abs_top_builddir)/src/bindings/python\" \
-DINTREE_PYTHON_PATH=\"$(abs_top_srcdir)/src/bindings/python:$(abs_top_builddir)/src/bindings/python\" \

This comment has been minimized.

@SteVwonder

SteVwonder Oct 25, 2018

Member

Just to confirm, the srcdir is first because of environment using push_front?

This comment has been minimized.

@trws

trws Oct 25, 2018

Author Member

Right. This causes it to come out in the opposite order in PYTHON_PATH.

@SteVwonder

This comment has been minimized.

Copy link
Member

SteVwonder commented Oct 26, 2018

LGTM!

@garlick
Copy link
Member

garlick left a comment

Cool, thanks!

@garlick

This comment has been minimized.

Copy link
Member

garlick commented Oct 26, 2018

Maybe it would be good to add a quick test to t/t0001-basic.t?

@trws

This comment has been minimized.

Copy link
Member Author

trws commented Oct 26, 2018

Sure, I need to rebase anyway.

@trws trws force-pushed the trws:add-python-command branch from 3f70082 to f0b9bf4 Oct 26, 2018

@garlick

This comment has been minimized.

Copy link
Member

garlick commented Oct 26, 2018

Thanks! Maybe #1772 should go in first since it doesn't look like this handles the case where python isn't configured?

@trws

This comment has been minimized.

Copy link
Member Author

trws commented Oct 26, 2018

Crud, yes you're right. Thanks for that catch @garlick!

@garlick

This comment has been minimized.

Copy link
Member

garlick commented Oct 27, 2018

This one's next I think? Just needs a rebase.

trws added some commits Oct 25, 2018

add flux python command to run configured python
This also adjusted the environment setup to fix running python against
the build tree for out-of-tree builds.

fix stupid crap

@trws trws force-pushed the trws:add-python-command branch from f0b9bf4 to 73059d0 Oct 29, 2018

@trws

This comment has been minimized.

Copy link
Member Author

trws commented Oct 29, 2018

Rebased, assuming travis is happy it should be GTG.

@garlick garlick merged commit 8039b92 into flux-framework:master Oct 29, 2018

3 checks passed

codecov/patch 100% of diff hit (target 79.56%)
Details
codecov/project 79.58% (+0.01%) compared to 426227e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.