- 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``

--HG--
branch : release-checklist
This commit is contained in:
holger krekel 2015-04-02 10:38:25 +02:00
parent 81d7883884
commit b55d66d0cf
7 changed files with 62 additions and 41 deletions

View File

@ -1,6 +1,9 @@
2.7.1.dev (compared to 2.7.0) 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) 2.7.0 (compared to 2.6.4)
----------------------------- -----------------------------

View File

@ -1,2 +1,2 @@
# #
__version__ = '2.7.1.dev' __version__ = '2.7.1.dev1'

View File

@ -15,46 +15,39 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest .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: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files" @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 " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files" @echo " showtarget to show the pytest.org target directory"
@echo " man to make manual pages" @echo " install to install docs to pytest.org/SITETARGET"
@echo " changes to make an overview of all changed/added/deprecated items" @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 " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean: clean:
-rm -rf $(BUILDDIR)/* -rm -rf $(BUILDDIR)/*
SITETARGET=dev SITETARGET=$(shell ./_getdoctarget.py)
showtarget:
@echo $(SITETARGET)
install: html install: html
# for access talk to someone with login rights to # for access talk to someone with login rights to
# pytest-dev@pytest.org to add your ssh key # pytest-dev@pytest.org to add your ssh key
rsync -avz _build/html/ pytest-dev@pytest.org:/www/pytest.org/$(SITETARGET) rsync -avz _build/html/ pytest-dev@pytest.org:pytest.org/$(SITETARGET)
installpdf: latexpdf installpdf: latexpdf
@scp $(BUILDDIR)/latex/pytest.pdf pytest-dev@pytest.org:/www/pytest.org/$(SITETARGET) @scp $(BUILDDIR)/latex/pytest.pdf pytest-dev@pytest.org:pytest.org/$(SITETARGET)
installall: clean install installpdf installall: clean install installpdf
@echo "done" @echo "done"
regen:
PYTHONDONTWRITEBYTECODE=1 COLUMNS=76 regendoc --update *.txt */*.txt
html: html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo @echo

16
doc/en/_getdoctarget.py Executable file
View File

@ -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())

View File

@ -17,10 +17,13 @@
# #
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
# The short X.Y version. # 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, # 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
@ -54,7 +57,7 @@ master_doc = 'contents'
# General information about the project. # General information about the project.
project = u'pytest' project = u'pytest'
copyright = u'2014, holger krekel' copyright = u'2015, holger krekel and pytest-dev team'

View File

@ -1,39 +1,36 @@
pytest release checklist 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`` 1. change version numbers in ``_pytest/__init__.py`` to the to-be-released version.
to a final release version. (the version number in ``setup.py`` reads from that init file as well)
2. finalize ``./CHANGELOG`` (don't forget the the header). 2. finalize ``./CHANGELOG`` (don't forget the the header).
3. write ``doc/en/announce/release-VERSION.txt`` 3. write ``doc/en/announce/release-VERSION.txt``
(usually copying from an earlier release version). (usually copying from an earlier release version).
4. change ``version`` and ``release`` in doc/en/conf.py, set ``SITETARGET=latest`` 4. regenerate doc examples with ``tox -e regen`` and check with ``hg diff``
in ``doc/en/Makefile``.
5. 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 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 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 speed ("tests took X.Y seconds"). (XXX automate doc/example diffing to ignore
such changes and integrate it into "tox -e regen"). 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. 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 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 but on windows all involving ``pexpect`` fail because pexpect does not exist
on windows and tox does not allow to have platform-specific environments. on windows and tox does not allow to have platform-specific environments.
Also on windows ``py33-trial`` fails but should probably pass (March 2015). 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. 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/ cd doc/en/
make install make install
@ -44,12 +41,12 @@ For doing a release of pytest (status March 2015) holger does:
hg tag VERSION hg tag VERSION
hg push hg push
10. send out release announcement to pytest-dev@python.org, 9. send out release announcement to pytest-dev@python.org,
testing-in-python@lists.idyll.org and python-announce-list@python.org . testing-in-python@lists.idyll.org and python-announce-list@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 ``_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``) 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. and set ``SITETARGET=dev`` in ``doc/en/makefile``. Commit.
12. already done :) 11. already done :)

View File

@ -16,6 +16,15 @@ classifiers = ['Development Status :: 6 - Mature',
with open('README.rst') as fd: with open('README.rst') as fd:
long_description = fd.read() 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(): def main():
install_requires = ['py>=1.4.25'] install_requires = ['py>=1.4.25']
@ -28,7 +37,7 @@ def main():
name='pytest', name='pytest',
description='pytest: simple powerful testing with Python', description='pytest: simple powerful testing with Python',
long_description=long_description, long_description=long_description,
version='2.7.1.dev', version=get_version(),
url='http://pytest.org', url='http://pytest.org',
license='MIT license', license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],