Skip to content

Commit 89c5b57

Browse files
committed
Attempt readthedocs workaround
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
1 parent a8b2883 commit 89c5b57

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshuttle/version.py
2+
docs/conf.py
23
*.pyc
34
*~
45
*.8
File renamed without changes.

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
# along with python-tldap If not, see <http://www.gnu.org/licenses/>.
1919

2020
from setuptools import setup, find_packages
21+
import shutil
2122

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

2328
def version_scheme(version):
2429
from setuptools_scm.version import guess_next_dev_version

0 commit comments

Comments
 (0)