rbit / pydtls

Datagram Transport Layer Security for Python
Apache License 2.0
72 stars 45 forks source link

Building from PyPi source fails #21

Closed therealprof closed 6 years ago

therealprof commented 6 years ago

Since I cannot get pydtls to work from the provided binary (due to the inability to dlopen libcrypto) I tried the --no-binary option, which is facing two problems:

  1. It uses version 1.2.0 instead of 1.2.3
  2. It tries to read README.md which doesn't exist (and it seems that the code has changed since 1.2.0)

Collecting dtls (from -r src/assets/requirements.txt (line 26)) Downloading Dtls-1.2.0.tar.gz (79kB) 100% |████████████████████████████████| 81kB 2.3MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/8f/ch8vbtq93ldfc4vksdp5cw540000gn/T/pip-build-lHgm4v/dtls/setup.py", line 53, in long_description = open("README.md").read() IOError: [Errno 2] No such file or directory: 'README.md'

rbit commented 6 years ago

You may want to look at #5.

I think that right now the mac can run OK as a client, but not a server. No one has done an actual port.

On the mac, there'd be no binary: these are for Windows only, where a reasonable pre-built OpenSSL is not available.

Unless you'd like to do a port, your only option on the mac right now is running under something like Docker.

therealprof commented 6 years ago

It should work just fine. It just doesn't build, probably because for some reason I get an outdated version from PyPi.

therealprof commented 6 years ago

As suspected I can confirm that this problem is completely unrelated to macOS and also applies to Linux (Debian Stretch) when building from source:

$ pip3 install Dtls Collecting Dtls Using cached Dtls-1.2.0.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-a25o9k86/Dtls/setup.py", line 53, in long_description = open("README.md").read() FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-a25o9k86/Dtls/

When trying to get the python 2 version it'll use a newer binary version (1.2.3 vs 1.2.0):

$ pip install Dtls Collecting Dtls Downloading Dtls-1.2.3-py2-none-any.whl (103kB) 100% |################################| 112kB 2.9MB/s Installing collected packages: Dtls Successfully installed Dtls-1.2.3

My suspicion is that someone forgot to update the source package on PyPi...

rbit commented 6 years ago

There is no Python 3 version of PyDTLS. It is compatible with Python 2 only. See for example #11.

therealprof commented 6 years ago

I know... That was just to show that the source package is not up to date and broken.

rbit commented 6 years ago

You could argue that the source package is broken; but it is intended this way. See #17 and #16. This is how PyDTLS supports running from source - no need to build. Changing things to ensure that running setup.py works in addition to pip install Dtls or git cloning on a supported platform probably wouldn't improve users' workflows.

therealprof commented 6 years ago

I give up. Maybe one day you'll realise that I'm trying to do the suggested pip install Dtls which doesn't work for architectures and/or python versions for which there's no binary package because of the mentioned reasons! At least do yourself a favour and pull the outdated source package.