Commit b86ec60c authored by Robert Bradshaw's avatar Robert Bradshaw

Remove repo from sdist, autogenerate .hgrev

parent a9d3cbb1
include MANIFEST.in README.txt INSTALL.txt ToDo.txt USAGE.txt include MANIFEST.in README.txt INSTALL.txt ToDo.txt USAGE.txt
include COPYING.txt LICENSE.txt Makefile include COPYING.txt LICENSE.txt Makefile
recursive-include .hg * include .hgrev
include .hgignore .hgtags
include setup.py include setup.py
include bin/* include bin/*
include cython.py include cython.py
......
...@@ -3,6 +3,17 @@ from distutils.sysconfig import get_python_lib ...@@ -3,6 +3,17 @@ from distutils.sysconfig import get_python_lib
import os, os.path import os, os.path
import sys import sys
if 'sdist' in sys.argv:
# Record the current revision in .hgrev
import subprocess # os.popen is cleaner but depricated
changset = subprocess.Popen("hg log --rev tip | grep changeset",
shell=True,
stdout=subprocess.PIPE).stdout.read()
rev = changset.split(':')[-1].strip()
hgrev = open('.hgrev', 'w')
hgrev.write(rev)
hgrev.close()
compiler_dir = os.path.join(get_python_lib(prefix=''), 'Cython/Compiler') compiler_dir = os.path.join(get_python_lib(prefix=''), 'Cython/Compiler')
if sys.platform == "win32": if sys.platform == "win32":
compiler_dir = compiler_dir[len(sys.prefix)+1:] compiler_dir = compiler_dir[len(sys.prefix)+1:]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment