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

Help needed: How to build docs from latest github source ? #959

Open
yosukesan opened this issue Jan 15, 2023 · 0 comments
Open

Help needed: How to build docs from latest github source ? #959

yosukesan opened this issue Jan 15, 2023 · 0 comments

Comments

@yosukesan
Copy link

yosukesan commented Jan 15, 2023

Hi I'm working on #957. Since there was no instruction about building docs, I just followed my OSS dev common sense. Did I do something wrong ? I hit lots indentation errors before adding my man.

Install tools

python -m pip install docs/requirements.txt

My env

I installed tools on requirements.txt and requirements-dev.txt as well.

$ for i in `cat docs/requirements.txt`; do python -m pip list | grep  $i; done
pydata-sphinx-theme           0.12.0
sphinxcontrib.applehelp       1.0.3
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
ipython                       7.20.0
ipython_genutils              0.2.0
matplotlib                    3.3.4

Error log

$ make html
Running Sphinx v6.1.3
WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).
loading intersphinx inventory from https://docs.python.org/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 24 source files that are out of date
updating environment: [new config] 24 added, 0 changed, 0 removed
reading sources... [  4%] cache
reading sources... [  8%] index
reading sources... [ 12%] readers/alphavantage
reading sources... [ 16%] readers/bank-of-canada
reading sources... [ 20%] readers/econdb
reading sources... [ 25%] readers/enigma
reading sources... [ 29%] readers/eurostat
reading sources... [ 33%] readers/famafrench
reading sources... [ 37%] readers/fred
reading sources... [ 41%] readers/iex
reading sources... [ 45%] readers/index
reading sources... [ 50%] readers/moex
reading sources... [ 54%] readers/nasdaq-trader
reading sources... [ 58%] readers/naver
reading sources... [ 62%] readers/oecd
reading sources... [ 66%] readers/quandl
reading sources... [ 70%] readers/stooq
reading sources... [ 75%] readers/tiingo
reading sources... [ 79%] readers/tsp
reading sources... [ 83%] readers/world-bank
reading sources... [ 87%] readers/yahoo
reading sources... [ 91%] remote_data
WARNING: autodoc: failed to import class 'wb.WorldBankReader' from module 'pandas_datareader'; the following exception was raised:
cannot import name 'reduce' from 'pandas_datareader.compat' (/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py)
WARNING: autodoc: failed to import function 'wb.download' from module 'pandas_datareader'; the following exception was raised:
cannot import name 'reduce' from 'pandas_datareader.compat' (/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py)
WARNING: autodoc: failed to import function 'wb.get_countries' from module 'pandas_datareader'; the following exception was raised:
cannot import name 'reduce' from 'pandas_datareader.compat' (/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py)
WARNING: autodoc: failed to import function 'wb.get_indicators' from module 'pandas_datareader'; the following exception was raised:
cannot import name 'reduce' from 'pandas_datareader.compat' (/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py)
WARNING: autodoc: failed to import function 'wb.search' from module 'pandas_datareader'; the following exception was raised:
cannot import name 'reduce' from 'pandas_datareader.compat' (/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py)
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_all_data:26: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:23: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_all_data:31: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:28: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_all_data:34: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_call_data:30: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:27: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_call_data:35: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:32: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_call_data:38: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_forward_data:35: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:32: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_forward_data:40: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:37: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_forward_data:43: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_near_stock_price:38: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:35: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_near_stock_price:43: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.base._BaseReader.close:1: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_near_stock_price:46: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_options_data:30: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:27: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_options_data:35: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:32: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_options_data:38: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_put_data:30: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:27: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_put_data:35: ERROR: Unexpected indentation.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options:32: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/yosuke/.local/lib/python3.9/site-packages/pandas_datareader/yahoo/options.py:docstring of pandas_datareader.yahoo.options.Options.get_put_data:38: ERROR: Unexpected indentation.

Exception occurred:
  File "/usr/lib/python3/dist-packages/IPython/sphinxext/ipython_directive.py", line 570, in process_input
    raise RuntimeError('Non Expected exception in `{}` line {}'.format(filename, lineno))
RuntimeError: Non Expected exception in `/home/yosuke/Data/github/pandas-datareader/docs/source/remote_data.rst` line 659
The full traceback has been saved in /tmp/sphinx-err-3rdz0so3.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!


>>>-------------------------------------------------------------------------
Exception in /home/yosuke/Data/github/pandas-datareader/docs/source/remote_data.rst at block ending on line 659
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
gaierror                                  Traceback (most recent call last)
/usr/lib/python3/dist-packages/urllib3/connection.py in _new_conn(self)
    168         try:
