readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.06k stars 3.59k forks source link

Mamba related install issues #11435

Open OriolAbril opened 5 months ago

OriolAbril commented 5 months ago

Details

Expected Result

Only one version of pymc is installed, the 0+untagged.50.g09fd0d7.dirty (which is what gets installed with pip install .).

Actual Result

Somehow there are two versions of PyMC installed: 0+untagged.50.g09fd0d7.dirty and 5.15.1. The first seems to be preferred but the notebooks use the 2nd even though we are enforcing the kernel being used. Even more puzzling is both seem to point to the same source yet their contents are clearly different. Any hints to what might be happening or other places to open the issue will be very welcome. Some links I think illustrate the situation:

humitos commented 5 months ago

(from the phone 📱)

Note that you are installing it twice: one on the Conda YAML file and another one in the Red the Docs YAML file (via python.install)

You should remove one of them.

OriolAbril commented 5 months ago

pymc is not in the conda yaml file, only its dependencies. And you can see in the logs that it isn't in the library being installed by the mamba env create, it only appears in the mamba list I added as part of the post_install step, as it has been installed with pip install .

There is a pymc-sphinx-theme because we maintain multiple packages in addition to pymc that extend it so all common configuration we do of pydata-sphinx-theme is centralized there

humitos commented 5 months ago

pymc is not in the conda yaml file, only its dependencies.

Oh, yeah, I got confused with the last line of the YAML file that says: name: pymc-docs --but that's the name of the Mamba environment.

Somehow there are two versions of PyMC installed: 0+untagged.50.g09fd0d7.dirty and 5.15.1

Where do you see there are two version installed? I'm not finding that in the Read the Docs logs.

OriolAbril commented 5 months ago

That is part of the issue, I don't see it in the logs, but some of the pages that execute code while generating the website do use this version as can be seen from https://pymcio--7385.org.readthedocs.build/projects/docs/en/7385/learn/core_notebooks/pymc_overview.html. I have no idea where that code is coming from. The version is wrong, if you inspect the signature of a function we modified recently it has the old signature (consistent with the version at least).

The output of that code snippet should be the one we do get in that other page (bottom of the page): https://pymcio--7385.org.readthedocs.build/projects/docs/en/7385/learn.html

humitos commented 5 months ago

I don't have knowledge of the intervals of this package, but if I would have to debug this, I'd start by tracking down how the version is generated by this line:

__version__ = _version.get_versions()["version"]

I suppose the package version differs from how that value is generated and that's why the mismatch.

With that information, we will know if this is a problem on Read the Docs environment of the package itself.

OriolAbril commented 5 months ago

I don't think that is relevant here because the version is one of many things that are wrong. If there was an issue with that function, the version would be different, but the source would be the same. Somehow, there is a definition of sample_prior_predictive(samples,...) and another of sample_prior_predictive(draws,...), and what is worse is both seem to be on the same file.

I also added a comment to the __init__.py file to make sure there was noting strange in the git checkout process, and again the same. Printing the source dinamically with the inspect library shows the comment in one case but not in the other.

I will add a new commit to the debut PR hardcoding the version. And what I expect to happen is the page where the "right" version shows up will continue to show the "right" (now hardcoded) version whereas the other will show the same version, also showing __version__ = _version.get_versions()["version"] in the source when using inspect. I don't see any behavioural difference with the comment on __init__.py on this.

OriolAbril commented 5 months ago

As the new commit will change the preview of the PR I have linked above, I'll also add screenshots here to keep the "history".

PR docs preview with commit 09fd0d7 `learn.html` page: ![imatge](https://github.com/readthedocs/readthedocs.org/assets/23738400/107bd1a8-68ac-4781-87d0-f70f23a4341c) `pymc_overview.html` page: ![imatge](https://github.com/readthedocs/readthedocs.org/assets/23738400/3a13007a-99ee-4e3a-a9c4-518671a5bb0c)
OriolAbril commented 5 months ago

I have had time to check the preview, and what I expected is what happened: