Specify a config file per Collection... possible?

Open
#978 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
cli, tooling

Research direction

Start by examining tasks/init.py, tasks/stuff.py, and the two YAML configuration files described in the issue. Determine how collections currently load configuration and define what support for separate config_a.yaml and config_b.yaml would require; done means collections A and B can load their respective configurations independently.

Written by the indexing model from the issue text.

Description

I would like to be able to define a set of tasks, and then load those tasks into multiple collections, each with a separate configuration.

Something like this:

tasks
├── __init__.py
├── config_a.yaml
├── config_b.yaml
└── stuff.py

And in the __init__.py

from invoke import Collection
import tasks.stuff

ns = Collection()
ns.add_collection(stuff, 'A')
ns.add_collection(stuff, 'B')

How do I make the 'A' collection use config_a.yaml and 'B' use config_b.yaml?

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.