Is it possible to extend the Context class's run method with my own?

Open
#905 1 comment 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 reading the Context class and its run method, then review how command execution parameters are defined and passed. Determine whether supporting custom parameters is an intended API change or requires a documented extension mechanism; done should include a clear supported approach and coverage for the requested custom-argument behavior.

Written by the indexing model from the issue text.

Description

This might be more a general python question, but any tips would be great!

I want to add my own custom parameters to the context class's run method. I guess I could patch it, but wondering if there is a better supported way?

I want to be able to do this:
ctx.run("mycommand", hide=False, myCustomArg="somevalue")

So I can add my own functionality.

Is it possible to extend the Context class with my own and use my own class?

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.