[Pytest-commit] commit/pytest: hpk42: - avoid setting of versions and targets in conf.py and Makefile
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Apr 2 10:49:17 CEST 2015
1 new commit in pytest:
https://bitbucket.org/pytest-dev/pytest/commits/d79d71cff698/
Changeset: d79d71cff698
Branch: release-checklist
User: hpk42
Date: 2015-04-02 08:38:25+00:00
Summary: - avoid setting of versions and targets in conf.py and Makefile
as discussed on pytest-dev
- "make help" now prints pytest specific information.
- add a "_getdoctarget.py" helper
- make ``setup.py`` read the version from ``_pytest/__init__.py``
Affected #: 7 files
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
2.7.1.dev (compared to 2.7.0)
-----------------------------
+- streamlined and documented release process. Also all versions
+ (in setup.py and documentation generation) are now read
+ from _pytest/__init__.py.
2.7.0 (compared to 2.6.4)
-----------------------------
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
#
-__version__ = '2.7.1.dev'
+__version__ = '2.7.1.dev1'
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb doc/en/Makefile
--- a/doc/en/Makefile
+++ b/doc/en/Makefile
@@ -15,46 +15,39 @@
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-regen:
- PYTHONDONTWRITEBYTECODE=1 COLUMNS=76 regendoc --update *.txt */*.txt
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " showtarget to show the pytest.org target directory"
+ @echo " install to install docs to pytest.org/SITETARGET"
+ @echo " install-ldf to install the doc pdf to pytest.org/SITETARGET"
+ @echo " regen to regenerate pytest examples using the installed pytest"
@echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
-SITETARGET=dev
+SITETARGET=$(shell ./_getdoctarget.py)
+
+showtarget:
+ @echo $(SITETARGET)
install: html
# for access talk to someone with login rights to
# pytest-dev at pytest.org to add your ssh key
- rsync -avz _build/html/ pytest-dev at pytest.org:/www/pytest.org/$(SITETARGET)
+ rsync -avz _build/html/ pytest-dev at pytest.org:pytest.org/$(SITETARGET)
installpdf: latexpdf
- @scp $(BUILDDIR)/latex/pytest.pdf pytest-dev at pytest.org:/www/pytest.org/$(SITETARGET)
+ @scp $(BUILDDIR)/latex/pytest.pdf pytest-dev at pytest.org:pytest.org/$(SITETARGET)
installall: clean install installpdf
@echo "done"
+regen:
+ PYTHONDONTWRITEBYTECODE=1 COLUMNS=76 regendoc --update *.txt */*.txt
+
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb doc/en/_getdoctarget.py
--- /dev/null
+++ b/doc/en/_getdoctarget.py
@@ -0,0 +1,16 @@
+#!/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:
+ 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())
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb doc/en/conf.py
--- a/doc/en/conf.py
+++ b/doc/en/conf.py
@@ -17,10 +17,13 @@
#
# The full version, including alpha/beta/rc tags.
# The short X.Y version.
-version = "2.7"
-release = "2.7.1.dev"
-import sys, os
+import os, sys
+sys.path.insert(0, os.path.dirname(__file__))
+import _getdoctarget
+
+version = _getdoctarget.get_minor_version_string()
+release = _getdoctarget.get_version_string()
# 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
@@ -54,7 +57,7 @@
# General information about the project.
project = u'pytest'
-copyright = u'2014, holger krekel'
+copyright = u'2015, holger krekel and pytest-dev team'
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb doc/en/release.txt
--- a/doc/en/release.txt
+++ b/doc/en/release.txt
@@ -1,39 +1,36 @@
pytest release checklist
-------------------------
-For doing a release of pytest (status March 2015) holger does:
+For doing a release of pytest (status April 2015) this checklist is used:
-1. change version numbers in ``setup.py``, ``_pytest/__init__.py``
- to a final release version.
+1. change version numbers in ``_pytest/__init__.py`` to the to-be-released version.
+ (the version number in ``setup.py`` reads from that init file as well)
2. finalize ``./CHANGELOG`` (don't forget the the header).
3. write ``doc/en/announce/release-VERSION.txt``
(usually copying from an earlier release version).
-4. change ``version`` and ``release`` in doc/en/conf.py, set ``SITETARGET=latest``
- in ``doc/en/Makefile``.
-
-5. regenerate doc examples with ``tox -e regen`` and check with ``hg diff``
+4. regenerate doc examples with ``tox -e regen`` and check with ``hg diff``
if the differences show regressions. It's a bit of a manual process because
there a large part of the diff is about pytest headers or differences in
speed ("tests took X.Y seconds"). (XXX automate doc/example diffing to ignore
such changes and integrate it into "tox -e regen").
-6. ``devpi upload`` to `your developer devpi index <http://doc.devpi.net/latest/quickstart-releaseprocess.html>`_. You can create your own user and index on https://devpi.net,
+5. ``devpi upload`` to `your developer devpi index <http://doc.devpi.net/latest/quickstart-releaseprocess.html>`_. You can create your own user and index on https://devpi.net,
an inofficial service from the devpi authors.
-7. run ``devpi use INDEX`` and ``devpi test`` from linux and windows machines
+6. run ``devpi use INDEX`` and ``devpi test`` from linux and windows machines
and verify test results on the index. On linux typically all environments
- pass (March 2015 there is a setup problem with a cx_freeze environment)
+ pass (April 2015 there is a setup problem with a cx_freeze environment)
but on windows all involving ``pexpect`` fail because pexpect does not exist
on windows and tox does not allow to have platform-specific environments.
Also on windows ``py33-trial`` fails but should probably pass (March 2015).
In any case, py26,py27,py33,py34 are required to pass for all platforms.
-8. You can fix tests/code and repeat number 7. until everything passes.
+7. You can fix tests/code and repeat number 6. until everything passes.
-9. Once you have sufficiently passing tox tests you can do the actual release::
+8. Once you have sufficiently passing tox tests you can do the actual release::
cd doc/en/
make install
@@ -44,12 +41,12 @@
hg tag VERSION
hg push
-10. send out release announcement to pytest-dev at python.org,
+9. send out release announcement to pytest-dev at python.org,
testing-in-python at lists.idyll.org and python-announce-list at python.org .
-11. **after the release** bump the version numbers in ``setup.py``,
+10. **after the release** bump the version numbers in ``setup.py``,
``_pytest/__init__.py``, ``doc/en/conf.py`` to the next Minor release
version (i.e. if you released ``pytest-2.8.0``, set it to ``pytest-2.9.0.dev1``)
and set ``SITETARGET=dev`` in ``doc/en/makefile``. Commit.
-12. already done :)
+11. already done :)
diff -r b527114b58a754010d1a0fc7137d4a66787f1680 -r d79d71cff698b3ff84f3591e66b9b13288d027cb setup.py
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,15 @@
with open('README.rst') as fd:
long_description = fd.read()
+def get_version():
+ p = os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), "_pytest", "__init__.py")
+ with open(p) as f:
+ for line in f.readlines():
+ if "__version__" in line:
+ return line.strip().split("=")[-1].strip(" '")
+ raise ValueError("could not read version")
+
def main():
install_requires = ['py>=1.4.25']
@@ -28,7 +37,7 @@
name='pytest',
description='pytest: simple powerful testing with Python',
long_description=long_description,
- version='2.7.1.dev',
+ version=get_version(),
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
Repository URL: https://bitbucket.org/pytest-dev/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list