--> 169             conn = connection.create_connection(
    170                 (self._dns_host, self.port), self.timeout, **extra_kw

/usr/lib/python3/dist-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     72 
---> 73     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     74         af, socktype, proto, canonname, sa = res

/usr/lib/python3.9/socket.py in getaddrinfo(host, port, family, type, proto, flags)
    952     addrlist = []
--> 953     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    954         af, socktype, proto, canonname, sa = res

gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
/usr/lib/python3/dist-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    698             # Make the request on the httplib connection object.
--> 699             httplib_response = self._make_request(
    700                 conn,

/usr/lib/python3/dist-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    381         try:
--> 382             self._validate_conn(conn)
    383         except (SocketTimeout, BaseSSLError) as e:

/usr/lib/python3/dist-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
   1011         if not getattr(conn, "sock", None):  # AppEngine might not have  `.sock`
-> 1012             conn.connect()
   1013 

/usr/lib/python3/dist-packages/urllib3/connection.py in connect(self)
    352         # Add certificate verification
--> 353         conn = self._new_conn()
    354         hostname = self.host

/usr/lib/python3/dist-packages/urllib3/connection.py in _new_conn(self)
    180         except SocketError as e:
--> 181             raise NewConnectionError(
    182                 self, "Failed to establish a new connection: %s" % e

NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f7a1d531a00>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
~/.local/lib/python3.9/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    488             if not chunked:
--> 489                 resp = conn.urlopen(
    490                     method=request.method,

/usr/lib/python3/dist-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    754 
--> 755             retries = retries.increment(
    756                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

/usr/lib/python3/dist-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    573         if new_retry.is_exhausted():
--> 574             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    575 

MaxRetryError: HTTPSConnectionPool(host='secure.tsp.gov', port=443): Max retries exceeded with url: /components/CORS/getSharePricesRaw.html?startdate=20151001&enddate=20151231&download=0&Lfunds=1&InvFunds=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7a1d531a00>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-25-0cec987eaa71> in <module>
----> 1 tspreader.read()

~/.local/lib/python3.9/site-packages/pandas_datareader/tsp.py in read(self)
     74     def read(self):
     75         """read one data from specified URL"""
---> 76         df = super(TSPReader, self).read()
     77         df.columns = map(lambda x: x.strip(), df.columns)
     78         df.drop(columns=self.all_symbols - set(self.symbols), inplace=True)

~/.local/lib/python3.9/site-packages/pandas_datareader/base.py in read(self)
     99         """Read data from connector"""
    100         try:
--> 101             return self._read_one_data(self.url, self.params)
    102         finally:
    103             self.close()

~/.local/lib/python3.9/site-packages/pandas_datareader/base.py in _read_one_data(self, url, params)
    106         """read one data from specified URL"""
    107         if self._format == "string":
--> 108             out = self._read_url_as_StringIO(url, params=params)
    109         elif self._format == "json":
    110             out = self._get_response(url, params=params).json()

~/.local/lib/python3.9/site-packages/pandas_datareader/base.py in _read_url_as_StringIO(self, url, params)
    117         Open url (and retry)
    118         """
--> 119         response = self._get_response(url, params=params)
    120         text = self._sanitize_response(response)
    121         out = StringIO()

~/.local/lib/python3.9/site-packages/pandas_datareader/base.py in _get_response(self, url, params, headers)
    153         last_response_text = ""
    154         for _ in range(self.retry_count + 1):
--> 155             response = self.session.get(
    156                 url, params=params, headers=headers, timeout=self.timeout
    157             )

~/.local/lib/python3.9/site-packages/requests/sessions.py in get(self, url, **kwargs)
    598 
    599         kwargs.setdefault("allow_redirects", True)
--> 600         return self.request("GET", url, **kwargs)
    601 
    602     def options(self, url, **kwargs):

~/.local/lib/python3.9/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    585         }
    586         send_kwargs.update(settings)
--> 587         resp = self.send(prep, **send_kwargs)
    588 
    589         return resp

~/.local/lib/python3.9/site-packages/requests/sessions.py in send(self, request, **kwargs)
    699 
    700         # Send the request
--> 701         r = adapter.send(request, **kwargs)
    702 
    703         # Total elapsed time of the request (approximately)

~/.local/lib/python3.9/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    563                 raise SSLError(e, request=request)
    564 
--> 565             raise ConnectionError(e, request=request)
    566 
    567         except ClosedPoolError as e:

ConnectionError: HTTPSConnectionPool(host='secure.tsp.gov', port=443): Max retries exceeded with url: /components/CORS/getSharePricesRaw.html?startdate=20151001&enddate=20151231&download=0&Lfunds=1&InvFunds=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7a1d531a00>: Failed to establish a new connection: [Errno -2] Name or service not known'))
<<<-------------------------------------------------------------------------

make: *** [Makefile:20: html] Error 2
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

1 participant