Skip to content

Commit

Permalink
Attempt readthedocs workaround
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brianmay committed Apr 18, 2016
1 parent a8b2883 commit 89c5b57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sshuttle/version.py
docs/conf.py
*.pyc
*~
*.8
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
# along with python-tldap If not, see <http://www.gnu.org/licenses/>.

from setuptools import setup, find_packages
import shutil

with open("./docs/conf.orig.py", "r") as src:
with open("./docs/conf.py", "w") as dst:
dst.write("# FILE COPIED FROM conf.orig.py; DO NOT CHANGE\n")
shutil.copyfileobj(src, dst)

def version_scheme(version):
from setuptools_scm.version import guess_next_dev_version
Expand Down

0 comments on commit 89c5b57

Please sign in to comment.