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

some non-urgent ideas on built-in pypyr functionality #1

Open
yaythomas opened this issue Apr 26, 2022 · 2 comments
Open

some non-urgent ideas on built-in pypyr functionality #1

yaythomas opened this issue Apr 26, 2022 · 2 comments

Comments

@yaythomas
Copy link

Hi, interesting project! Thanks for using pypyr! I've got a couple of suggestions that I hope might make your life a little easier (I'm the creator/maintainer of pypyr 😄 )

  1. The custom parser at parser/default.py is pretty much doing the same thing as the built-in pypyr.parser.keyvaluepairs parser, so this might save you having to worry about the custom code. . .

  2. The pyrun step you can achieve the same thing with the built-in pypyr.steps.python step to get the current sys.executable, so your pipelines would look like:

steps:
  - pypyr.steps.python

  - name: pypyr.steps.cmd
    description: --> whatever modules you want to invoke
    in:
      cmd: '"{python}" -m arbpackage.mymodule --myarg' 

You can of course use further {formatting expressions} to inject different package/module/args into the cmd.

steps:
  - pypyr.steps.python

  - name: pypyr.steps.cmd
    description: --> pass whatever is in args to python -m.
    in:
      cmd: '"{python}" -m {args}' 
  1. For steps/entry.py you could use the built-in pypyr.steps.pype step to invoke child pipelines from a parent pipeline. You can use the args input on pype to initialise the child pipeline's context with specific values like MKDV_CACHEDIR and set groups to specify which groups to run (e.g ['setup', 'run']).

  2. A couple of the custom steps work with environment variables. pypyr has builtin pypyr.steps.env and pypyr.steps.envget to allow you to get $VARs into context or set $VARS etc. This may or may not make your life easier, could also be that just doing it in custom step code is less laborious, depends on the particular circumstance.

Hope this helps! To be clear, nothing you're doing is "wrong" and of course it'll work and it could well even be necessary depending on longer term objectives you have in mind... I just thought to throw some casual suggestions your way in the hope that it might make your pypyr experience smooth as possible!

If you have feedback/suggestions/ideas for improvement on pypyr built-in functionality feel free to get in touch!

@mballance
Copy link
Member

Hi @yaythomas, thank you for reaching out, and thanks for your work on pypyr! I've been looking for an easily-extensible tool like this for some time, and was very excited to find pypyr.
Very much appreciate your analysis and suggestions for ways to use more 'built-in' mechanisms in pypyr vs creating custom extensions!

@yaythomas
Copy link
Author

super, glad to hear it! just mentioned who I am so it doesn't look like I'm just a total rando just arbitrarily reviewing your code here 😆

feel free to get in touch if you have questions/suggestions! I frequently use feedback like this to prioritise what new things to include in the pypyr core, so it's very valuable to me to get real-world usage insights like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants