haydenflinner / magicinvoke Goto Github PK
View Code? Open in Web Editor NEWFork of invoke with some small but handy features added.
License: BSD 2-Clause "Simplified" License
Fork of invoke with some small but handy features added.
License: BSD 2-Clause "Simplified" License
The Travis build is broken for various reasons. Accepting PRs to fix or replace Travis with something else that runs the tests on a few python versions.
This error prevented me from using MagicInvoke with Python 2.8 and up.
I've made a PR for this: #5 . Would you please review and merge.
Otherwise MagicInvoke works fine for me (Python 3.10). So far I'm using only task kwargs though. Anyway, big thankyou to the contributors. Such a useful package.
Hi!
Thank you for this cool Invoke extesion! I started using it today and ran into a small problem after installing it in a new virtualenv and running invoke
without arguments:
Traceback (most recent call last):
File "/home/ali/downloads/test/venv/bin/invoke", line 5, in <module>
from invoke.main import program
File "/home/ali/downloads/test/venv/lib/python3.9/site-packages/invoke/__init__.py", line 2, in <module>
from .collection import Collection # noqa
File "/home/ali/downloads/test/venv/lib/python3.9/site-packages/invoke/collection.py", line 4, in <module>
from .util import six, Lexicon, helpline
File "/home/ali/downloads/test/venv/lib/python3.9/site-packages/invoke/util.py", line 39, in <module>
from six import raise_from, iteritems # noqa
ModuleNotFoundError: No module named 'six'
It worked after I manually installed the six package. I found a vendored six here, but I don't know if that's what was supposed to be found by Magicinvoke. The Get Started section only suggests pip install magicinvoke
, so I'm guessing it should have worked with just that (but please correct me if I'm mistaken).
Here's my system information:
$ python --version
Python 3.9.2
$ pip --version
pip 21.0.1 from /home/ali/downloads/test/venv/lib/python3.9/site-packages/pip (python 3.9)
$ easy_install --version
setuptools 49.2.1 from /home/ali/downloads/test/venv/lib/python3.9/site-packages (Python 3.9)
$ uname -a
ali 5.11.11-arch1-1 #1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000 x86_64 GNU/Linux
Update: I get the same error with Python 3.6.13
Upstream seems to have some new features, like "dry" on the run cmd. Accepting PR to rebase this repo onto the latest of invoke.
First of all, thanks @haydenflinner for your work - wish the kwargs support would be part of native invoke!
Perhaps I'm missing something but it seems that valueless (boolean) flags don't work out of the box:
inv my-task --foo
Fails with Flag <Argument: foo> needed value and was not given one!
But:
inv my-task --foo bar
works as {"foo": "bar"}
ends up in kwargs
.
Not sure what the best way to do this is without having to define a schema. I think Config could track which items are accessed and at exit we could warn with items that weren't accessed (that aren't just defaults)
Same for cmd-line -D flags.
Our CI is failing with an assortment of syntax errors in invoke package. On closer inspection we can see some files in invoke got mangled somehow:
My guess is that magicinvoke
install its own copy of invoke
(can someone confirm that the case?) - but because poetry installs invoke
and magicinvoke
in parallel, there is a possibility these two installations partially writing on top of each other.
Hi @haydenflinner,
This looks like a bug:
When running:
inv mytask --foo-bar baz
I get: kwargs={'foo-bar': 'baz'}
But when running:
inv mytask --foo_bar baz
I get:
Traceback (most recent call last):
File "./venv/bin/inv", line 10, in <module>
sys.exit(program.run())
File "./venv/lib/python3.6/site-packages/invoke/program.py", line 397, in run
self.parse_tasks()
File "./venv/lib/python3.6/site-packages/invoke/program.py", line 741, in parse_tasks
result = self.parser.parse_argv(self.core.unparsed)
File "./venv/lib/python3.6/site-packages/invoke/parser/parser.py", line 169, in parse_argv
machine.handle(token)
File "./venv/lib/python3.6/site-packages/invoke/parser/parser.py", line 253, in handle
self.switch_to_flag(token)
File "./venv/lib/python3.6/site-packages/invoke/parser/parser.py", line 429, in switch_to_flag
self.flag = self.context.flags[flag]
File "./venv/lib/python3.6/site-packages/invoke/vendor/lexicon/alias_dict.py", line 80, in __getitem__
return self._handle(key, None, single, multi, unaliased)
File "./venv/lib/python3.6/site-packages/invoke/vendor/lexicon/alias_dict.py", line 62, in _handle
return unaliased(self, key, value)
File "./venv/lib/python3.6/site-packages/invoke/vendor/lexicon/alias_dict.py", line 74, in unaliased
def unaliased(d, key, value): return super(AliasDict, d).__getitem__(key)
KeyError: '--foo_bar'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.