-
-
Notifications
You must be signed in to change notification settings - Fork 221
documented sphinx usage causes bad metadata on rtd #84
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
Comments
I posted an answer there. Best I can tell, setuptools_scm is doing the right thing, reflecting a dirty state of the repository. |
it might make sense to make readthedocs set an environment variable for us i would also accept a tested pull request that makes setuptools_scm ignore the dirty state on readthedocs |
readthedocs alters docs/conf.py which in turn means python_scm detects a version and incorrectly adjusts the version number. Here we try to work around this problem. We do this by renaming the docs/conf.py file and copying it back to docs/conf.py when setup.py is invoked. This way, hopefully, scm won't see the changes to docs/conf.py References: http://stackoverflow.com/questions/35811267/readthedocs-and-setuptools-scm-version-wrong/36386177 pypa/setuptools-scm#84
This is a great package! Shame about this issue, though... I've just ported my project to use setuptools_scm and fallen foul of it. It took me a while to figure it out and then find this write-up. I would have greatly appreciated a warning on your project readme where you recommend the sphinx setup, especially given that RTD is so prevalent. Also, if you are thinking of possible workarounds, it occurs to me that |
@peterbrittain thanks for your suggestion, unfortunately it does not quite fit, since relative_to tells the root folder and not the relative file also its hard to correctly do this for other scm's (and even for git it is hard) i am thinking of updating the docs to get people to always use pkg_resources in sphinx configuration the underlying reason:
|
Not quite sure that's right about Given that, it sounds like another source for the docs version (as per your current proposal) might be a better way forwards. Just one further thought: what would this mean for people building sphinx docs outside of RTD? |
there should be no actual difference, at least thats what i currently believe, im not sure if i get to this today |
Looks like RTD does provide an environment variable. Setuptools_scm could work around this issue by ignoring the dirty flag when that env var is present.
The downside of this approach is it requires the project to be built and nominally installed (egg-info in |
@jaraco i am strictly opposed to hacking in a number of special env vars |
for sphinx the usage via pkg_resources is now documented |
Based on the latest recommendation from `setuptools_scm`, but using the full version, as before: pypa/setuptools-scm#84 I removed the variable comments because they are no longer up to date. They can be seen in the official documentation.
Based on the latest recommendation from `setuptools_scm`, but using the full version, as before: pypa/setuptools-scm#84 I removed the variable comments because they are no longer up to date. They can be seen in the official documentation.
@RonnyPfannschmidt could you reconsider adding a flag to ignore dirty state? Installing my package in rtd's virtualenv is not possible for me due to Rust dependencies, and would in any case slow down build times significantly. |
@untitaker i'm happy to accept a PR implementing it via env var or passed trough variable, i dont have time/motivation to do it myself in near future |
Despite pypa/setuptools-scm#84, read the version from setuptools_scm. The readthedocs.org environment does not have LDAP bindings, and cannot install python-ldap. Because the project cannot be installed, the version cannot be read using pkg_resources.
RTD is modifying doc/conf.py, which causes setuptools_scm to increment the version number, because the repo is in a dirty state See pypa/setuptools-scm#84 readthedocs/readthedocs.org#2144
RTD is modifying doc/conf.py, which causes setuptools_scm to increment the version number, because the repo is in a dirty state See pypa/setuptools-scm#84 readthedocs/readthedocs.org#2144
Somehow readthedocs gets the wrong version when using setuptools scm.
I asked about this on stack overflow, however got 0 responses.
So asking here in case anybody here has any ideas.
http://stackoverflow.com/questions/35811267/readthedocs-and-setuptools-scm-version-wrong
The text was updated successfully, but these errors were encountered: