LedgerHQ / btchip-python

Ledger HW.1 Python API
http://www.ledger.co
Apache License 2.0
65 stars 50 forks source link

Can't build btchip-python wheel anymore #53

Open presentfactory opened 1 year ago

presentfactory commented 1 year ago

When I try to install btchip-python via pip install btchip-python I get this due to something being wrong with the setup.py file which prevents it from installing:

      running install_scripts
      Traceback (most recent call last):
        File "/usr/lib/python3.11/site-packages/packaging/requirements.py", line 35, in __init__
          parsed = _parse_requirement(requirement_string)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/packaging/_parser.py", line 64, in parse_requirement
          return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/packaging/_parser.py", line 82, in _parse_requirement
          url, specifier, marker = _parse_requirement_details(tokenizer)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/packaging/_parser.py", line 126, in _parse_requirement_details
          marker = _parse_requirement_marker(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/packaging/_parser.py", line 147, in _parse_requirement_marker
          tokenizer.raise_syntax_error(
        File "/usr/lib/python3.11/site-packages/packaging/_tokenizer.py", line 165, in raise_syntax_error
          raise ParserSyntaxError(
      packaging._tokenizer.ParserSyntaxError: Expected end or semicolon (after version specifier)
          python-pyscard>=1.6.12-4build1
                        ~~~~~~~~~~^

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ejw6ui8h/btchip-python_cd0a9c8abd924937b5736601c67fb5c6/setup.py", line 9, in <module>
          setup(
        File "/home/lemon/.local/lib/python3.11/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/lemon/.local/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/home/lemon/.local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/home/lemon/.local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 395, in run
          self.egg2dist(self.egginfo_dir, distinfo_dir)
        File "/usr/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 534, in egg2dist
          pkg_info = pkginfo_to_metadata(egginfo_path, pkginfo_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/wheel/metadata.py", line 160, in pkginfo_to_metadata
          for key, value in generate_requirements({extra: reqs}):
        File "/usr/lib/python3.11/site-packages/wheel/metadata.py", line 138, in generate_requirements
          for new_req in convert_requirements(depends):
        File "/usr/lib/python3.11/site-packages/wheel/metadata.py", line 103, in convert_requirements
          parsed_requirement = Requirement(req)
                               ^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/site-packages/packaging/requirements.py", line 37, in __init__
          raise InvalidRequirement(str(e)) from e
      packaging.requirements.InvalidRequirement: Expected end or semicolon (after version specifier)
          python-pyscard>=1.6.12-4build1
                        ~~~~~~~~~~^
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for btchip-python
  Running setup.py clean for btchip-python
Failed to build btchip-python
ERROR: Could not build wheels for btchip-python, which is required to install pyproject.toml-based projects
Fuzzbawls commented 1 year ago

also experiencing this issue now

EchterAgo commented 11 months ago

See also https://github.com/pypa/setuptools/issues/3801, workaround is to downgrade setuptools.

EchterAgo commented 11 months ago

54 fixes this.

pip install git+https://github.com/EchterAgo/btchip-python.git@fix_deps

accumulator commented 2 months ago

bump. #54 fixes this issue, what's the hold-up?

vbmithr commented 1 month ago

Yeah, please merge, as it is a dependency to run electrum with a Ledger. @btchip ?