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

Refactor plan #878

Open
2 of 7 tasks
kigawas opened this issue Oct 4, 2020 · 8 comments
Open
2 of 7 tasks

Refactor plan #878

kigawas opened this issue Oct 4, 2020 · 8 comments
Assignees

Comments

@kigawas
Copy link
Collaborator

kigawas commented Oct 4, 2020

  • 1. 移除Python 2.7支持。最小支持版本Python 3.6
  • 2. 移除setup.py,采用pyproject.toml和poetry
  • 3. 重构API(考虑AsyncIO系)
  • 4. 重构CLI UI,或可尝试click
  • 5. 重构Qt UI(dbus)
  • 6. 重构配置文件管理(Sqlite?)
  • 7. 重构mpg123相关
@kigawas
Copy link
Collaborator Author

kigawas commented Oct 4, 2020

添加API相关测试和CI,考虑travis

@kigawas kigawas mentioned this issue Oct 4, 2020
@kigawas kigawas pinned this issue Oct 4, 2020
@planktonzp
Copy link

poetry install failed
本地环境: Archlinux
Python版本: 3.8.6
报错信息

Using virtualenv: /home/roy/.cache/pypoetry/virtualenvs/netease-musicbox-kz4RPZOX-py3.8
Building NetEase-MusicBox (0.3.0)
 - Building sdist
 - Adding: NEMbox/__init__.py
 - Adding: NEMbox/__main__.py
 - Adding: NEMbox/api.py
 - Adding: NEMbox/cache.py
 - Adding: NEMbox/cmd_parser.py
 - Adding: NEMbox/config.py
 - Adding: NEMbox/const.py
 - Adding: NEMbox/encrypt.py
 - Adding: NEMbox/kill_thread.py
 - Adding: NEMbox/logger.py
 - Adding: NEMbox/menu.py
 - Adding: NEMbox/osdlyrics.py
 - Adding: NEMbox/osdlyrics.py.orig
 - Adding: NEMbox/osdlyrics.py.rej
 - Adding: NEMbox/player.py
 - Adding: NEMbox/scrollstring.py
 - Adding: NEMbox/singleton.py
 - Adding: NEMbox/storage.py
 - Adding: NEMbox/ui.py
 - Adding: NEMbox/utils.py
 - Adding: pyproject.toml
 - Adding: LICENSE
 - Adding: README.md
 - Built NetEase-MusicBox-0.3.0.tar.gz

 - Building wheel
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/__init__.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/__main__.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/api.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/cache.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/cmd_parser.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/config.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/const.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/encrypt.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/kill_thread.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/logger.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/menu.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/osdlyrics.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/osdlyrics.py.orig
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/osdlyrics.py.rej
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/player.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/scrollstring.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/singleton.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/storage.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/ui.py
 - Adding: /tmp/tmpoiz2b58j/NetEase-MusicBox-0.3.0/NEMbox/utils.py
 - Built NetEase_MusicBox-0.3.0-py3-none-any.whl
❯ poetry install -vvv
Using virtualenv: /home/roy/.cache/pypoetry/virtualenvs/netease-musicbox-kz4RPZOX-py3.8
The lock file might not be compatible with the current version of Poetry.
Upgrade Poetry to ensure the lock file is read properly or, alternatively, regenerate the lock file with the `poetry lock` command.
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

[SolverProblemError]
The current project's Python requirement (3.8.6) is not compatible with some of the required packages Python requirement:
  - dataclasses requires Python >=3.6, <3.7

Because dataclasses (0.7) requires Python >=3.6, <3.7
 and no versions of dataclasses match >=0.6,<0.7 || >0.7, dataclasses is forbidden.
So, because netease-musicbox depends on black (20.8b1) which depends on dataclasses (>=0.6), version solving failed.

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/usr/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/usr/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/usr/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/usr/lib/python3.8/site-packages/poetry/console/commands/install.py", line 69, in handle
    return_code = installer.run()
  File "/usr/lib/python3.8/site-packages/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/usr/lib/python3.8/site-packages/poetry/installation/installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "/usr/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/usr/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 190, in _solve
    raise SolverProblemError(e)

似乎是因为我本地的python太高?
还是改版后还没来得及做版本兼容测试?
期待新的版本

@kigawas
Copy link
Collaborator Author

kigawas commented Oct 10, 2020

稍微改一下dev就行了

#882

@kigawas
Copy link
Collaborator Author

kigawas commented Oct 10, 2020

不过github actions的3.8+没问题 🤔

@planktonzp
Copy link

build和install都ok 但是poetry打包后检查版本时会向上层目录查找pyproject.toml文件, archlinux系统中如果想要安装到系统路径而不是pyvenv中的话, 需要在__main__.py里增加if判断来避开默认的get_current_version函数,否则会因为安装路径上层没有pyproject.toml文件导致启动失败 还在测试 不过新的打包和安装方式确实要比以前舒服很多了

@kigawas
Copy link
Collaborator Author

kigawas commented Oct 11, 2020

改成了用importlib-metadata读

#884

@nnnewb
Copy link
Contributor

nnnewb commented Jan 5, 2021

第 7 条是考虑把 mpg123 换成 libmad 或者 gstreamer 之类的吗?

@kigawas
Copy link
Collaborator Author

kigawas commented Jan 18, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants