Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove import ocspbuilder from setup.py #8

Open
mrtndwrd opened this issue Jan 19, 2017 · 6 comments
Open

Remove import ocspbuilder from setup.py #8

mrtndwrd opened this issue Jan 19, 2017 · 6 comments

Comments

@mrtndwrd
Copy link

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

@wbond
Copy link
Owner

wbond commented Jan 19, 2017

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.

@wbond
Copy link
Owner

wbond commented Jan 24, 2017

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.

@mathiasertl
Copy link

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)

@infotechexplorer
Copy link

infotechexplorer commented Nov 5, 2018

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

@wbond
Copy link
Owner

wbond commented Nov 5, 2018

@eragonriddle This is not the cryptography project.

@infotechexplorer
Copy link

Got it, sorry about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants