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

Version number doesn't change #60

Open
CukMonsta opened this issue Mar 8, 2019 · 3 comments
Open

Version number doesn't change #60

CukMonsta opened this issue Mar 8, 2019 · 3 comments

Comments

@CukMonsta
Copy link

CukMonsta commented Mar 8, 2019

I used the fork of @leokoppel to generate the documentation, when I had installed that version of Sphinxcontrib-versioning I ran the following command:
sphinx-versioning build docs/source/ docs/build/html

When I got the documentation, I opened it in my browser, everything was good, but when I tried to change between versions I saw the version numbers didn't change, the rest was fine.

With version numbers I mean that we use the |version| Sphinx replacement, and apparently it is always using the current/latest version instead of the actual version that is supposed to be used.

Follow the next steps to reproduce it:

git clone https://github.com/opensistemas-hub/osbrain.git
cd osbrain
python3.6 -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
pip install git+https://github.com/leokoppel/sphinxcontrib-versioning.git
sphinx-versioning build docs/source/ docs/build/html

Open the documentation in your browser and try to change between versions.

Somebody knows why the numbers don't change?

@CukMonsta CukMonsta changed the title Version numbers doesn't change Version number doesn't change Mar 8, 2019
@sehnem
Copy link

sehnem commented Mar 8, 2019

Hi,

I'm having the same problem, but I think i know of what causes it.

In the steps to reproduce the problem you install the package, then you generate the documentation. Look how you pick the version for the documentation in your conf.py:

import osbrain

release = osbrain.__version__

This way you will always pick the version of the installed version.

In the conf.py from this package the version is picked from the setup file.

release = version = __import__('setup').VERSION

I think that changing it will solve the problem for you.

In my case I am using automatic versioning, so the versions are generated after the creation of the tag and I'm not able to take this approach. If someone knows what could I do, the package is https://gitlab.com/sehnem/pynmet.

@Peque
Copy link
Member

Peque commented Mar 8, 2019

@sehnem Thanks for your answer.

If I understood sphinxcontrib-versioning's behavior correctly, then it would not install the package version for which it is generating the documentation? In example: when it switches from 2.0.0 to 1.0.0 to generate the old docs, it would not actually install version 1.0.0 of the package before doing so?

If so, then I think it is a risky approach and could be worse than just having a non-expected value in the |version| number.

For example, a project that executes Python code that uses the package within the documentation. Imagine Matplotlib's documentation, where the output figures are auto-generated from the docs: if the correct version of Matplotlib is not installed before generating the docs then the output could be different, wrong or generation could even fail.

@sehnem What do you think? Could I be missing something or misunderstanding the current behavior? To be honest, I have not dig into sphinxcontrib-versioning's source code.

@sehnem
Copy link

sehnem commented Mar 8, 2019

@Peque

I have not worked a lot with this package, but I think that you cannot generate the documentation for each versions os the package since it builds all the documentation at once. If it is possible @RAYTHOR approach should work, and it also would fix my problem.

I think that if it is not possible yet, implementing it would be useful for many applications. But maybe someone knows a way to make it work with different versions.

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

3 participants