lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.44k stars 336 forks source link

Documentation is Broken #576

Closed itsthejoker closed 5 years ago

itsthejoker commented 5 years ago

Bug report

What's wrong

The method / class documentation for Mimesis is broken. https://mimesis.readthedocs.io/api.html#internet

How is that should be

If I load the above link, I should see information about the class and how to use it.

System information

Any and all, tested on multiple computers. Issue has been occurring for students since about 3pm EST yesterday or so.

lk-geimfari commented 5 years ago

Seems like latest commit does don't fix this issue.

ghost commented 5 years ago

It's still broken guys!

lk-geimfari commented 5 years ago

@harshilsharma63 @itsthejoker I'm really busy if someone of you, guys can create PR I'll really thankful.

ghost commented 5 years ago

@lk-geimfari I'll spend some time today and see if I can figure this out.

ghost commented 5 years ago

@lk-geimfari so I generated docs locally against master and they look just fine! Might a re-deployment do the trick?

lk-geimfari commented 5 years ago

@harshilsharma63 I have rebuild docs and it did not have any effect.

ghost commented 5 years ago

@lk-geimfari is is broken for you locally as well?

lk-geimfari commented 5 years ago

@harshilsharma63 Nope, locally works pretty fine.

lk-geimfari commented 5 years ago

@sobolevn Any idea why it can happen?

sobolevn commented 5 years ago

This happens because readthedocs uses python3.5 by default. And we use python3.6 features:

WARNING: autodoc: failed to import class 'builtins.BrazilSpecProvider' from module 'mimesis'; the following exception was raised:
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/mimesis/envs/latest/lib/python3.5/site-packages/sphinx/ext/autodoc/importer.py", line 154, in import_module
    __import__(modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/mimesis/checkouts/latest/mimesis/__init__.py", line 8, in <module>
    from mimesis.providers import *
  File "/home/docs/checkouts/readthedocs.org/user_builds/mimesis/checkouts/latest/mimesis/providers/__init__.py", line 3, in <module>
    from mimesis.providers.base import BaseProvider, BaseDataProvider
  File "/home/docs/checkouts/readthedocs.org/user_builds/mimesis/checkouts/latest/mimesis/providers/base.py", line 77
    self._data: dict
              ^
SyntaxError: invalid syntax

I see two things to improve here:

  1. create readthedocs.yml and specify correct python version
  2. fix type annotation: dict is not a correct type annotation. Because what really written is: Dict[Any, Any], I know that we can limit this to something better
sobolevn commented 5 years ago

.readthedocs.yml file example: https://github.com/wemake-services/wemake-python-styleguide/blob/master/.readthedocs.yml

lk-geimfari commented 5 years ago

@sobolevn I didn't even think about it. Thanks!

lk-geimfari commented 5 years ago

@itsthejoker @harshilsharma63 It's fixed.