Coder Social home page Coder Social logo

magicinvoke's People

Contributors

akitada avatar alex avatar aroberts avatar bitprophet avatar coderanger avatar dstufft avatar haydenflinner avatar hirokiky avatar ivoz avatar jjmaestro avatar jock-tanner avatar jordoncm avatar kenden avatar lmiphay avatar lsaffre avatar mattrobenolt avatar mkusz avatar msabramo avatar myusuf3 avatar nhoening avatar nkantar avatar omadjoudj avatar pfmoore avatar presidento avatar ryanwang520 avatar singingwolfboy avatar sylvainde avatar techniq avatar thedrow avatar yoshiya0503 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magicinvoke's Issues

ImportError: cannot import name 'Iterable' from 'collections'

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.

ModuleNotFoundError: No module named 'six'

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

Pull upstream

Upstream seems to have some new features, like "dry" on the run cmd. Accepting PR to rebase this repo onto the latest of invoke.

Boolean Flags not supported with *args/**kwargs

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.

Installation mangles existing invoke installation

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:

image

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.

Kwargs with `_` don't work

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.