unbit / foohid-py

Python wrapper for the foohid OSX driver
MIT License
18 stars 6 forks source link

Library install using pip results in error #11

Open rphulwani opened 2 years ago

rphulwani commented 2 years ago

`Collecting foohid Using cached foohid-0.1.tar.gz (1.9 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for foohid, since package 'wheel' is not installed. Installing collected packages: foohid Running setup.py install for foohid ... error error: subprocess-exited-with-error

× Running setup.py install for foohid did not run successfully. │ exit code: 1 ╰─> [37 lines of output] running install /Users/macdaddy/Documents/Code/..../lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_ext building 'foohid' extension creating build creating build/temp.macosx-12-arm64-cpython-310 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/macdaddy/Documents/Code/.../include -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c foohid.c -o build/temp.macosx-12-arm64-cpython-310/foohid.o foohid.c:14:51: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] kern_return_t ret = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching(FOOHID_SERVICE), &iterator); ^~~~~~~~ kIOMainPortDefault /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here const mach_port_t kIOMasterPortDefault ^ foohid.c:183:29: error: implicit declaration of function 'PyString_FromString' is invalid in C99 [-Werror,-Wimplicit-function-declaration] PyTuple_SetItem(ret, i, PyString_FromString(ptr)); ^ foohid.c:183:29: note: did you mean 'PyLong_FromString'? /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/longobject.h:103:24: note: 'PyLong_FromString' declared here PyAPI_FUNC(PyObject ) PyLong_FromString(const char , char *, int); ^ foohid.c:183:29: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'PyObject ' (aka 'struct _object ') [-Wint-conversion] PyTuple_SetItem(ret, i, PyString_FromString(ptr)); ^~~~~~~~ /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/tupleobject.h:33:67: note: passing argument to parameter here PyAPI_FUNC(int) PyTuple_SetItem(PyObject , Py_ssize_t, PyObject *); ^ foohid.c:211:2: error: implicit declaration of function 'Py_InitModule' is invalid in C99 [-Werror,-Wimplicit-function-declaration] Py_InitModule("foohid", foohidMethods); ^ foohid.c:212:1: warning: non-void function does not return a value [-Wreturn-type] } ^ 3 warnings and 2 errors generated. error: command '/usr/bin/clang' failed with exit code 1 [end of output]

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

× Encountered error while trying to install package. ╰─> foohid

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.`

I tried installing the library using pip and this was the output.