Remove the documentation's dependency on Hy itself
This commit is contained in:
parent
b9279183d7
commit
dd9774fb6d
13
docs/conf.py
13
docs/conf.py
@ -11,12 +11,13 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
import os
|
import os, sys, time
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
sys.path.append(os.path.abspath(".."))
|
sys.path.append(os.path.abspath(".."))
|
||||||
|
|
||||||
import hy
|
from get_version import __version__ as hy_version
|
||||||
|
if hy_version.endswith(".dirty"):
|
||||||
|
# Read the Docs might dirty its checkout, so ignore this.
|
||||||
|
hy_version = hy_version[:-len(".dirty")]
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
@ -53,9 +54,9 @@ copyright = u'%s the authors' % time.strftime('%Y')
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = ".".join(hy.__version__.split(".")[:-1])
|
version = ".".join(hy_version.split(".")[:-1])
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = hy.__version__
|
release = hy_version
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
20
get_version.py
Normal file
20
get_version.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import os, subprocess, runpy
|
||||||
|
|
||||||
|
# Try to get and update the version.
|
||||||
|
|
||||||
|
os.chdir(os.path.split(os.path.abspath(__file__))[0])
|
||||||
|
VERSIONFILE = os.path.join("hy", "version.py")
|
||||||
|
|
||||||
|
try:
|
||||||
|
__version__ = (subprocess.check_output
|
||||||
|
(["git", "describe", "--tags", "--dirty"])
|
||||||
|
.decode('ASCII').strip()
|
||||||
|
.replace('-', '+', 1).replace('-', '.'))
|
||||||
|
with open(VERSIONFILE, "wt") as o:
|
||||||
|
o.write("__version__ = {!r}\n".format(__version__))
|
||||||
|
|
||||||
|
except (subprocess.CalledProcessError, OSError):
|
||||||
|
if os.path.exists(VERSIONFILE):
|
||||||
|
__version__ = runpy.run_path(VERSIONFILE)['__version__']
|
||||||
|
else:
|
||||||
|
__version__ = "unknown"
|
21
setup.py
21
setup.py
@ -3,31 +3,16 @@
|
|||||||
# This file is part of Hy, which is free software licensed under the Expat
|
# This file is part of Hy, which is free software licensed under the Expat
|
||||||
# license. See the LICENSE.
|
# license. See the LICENSE.
|
||||||
|
|
||||||
import os
|
import sys, os
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
import runpy
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
from setuptools.command.install import install
|
from setuptools.command.install import install
|
||||||
|
|
||||||
|
from get_version import __version__
|
||||||
|
|
||||||
os.chdir(os.path.split(os.path.abspath(__file__))[0])
|
os.chdir(os.path.split(os.path.abspath(__file__))[0])
|
||||||
|
|
||||||
PKG = "hy"
|
PKG = "hy"
|
||||||
VERSIONFILE = os.path.join(PKG, "version.py")
|
|
||||||
try:
|
|
||||||
__version__ = (subprocess.check_output
|
|
||||||
(["git", "describe", "--tags", "--dirty"])
|
|
||||||
.decode('ASCII').strip()
|
|
||||||
.replace('-', '+', 1).replace('-', '.'))
|
|
||||||
with open(VERSIONFILE, "wt") as o:
|
|
||||||
o.write("__version__ = {!r}\n".format(__version__))
|
|
||||||
except (subprocess.CalledProcessError, OSError):
|
|
||||||
if os.path.exists(VERSIONFILE):
|
|
||||||
__version__ = runpy.run_path(VERSIONFILE)['__version__']
|
|
||||||
else:
|
|
||||||
__version__ = "unknown"
|
|
||||||
|
|
||||||
long_description = """Hy is a Python <--> Lisp layer. It helps
|
long_description = """Hy is a Python <--> Lisp layer. It helps
|
||||||
make things work nicer, and lets Python and the Hy lisp variant play
|
make things work nicer, and lets Python and the Hy lisp variant play
|
||||||
|
Loading…
Reference in New Issue
Block a user