-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unable to use lmdb during documentation generation #172
Comments
For reference, in the Makefile created by sphinx, replacing |
The above hack doesn't work with readthedocs since they ignore your makefile :( |
Same problem here. @vEpiphyte 's workaround works locally. Is there a way to make it work with readthedocs while a proper solution is implemented? |
@scossu - the project i am working on uses a custom docs generation tool for certain classes. That is invoked by out |
Thanks @vEpiphyte . Any chance that the PR / solution you mention in your issue description be implemented? |
@vEpiphyte Unfortunatly I am unable to discern the code specific to your framework from the code required to make document generation work. I have little experience with Sphinx. Would you be so kind to indicate the minimum setup to bypass the issue? Thanks a lot. |
For the record, this seems to be a relatively portable workaround. Before importing any other modules requiring LMDB in
|
@scossu I haven't spent any time towards tweaking the lmdb behavior. With that, it seems like you would not be able to actually use lmdb in any code that does document generation. is that correct? |
@vEpiphyte I guess so; since this workaround is in the Sphinx config file, only doc generation should be affected. Pytest and such still import lmdb and work normally. |
By the way, you suggest enabling the use of an environment variable to alter the import mechanism; would you be able to control that on readthedocs? |
@scossu mock wouldn't work for me since i actually need to spin up lmdb environments during our autodoc process. its entirely possible the idea i initially had may not work with readthedocs - i had thought of that prior to actually having working solution in place. |
Affected Operating Systems
Affected py-lmdb Version
py-lmdb Installation Method
pip install lmdb
installed into a virtualenv managed by pyenv
Using bundled or distribution-provided LMDB library?
unknown
Distribution name and LMDB library version
Machine "free -m" output
N/A
Other important machine info
N/A
Describe Your Problem
When using a custom script to extend Sphinx documentation generation, I am unable to use lmdb during that process.
Errors/exceptions Encountered
Describe What You Expected To Happen
I would have expected to be able to use the lmdb module during documentation generation.
Describe What Happened Instead
Unable to use lmdb during document generation.
User Diagnosis
During import,
__intit__.py
falls back to using the cffi lmdb implementation due to the_reading_docs()
function. Later, in cffi.py, that is checked again and used to derming if the cffi binding is actually done. If we are being executed by pydoc or sphinx-build, the user cannot use lmdb.Proposed Solution
There is currently a check for
LMDB_FORCE_CPYTHON
as a environmental variable but that doesn't seem to allow us to use that to force trying to load the cpython bound libraries. Allowing the user to provide that envar and using it to force the cpython bound libraries to be used during documentation generation would allow the use of the library someone using sphinx. If that is acceptable, I'd be happy to put together a PR which supports that.Related Issues
This appears related to #15
The text was updated successfully, but these errors were encountered: