archlinuxcn / lilac

Lilac is the build bot for archlinuxcn
GNU General Public License v3.0
114 stars 40 forks source link

Does not run when python-pygitgub is installed #183

Closed yan12125 closed 2 years ago

yan12125 commented 2 years ago

When python-pygithub is installed, lilac crashes at startup:

Traceback (most recent call last):
  File "/usr/bin/lilac", line 52, in <module>
    from lilac2.repo import Repo
  File "/usr/lib/python3.10/site-packages/lilac2/repo.py", line 14, in <module>
    from github import GitHub
ImportError: cannot import name 'GitHub' from 'github' (/usr/lib/python3.10/site-packages/github/__init__.py)

I got this issue from the lilac-git package, and I believe in-tree lilac is also affected.

A simple fix may be using sys.path.insert instead of sys.path.append in lilac. A better fix may be moving vendored stuffs into a winterpy namespace (ex: from winterpy.github import GitHub).

lilydjwg commented 2 years ago

I moved the path to the front. It's too late to move them into a namespace without dissassociating with winterpy.

yan12125 commented 2 years ago

Thanks! It's fine as long as it works :)