Replies: 2 comments
-
Part of this change is likely to involve NOT changing As it is, the For the proposed change, module loading order will be:
|
Beta Was this translation helpful? Give feedback.
-
See issue #239 |
Beta Was this translation helpful? Give feedback.
-
pypyr works from $cwd
pypyr currently resolves pipelines and custom modules like steps/context parsers/loaders from the current working directory - which is to say $PWD or wherever pypyr is invoked from.
This is a bit of a legacy feature, that has been overtaken by events.
This way of working makes pipelines less portable than they should be. When you have parent pipelines calling child pipelines via
pypyr.steps.pype
. It means the child pipeline has to be coded with paths relative to wherever you called the parent from.As it stands, if you want to resolve from the pipeline directory, you currently have to invoke pypyr like this:
$ pypyr mypipeline --dir path/to/pipelinestuff
or in the case of the api
using paths relative to the pipeline instead
I propose to make this a bit easier by making pypyr work relative to the pipeline itself:
fetchyaml
,fileformat
,fileplace
andtar
steps) will continue to be relative to the cwd/$PWD.This means you'd be able to do
$ pypyr path/to/pipelinestuff/mypipeline
and then
mypipeline
will resolve custom modules and child pipeline-names relative to itself - meaning you can put supporting code/pipelines for your pipeline inpath/to/pipelinestuff/
and it will work wherever you call it from.impact
As ever, I don't want to break anything for anyone, so I'm putting out a feeler for thoughts/feedback/concerns. I think this will be very useful for making pipelines more portable, so you can create shared pipeline libraries that you can call from anywhere.
But, this does potentially break existing pipelines, if you are:
Calling the pipeline from a directory that is not its parent WITHOUT setting
--dir
/working_dir
AND in that pipeline (pype
Your input welcome!
Beta Was this translation helpful? Give feedback.
All reactions