Skip to content

How to share variables among tasks? #237

Answered by nat-n
fritz-trawa asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @fritz-trawa,

If I understand your question correctly there are two mechanisms appropriate for setting a variable in one place for use by multiple tasks.

  1. Global environment variables
    [tool.poe.env] <-- THIS
    my_src = "./some/string/"
      
    [tool.poe.tasks.typecheck]
    cmd = "mypy $my_src"
      
    [tool.poe.tasks.lint]
    cmd = "ruff $my_src"
  2. Create a dotenv file and reference it from each task or as a global option.

Does that solve your problem?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@fritz-trawa
Comment options

@nat-n
Comment options

@fritz-trawa
Comment options

Answer selected by fritz-trawa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #236 on August 20, 2024 19:22.