Remove import ocspbuilder from setup.py
mrtndwrd opened this issue · 6 comments
This import creates a problem when running setup.py install:
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 6, in <module>
import ocspbuilder
File ".../ocspbuilder/ocspbuilder/__init__.py", line 10, in <module>
from asn1crypto import x509, keys, core, ocsp
ImportError: No module named asn1crypto
I'd suggest removing it, although you need another way to track your version number. I don't see any special reason why it should be in the module init.py, so you could just move the version string to the setup.py maybe? If you agree, I would be happy to make a pull request as well
Mostly this is just a side effect of following a file layout pattern from some of the other light-weight modules sitting on top of oscrypto and asn1crypto.
It would probably make sense to move the version info into _version.py
, OCSPResponseBuilder
into _response_builder.py
and OCSPRequestBuilder
into _request_builder.py
. If you want to take a pass at that, I’d certainly be amenable.
The two functions at the bottom of __init__.py
have lived in a file named _types.py
in oscrypto and asn1crypto. The only other thing would be _writer()
, which should probably go into something like _decorators.py
.
This restructuring should allow importing just oscrypto._version
into setup.py
, which should resolve the issue you are running into.
I will probably take a whack at this issue here and the other modularcrypto modules at some point, even if you don’t feel like sending a PR.
As of ddb424d, ocspbuilder.version
exists and is used in setup.py
, which should prevent this issue.
I haven't made a new release yet due to a backlog on Travis CI.
This unfortunately does not solve the issue:
mati@dt ~/git/mati/ocspbuilder $ virtualenv -p /usr/bin/python3 .
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in ./bin/python3
Not overwriting existing python script ./bin/python (you must use ./bin/python3)
Installing setuptools, pip...done.
mati@dt ~/git/mati/ocspbuilder $ source bin/activate
(ocspbuilder)mati@dt ~/git/mati/ocspbuilder $ python setup.py install
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from ocspbuilder import version
File "/home/mati/git/mati/ocspbuilder/ocspbuilder/__init__.py", line 10, in <module>
from asn1crypto import x509, keys, core, ocsp
ImportError: No module named 'asn1crypto'
(this is on Python 3.4)
Trying to import ocsp module gives an error:
>>> from cryptography.x509 import ocsp
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'ocsp'
Python version 3.6
@eragonriddle This is not the cryptography project.
Got it, sorry about that