LUCIT-Systems-and-Development / unicorn-binance-local-depth-cache

A Python SDK by LUCIT for accessing and managing multiple local Binance order books with Python in a simple, fast, flexible, robust and fully featured way.
https://unicorn-binance-local-depth-cache.docs.lucit.tech/
Other
36 stars 10 forks source link

File conflict during installation #19

Closed kewlfft closed 2 years ago

kewlfft commented 2 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Operating System? (include version)

Exact Python Version?

3.10.2

Pip Version?

21

Description of your issue

When I install the package it seems it has some duplicate files with unicorn-binance-websocket-api, because of the duplicates files it fails to install. Because unicorn-binance-websocket-apiis a requirement for unicorn-binance-local-depth-cacheyou don't need to include duplicates of files already needed.

python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/__init__.py exists in filesystem (owned by python-unicorn-binance-websocket-api)
python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/__pycache__/__init__.cpython-310.opt-1.pyc exists in filesystem (owned by python-unicorn-binance-websocket-api)
python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/__pycache__/__init__.cpython-310.pyc exists in filesystem (owned by python-unicorn-binance-websocket-api)
python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/__pycache__/get_used_module_version.cpython-310.opt-1.pyc exists in filesystem (owned by python-unicorn-binance-websocket-api)
python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/__pycache__/get_used_module_version.cpython-310.pyc exists in filesystem (owned by python-unicorn-binance-websocket-api)
python-unicorn-binance-local-depth-cache: /usr/lib/python3.10/site-packages/tools/get_used_module_version.py exists in filesystem (owned by python-unicorn-binance-websocket-api)
Errors occurred, no packages were upgraded.
oliver-zehentleitner commented 2 years ago

how are you doing the installation?

kewlfft commented 2 years ago

I have created the package for Arch Linux and install with pacman, this is the standard installation for Arch Linux and it detects a file conflict. I can install overwriting the conflict, however I think there is an unexpected file conflict in the original distribution, otherwise this should not happen. init and _get_used_moduleversion is already installed with unicorn-binance-websocket-api.

oliver-zehentleitner commented 2 years ago

ok, i think i understand the reason.

the package you build this lib contains files like: exceptions.py init.py
manager.py
pycache

but i guess it must look like: unicorn_binance_local_depth_cache/exceptions.py unicorn_binance_local_depth_cache/init.py
unicorn_binance_local_depth_cache/manager.py
unicorn_binance_local_depth_cache/pycache

oliver-zehentleitner commented 2 years ago

why do you not use pip?

kewlfft commented 2 years ago

Arch Linux uses pacman instead of pip. It is the 2 files in /tools: __init__ and get_used_module_version only that are clashing. They are in /tools for both libraries. I agree with you for the other files, they are in unicorn_binance_local_depth_cache/ and are not clashing.

oliver-zehentleitner commented 2 years ago

no. arch uses pacman instead of yum, apt, emerge, etc, but pip is an python internal package manager like nodes npm wich exists on every linux and unix plattform, even on windows :) https://github.com/LUCIT-Systems-and-Development/unicorn-binance-local-depth-cache/wiki/Installation

Just install pip and use it, will make life more easy :) https://www.archlinux.de/packages/extra/x86_64/python-pip

oliver-zehentleitner commented 2 years ago

actually packages should be isolated from each other, the package you build must have a mistake ....

kewlfft commented 2 years ago

I am an Arch Linux maintainer and we package all the python libs, we don't rely on pip. In both source tarballs the tools directory is at the same level, it installs in /usr/lib/python3.10/site-packages/tools and one package being a requirement for the other one it will necessarily clash. I don't know if you could name differently or move it as a sub-directory of ubldc. I suppose pip does the same pacman does but just overwrites silently the file. Here is the ArchLinux package which will give you access to the Arch Linux + derivatives (Manjaro...) communities: https://aur.archlinux.org/packages/python-unicorn-binance-local-depth-cache

oliver-zehentleitner commented 2 years ago

i think the folder tools should be the package name /lib/python3.9/site-packages/unicorn_binance_local_depth_cache/manager.py

thats how it looks like in debian after installation with pip and its working then

kewlfft commented 2 years ago

yes this file is fine, it installs in the package name directory. I am referring to /tools/get_used_module_version.py and /tools/__init__.py these are the only 2 files that are causing conflict.

oliver-zehentleitner commented 2 years ago

init.py is usualy an empty file and can get replaced.

i dont know what is get_used_module_version.py

oliver-zehentleitner commented 2 years ago

i cant really help you with this issue. maybe you can find some hints in the arch community.

if you have specific questions i can help you if i know it.

please close this issue as soon as you found your answers! thanks

kewlfft commented 2 years ago

Tools/get_used_module_version.py is a file in your repo and it is the one causing an issue. If you don't need it you can delete this tools directory from the source and the problem is solved. I'm also a developer and I know that these people who have irrelevant issues I don't have are a pain but in this case I think it's justified this file should not be located there in the source tarball.

oliver-zehentleitner commented 2 years ago

ah, its that :D

actually i want to create one file like that and collect all versions of all unicorn binance suite packages and store this file in the unicorn binance suite repo. (a task of the next two weeks)

but this files are not important for the package. are you not able to filter them out?

kewlfft commented 2 years ago

yes I can delete these files from the installation for the moment, if you can find a solution upstream to avoid the duplicates that would be great as well. This can be closed.

oliver-zehentleitner commented 2 years ago

the file get_used_module_version.py will soon be removed from all repos except unicorn-binance-suite. (websocket and depthcache is ready now, unifornfy and rest is missing)

but there will be other new files with same name. but they are never important to run the libs.

i think it can not be up to the lib authors to not use same filenames with other libs. if this is a problem, the packaging is doing something wrong...

I close this.

kewlfft commented 2 years ago

Thanks for these explanations. You can of course have files with the same name / same location and different contents in your libs. Then these files will overwrite each other when more than 1 of your libs is installed: this triggers the warning by pacman, pip may overwrite silently the files. I am now removing these files in the packaging. From my experience with dozens of python libs, this is quite uncommon that libs that can be installed together contain the same file name at the same location with a different content (location outside the private lib directory).

oliver-zehentleitner commented 2 years ago

We now provide source files and wheels on pypi: https://pypi.org/project/unicorn-binance-websocket-api/#files

the source files are cleaned and should not contain anything else then the lib.

Maybe you can use that in the arch packaging... best regards.

kewlfft commented 2 years ago

yes this is much cleaner, I've updated the package, are all your binance libs in pypi now? I will update the 3 other packages in this case.

oliver-zehentleitner commented 2 years ago

all latest versions are clean, sdist and wheel!