Permalink
Browse files

Remove the documentation's dependency on Hy itself

  • Loading branch information...
Kodiologist committed May 23, 2017
1 parent b927918 commit dd9774fb6d55f62ef830c098bb28c725bcc58cb2
Showing with 30 additions and 24 deletions.
  1. +7 −6 docs/conf.py
  2. +20 −0 get_version.py
  3. +3 −18 setup.py
@@ -11,12 +11,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
import time
import os, sys, time
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,
# add these directories to sys.path here. If the directory is relative to the
@@ -53,9 +54,9 @@
# built documents.
#
# 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.
release = hy.__version__
release = hy_version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -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"
@@ -3,31 +3,16 @@
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import os
import re
import sys
import runpy
import subprocess
import sys, os
from setuptools import find_packages, setup
from setuptools.command.install import install
from get_version import __version__
os.chdir(os.path.split(os.path.abspath(__file__))[0])
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
make things work nicer, and lets Python and the Hy lisp variant play

0 comments on commit dd9774f

Please sign in to comment.