AzurLaneAutoScript icon indicating copy to clipboard operation
AzurLaneAutoScript copied to clipboard

Opt: Solving dependency conflict

Open 18870 opened this issue 2 years ago • 4 comments

Changes

Remove

  • cnocr
  • mxnet

Replace mxnet with mxnet-alas,which is compatible to mxnet==1.9.1 cnocr has been integrated directly into module.cnocr

Loosen

  • numpy
    • Replace np.int with int in codes
  • scipy
  • starlette
  • anyio
  • uvicorn
  • zerorpc
  • pyzmq
  • av
  • wrapt

As pip<20 cannot resolve the abi3 wheel name format, these packages will be restricted to the last available version that can be resolved by pip19. Note that the latest version also pass the test.

  • opencv-python<4.5.5
  • psutil<5.9.4
  • watchfiles<0.15
    • from uvicorn

Untested

  • [ ] adbutils==0.11.0 -> 1.2.7
  • [ ] uiautomator2==2.16.17 -> 2.16.22

bug exists / No need to change

  • rich==11.2.0
    • #1463
    • #1465
  • pypresence==4.2.1
  • alas-webapp==0.3.7

What's new

ALAS no longer dependent on python 3.7, you can use up to python 3.11 now. See also here

How to compile requirements.txt

Upgrade pip, install pip-tools, run pip-compile --annotation-style=line --index-url=https://pypi.org/simple --no-emit-index-url --output-file=requirements.txt --resolver=backtracking requirements-in.txt

TODO

help plz

Test run on

  • [ ] Linux / Docker
  • [ ] MacOS
  • [ ] AidLux / ARM

  • [ ] Migrate to Python 3.10 or 3.11 You can download windows easy installer for python 3.11 here

18870 avatar Mar 05 '23 13:03 18870

Test passed on WSL(Ubuntu), python==3.10.0. If using python 3.11, then No matching distribution for numpy==1.21.2, and compile fails.

wsl_ubuntu_py310_output.txt wsl_ubuntu_py311_error_log.txt

guoh064 avatar Apr 01 '23 16:04 guoh064

Considering introducing a more modern package management tool? Like pdm or poetry

shoucandanghehe avatar Jun 10 '23 13:06 shoucandanghehe

Considering introducing a more modern package management tool? Like pdm or poetry

This is not a package management problem, the conflict is caused by the official Windows wheel of mxnet, which limits the version of requests, etc, then prevents us from upgrading other packages and python version.

18870 avatar Jun 10 '23 13:06 18870

This is not a package management problem

I know, it's just that I think they could improve the development experience a bit. It would also make it easier to specify different dependencies for different python versions. So I made this suggestion

shoucandanghehe avatar Jun 10 '23 13:06 shoucandanghehe