Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not install micropython-wiegand #102

Open
iBobik opened this issue Apr 11, 2020 · 0 comments
Open

Can not install micropython-wiegand #102

iBobik opened this issue Apr 11, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@iBobik
Copy link

iBobik commented Apr 11, 2020

Describe the bug

Tried to install specific package from pypi, but it failed.

Different packages worked.

Expected Behavior

It will instlall the package.
Current Behavior

It failed on error.
Steps to Reproduce

micropy install micropython-wiegand

Also tried to install from URL to zip or raw file.

Logs

 $ pycopy > micropy install micropython-wiegand       
MicroPy  Loading Project
MicroPy  ✔ Ready!

MicroPy  Installing Packages
Traceback (most recent call last):
  File "/usr/local/bin/micropy", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/cli.py", line 171, in install
    project.add_package(pkg, dev=dev)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 147, in __call__
    return getattr(*proxy)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 96, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/packages.py", line 142, in add_package
    source = create_dependency_source(package, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/__init__.py", line 43, in create_dependency_source
    return PackageDependencySource(pkg, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source_package.py", line 39, in __init__
    self.repo_url
  File "/usr/local/lib/python3.7/site-packages/micropy/utils/helpers.py", line 287, in get_package_meta
    tar_meta = next((i for i in spec_data if ".tar.gz" in Path(i['url']).name))
StopIteration
 $ pycopy > micropy install https://files.pythonhosted.org/packages/b8/e0/874eed0203d5051fc255ea16fbf43d4cc08ddbdd66de1c46bd4ce9a02c6b/micropython-wiegand-1.1.0.zip

MicroPy  Loading Project
MicroPy  ✔ Ready!

MicroPy  Installing Packages
Traceback (most recent call last):
  File "/usr/local/bin/micropy", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/cli.py", line 171, in install
    project.add_package(pkg, dev=dev)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 147, in __call__
    return getattr(*proxy)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 96, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/packages.py", line 142, in add_package
    source = create_dependency_source(package, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/__init__.py", line 43, in create_dependency_source
    return PackageDependencySource(pkg, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source_package.py", line 30, in __init__
    super().__init__(package)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 28, in __init__
    self.log: ServiceLog = Log.add_logger(repr(self))
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 79, in __repr__
    return f"<{self.__class__.__name__} {self.package}>"
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 80, in __str__
    return self.full_name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 42, in full_name
    return self.name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 29, in name
    return canonicalize_name(self._name)
  File "/usr/local/lib/python3.7/site-packages/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or bytes-like object
 $ pycopy > micropy install https://github.com/pjz/micropython-wiegand/archive/1.1.0.tar.gz

MicroPy  Loading Project
MicroPy  ✔ Ready!

MicroPy  Installing Packages
Traceback (most recent call last):
  File "/usr/local/bin/micropy", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/cli.py", line 171, in install
    project.add_package(pkg, dev=dev)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 147, in __call__
    return getattr(*proxy)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 96, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/packages.py", line 142, in add_package
    source = create_dependency_source(package, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/__init__.py", line 43, in create_dependency_source
    return PackageDependencySource(pkg, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source_package.py", line 30, in __init__
    super().__init__(package)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 28, in __init__
    self.log: ServiceLog = Log.add_logger(repr(self))
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 79, in __repr__
    return f"<{self.__class__.__name__} {self.package}>"
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 80, in __str__
    return self.full_name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 42, in full_name
    return self.name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 29, in name
    return canonicalize_name(self._name)
  File "/usr/local/lib/python3.7/site-packages/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or bytes-like object
 $ pycopy > micropy install https://raw.githubusercontent.com/pjz/micropython-wiegand/master/wiegand.py
MicroPy  Loading Project
MicroPy  ✔ Ready!

MicroPy  Installing Packages
Traceback (most recent call last):
  File "/usr/local/bin/micropy", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/cli.py", line 171, in install
    project.add_package(pkg, dev=dev)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 147, in __call__
    return getattr(*proxy)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 96, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/project/modules/packages.py", line 142, in add_package
    source = create_dependency_source(package, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/__init__.py", line 43, in create_dependency_source
    return PackageDependencySource(pkg, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source_package.py", line 30, in __init__
    super().__init__(package)
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 28, in __init__
    self.log: ServiceLog = Log.add_logger(repr(self))
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/source.py", line 79, in __repr__
    return f"<{self.__class__.__name__} {self.package}>"
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 80, in __str__
    return self.full_name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 42, in full_name
    return self.name
  File "/usr/local/lib/python3.7/site-packages/micropy/packages/package.py", line 29, in name
    return canonicalize_name(self._name)
  File "/usr/local/lib/python3.7/site-packages/packaging/utils.py", line 16, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or bytes-like object

Context (Environment)

macOS

micropy, version 3.3.0

Python 2.7.16 default in the system.
Also installed Python 3.7.7, but micropy probably does not use it.

@iBobik iBobik added the bug Something isn't working label Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant