From e21ae3991de032d8c0a15ba5725d7f219ca9fcad Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 5 Sep 2016 16:42:33 +0200 Subject: [PATCH 1/2] docs: remove the need for special scripts * import version from pytest since it is importable * remove makefile bits from legacy hosting * remove the script to determine the version for legacy hosting --- doc/en/Makefile | 19 +------------------ doc/en/conf.py | 7 ++----- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/doc/en/Makefile b/doc/en/Makefile index 8621f779c..5499c405e 100644 --- a/doc/en/Makefile +++ b/doc/en/Makefile @@ -19,10 +19,9 @@ REGENDOC_ARGS := \ --normalize "@/tmp/pytest-of-.*/pytest-\d+@PYTEST_TMPDIR@" \ - .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest - + help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @@ -36,22 +35,6 @@ help: clean: -rm -rf $(BUILDDIR)/* -SITETARGET=$(shell ./_getdoctarget.py) - -showtarget: - @echo $(SITETARGET) - -install: html - # for access talk to someone with login rights to - # pytest-dev@pytest.org to add your ssh key - rsync -avz _build/html/ pytest-dev@pytest.org:pytest.org/$(SITETARGET) - -installpdf: latexpdf - @scp $(BUILDDIR)/latex/pytest.pdf pytest-dev@pytest.org:pytest.org/$(SITETARGET) - -installall: clean install installpdf - @echo "done" - regen: PYTHONDONTWRITEBYTECODE=1 COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS} diff --git a/doc/en/conf.py b/doc/en/conf.py index 1c15c17fc..f3b8d7d1e 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -19,11 +19,8 @@ # The short X.Y version. import os, sys -sys.path.insert(0, os.path.dirname(__file__)) -import _getdoctarget - -version = _getdoctarget.get_minor_version_string() -release = _getdoctarget.get_version_string() +from _pytest import __version__ as version +release = ".".join(version.split(".")[:2]) # 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 From a2b8981b50e953eedd610d5e6cfb6aa83321894d Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 5 Sep 2016 21:03:22 +0200 Subject: [PATCH 2/2] docs: remove unused helper script --- doc/en/_getdoctarget.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 doc/en/_getdoctarget.py diff --git a/doc/en/_getdoctarget.py b/doc/en/_getdoctarget.py deleted file mode 100755 index 20e487bb7..000000000 --- a/doc/en/_getdoctarget.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -import py - -def get_version_string(): - fn = py.path.local(__file__).join("..", "..", "..", - "_pytest", "__init__.py") - for line in fn.readlines(): - if "version" in line and not line.strip().startswith('#'): - return eval(line.split("=")[-1]) - -def get_minor_version_string(): - return ".".join(get_version_string().split(".")[:2]) - -if __name__ == "__main__": - print (get_minor_version_string())