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

Specify requirements for Read the Docs #373

Merged
merged 5 commits into from
Aug 28, 2023

Conversation

MikhailRyazanov
Copy link
Collaborator

I've got an email from Read the Docs that they'll soon deprecate the “use system packages” feature, which for us means that matplotlib will not be available preinstalled, so we need to install it explicitly. This also applies to numpy and scipy, but these are already listed as dependencies for pyabel itself and hopefully will be installed as needed...

@MikhailRyazanov
Copy link
Collaborator Author

Hm, it apparently uses abel without installing it, so we'll need to preinstall all the dependencies manually...

@MikhailRyazanov
Copy link
Collaborator Author

OK, now it seems to work fine.

Some questions:

  1. Maybe we should remove the following part, as it seemed to be unnecessary even before and now in fact contradicts the reality?

    PyAbel/doc/conf.py

    Lines 30 to 47 in f014675

    # Scipy and Numpy packages cannot be installed in on readthedocs.io
    # https://read-the-docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
    if six.PY3:
    from unittest.mock import MagicMock
    else:
    from mock import Mock as MagicMock
    class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
    return Mock()
    # MOCK_MODULES = ['numpy', 'scipy', 'scipy.special', 'numpy.linalg',
    # 'scipy.ndimage', 'scipy.ndimage', 'scipy.linalg',
    # 'scipy.integrate', 'scipy.optimize']
    MOCK_MODULES = []
    sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
  2. This also looks unnecessary, since we have no .md files anywhere:

    PyAbel/doc/conf.py

    Lines 49 to 51 in f014675

    source_parsers = {
    '.md': CommonMarkParser,
    }
  3. Why Travis tests weren't executed for this PR? Something got broken silently without our intervention? Or they are just delayed for some reason?

Copy link
Collaborator

@stggh stggh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikhailRyazanov thanks for actioning this (*). IMO it is time to dump support for python2.

I don't know the purpose of Mock, but support its removal item 1, along with CommonMarkParser, item 2.

(*) In this vein MyST-parser appears to be a recommended replacement for recommonmark ;-)

@MikhailRyazanov
Copy link
Collaborator Author

MikhailRyazanov commented Aug 17, 2023

@stggh, thanks for noticing recommonmark. We actually don't use it, so I've removed its import altogether and tested that after uninstalling recommonmark everything still builds fine.
My local build also revealed that newer versions of Matplotlib broke one figure, so I've updated it as well.

Regarding Python 2 support, I also think that we should drop it eventually, but on the other hand, doing this for no practical reason might be not very nice, if anybody still needs it for some historical reasons (like using PyAbel on an old experimental setup that cannot be updated due to expensive/irreplaceable hardware)...

@MikhailRyazanov MikhailRyazanov merged commit 68c2a5b into PyAbel:master Aug 28, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants