tgarc / pastream

Some utilities that build on python-sounddevice
MIT License
5 stars 0 forks source link

Creating documentation is easy? #3

Open chmedly opened 6 years ago

chmedly commented 6 years ago

Since I'm working only in python3, I had to jump through some hoops to try to get sphinx installed in 2.7 and then got this when I tried to make.

Extension error:
Could not import extension sphinxarg.ext (exception: No module named sphinxarg.ext)

Would love to work with your module though I'm not sure I want to decode it without docs, yet ;)
Any idea what the problem is?

tgarc commented 6 years ago

Hey chmedly, sorry for your trouble those items are due to me being lazy :p you can install the dependencies for documentation like so:

$ pip install pastream[docs]

But to get it working with python3 again I had to make a fix; would you mind seeing if #4 works for you? You can just do:

$ git clone https://github.com/tgarc/pastream
$ cd pastream
$ git checkout rm-rst2pdf-dep
$ pip install .[docs]
chmedly commented 6 years ago

I'm on mac which is probably obvious from this error...

    build/temp.macosx-10.6-intel-3.6/_py_pastream.c:483:10: fatal error: 'pa_ringbuffer.h' file not found
    #include <pa_ringbuffer.h>
             ^~~~~~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
chmedly commented 6 years ago

btw, the command I used for the final line was:

pip3 install .[docs]

tgarc commented 6 years ago

Ah, I omitted a detail...running pip install .[docs] will build pastream from source if it's not already installed; this requires an extra step as mentioned in the README here and you must have libffi installed. It may be simpler to do a $ pip install pastream to install the precompiled pastream library instead.

Here are the amended steps:

$ git clone https://github.com/tgarc/pastream
$ cd pastream
$ git checkout rm-rst2pdf-dep
$ pip install pastream  # <-- install pastream from pip first
$ pip install .[docs]
$ cd docs
$ make html
chmedly commented 6 years ago
$ git checkout rm-rst2pdf-dep
error: pathspec 'rm-rst2pdf-dep' did not match any file(s) known to git

Whereas during the previous attempt, I got this..

$ git checkout rm-rst2pdf-dep
Branch rm-rst2pdf-dep set up to track remote branch rm-rst2pdf-dep from origin.
Switched to a new branch 'rm-rst2pdf-dep'

Kamikaze undeterred, I decided to try the make anyway. But I got the same error as before:

Extension error:
Could not import extension sphinxarg.ext (exception: No module named sphinxarg.ext)
make: *** [html] Error 1
tgarc commented 6 years ago

That's odd you got that git error...maybe you're trying to checkout that branch from another local clone you have? Try doing a git fetch again before doing git checkout.

As for the extension error, that's a missing dependency; did you run pip install .[docs] again after doing pip install pastream?

Sorry for all the trouble you've run into..I'm working on a way get the documentation hosted so you can just view it online

tgarc commented 6 years ago

@chmedly I've uploaded documentation here:

http://pastream.readthedocs.io/en/latest/

chmedly commented 6 years ago

That's odd you got that git error...maybe you're trying to checkout that branch from another local clone you have? Try doing a git fetch again before doing git checkout.

As for the extension error, that's a missing dependency; did you run pip install .[docs] again after doing pip install pastream?

I emptied the directory and ran the clone fresh so I don't think that's the case. I followed the order that you listed so yes, I installed pastream and then the .[docs]. I'm about to try it again on another machine. I'll report back.

tgarc commented 6 years ago

@chmedly If you still want to build the documentation yourself I recommend trying it from the the master branch. I've removed that pastream dependency (and the cffi dependency)..Simply checkout the master branch and install requirements using:

$ pip install -r docs/requirements.txt

Then do the make html as previously mentioned. This should be much less troublesome than before.