yaqwsx / Pinion

Generate interactive and nice-looking diagrams for your PCBs!
https://yaqwsx.github.io/Pinion/
MIT License
427 stars 19 forks source link

Buggy PyPi package, missing nightly builds, and won't install from source #42

Open skull-squadron opened 2 months ago

skull-squadron commented 2 months ago
  1. Either pipx install pinion or pip3 install pinion in a virtualenv "succeeds" but then
Traceback (most recent call last):
  File "{{~}}/.local/bin/pinion", line 5, in <module>
    from pinion.ui import cli
  File "{{~}}/.local/pipx/venvs/pinion/lib/python3.12/site-packages/pinion/ui.py", line 8, in <module>
    from pinion.generate import generateDrawnImages
  File "{{~}}/.local/pipx/venvs/pinion/lib/python3.12/site-packages/pinion/generate.py", line 2, in <module>
    from pcbnewTransition import pcbnew, isV6, isV7
  File "{{~}}/.local/pipx/venvs/pinion/lib/python3.12/site-packages/pcbnewTransition/__init__.py", line 23, in <module>
    from .transition import *
  File "{{~}}/.local/pipx/venvs/pinion/lib/python3.12/site-packages/pcbnewTransition/transition.py", line 15, in <module>
    from . import pcbnew
  File "{{~}}/.local/pipx/venvs/pinion/lib/python3.12/site-packages/pcbnewTransition/pcbnew.py", line 1, in <module>
    from pcbnew import *
ModuleNotFoundError: No module named 'pcbnew'
  1. There are no nightly builds under workflows to install from.

  2. pip3 install git+https://github.com/yaqwsx/Pinion doesn't work because of outdated or incompatible versioneer or versioneer.py.

Collecting git+https://github.com/yaqwsx/Pinion
  Cloning https://github.com/yaqwsx/Pinion to {{redacted}}/pip-req-build-3hav1m26
  Running command git clone --filter=blob:none --quiet https://github.com/yaqwsx/Pinion {{redacted}}/pip-req-build-3hav1m26
  Resolved https://github.com/yaqwsx/Pinion to commit dfb53dda488d780d7c15017aa7fbed69ba69867f
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      {{redacted}}/pip-req-build-3hav1m26/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "{{redacted}}/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "{{redacted}}/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "{{redacted}}/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "{{redacted}}/pip-build-env-wy2iwigk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "{{redacted}}/pip-build-env-wy2iwigk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "{{redacted}}/pip-build-env-wy2iwigk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 502, in run_setup
          super().run_setup(setup_script=setup_script)
        File "{{redacted}}/pip-build-env-wy2iwigk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 12, in <module>
        File "{{redacted}}/pip-req-build-3hav1m26/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "{{redacted}}/pip-req-build-3hav1m26/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "{{redacted}}/pip-req-build-3hav1m26/versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
yaqwsx commented 2 months ago

1) You cannot install Pinion into vevn as it uses the pcbnew package provided by KiCAD. The package is in the system paths. Once you close Pinion into venv, the package is not available. pcbnew is a hard dependency. You have to rely on --system-site-packages option of pip

So I wouldn't call it buggy. If you know about better solution for handing KiCAD's pcbnew module vs. virtualenv, please, let me know.

2) There is a new build, but you won't succeed in venv unless using --system-site-packages. See 1) for explanation

3) Fixed in a66e513.