Skip to content

Commit

Permalink
fix release task and fix documentation for 3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Oct 8, 2018
1 parent 5f2535f commit 61a0ce2
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 36 deletions.
28 changes: 0 additions & 28 deletions changelog.rst

This file was deleted.

29 changes: 29 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start
v3.5.0 (2018-10-08)
-------------------

Bugfixes
^^^^^^^^

- intermittent failures with ``--parallel--safe-build``, instead of mangling with the file paths now uses a lock to make the package build operation thread safe and is now on by default (``--parallel--safe-build`` is now deprecated) - by :user:`gaborbernat` (`#1026 <https://github.com/tox-dev/tox/issues/1026>`_)


Features
^^^^^^^^

- Added ``temp_dir`` folder configuration (defaults to ``{toxworkdir}/.tmp``) that contains tox
temporary files. Package builds now create a hard link (if possible, otherwise copy - notably in
case of Windows Python 2.7) to the built file, and feed that file downstream (e.g. for pip to
install it). The hard link is removed at the end of the run (what it points though is kept
inside ``distdir``). This ensures that a tox session operates on the same package it built, even
if a parallel tox run builds another version. Note ``distdir`` will contain only the last built
package in such cases. - by :user:`gaborbernat` (`#1026 <https://github.com/tox-dev/tox/issues/1026>`_)


Documentation
^^^^^^^^^^^^^

- document tox environment recreate rules (:ref:`recreate`) - by :user:`gaborbernat` (`#93 <https://github.com/tox-dev/tox/issues/93>`_)
- document inside the ``--help`` how to disable colorized output via the ``PY_COLORS`` operating system environment variable - by :user:`gaborbernat` (`#163 <https://github.com/tox-dev/tox/issues/163>`_)
- document all global tox flags and a more concise format to express default and type - by :user:`gaborbernat` (`#683 <https://github.com/tox-dev/tox/issues/683>`_)
- document command line interface under the config section `cli <https://tox.readthedocs.io/en/latest/config.html?highlight=cli#cli>`_ - by :user:`gaborbernat` (`#829 <https://github.com/tox-dev/tox/issues/829>`_)

v3.4.0 (2018-09-20)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ build-backend = 'setuptools.build_meta'

[tool.towncrier]
package = "tox"
filename = "changelog.rst"
filename = "docs/changelog.rst"
directory = "docs/changelog"
template = "docs/changelog/template.jinja2"
title_format = "{version} ({project_date})"
title_format = "v{version} ({project_date})"
issue_format = "`#{issue} <https://github.com/tox-dev/tox/issues/{issue}>`_"
underlines = ["-", "^"]

Expand Down
13 changes: 8 additions & 5 deletions tasks/release.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Handles creating a release PR"""
import sys
from pathlib import Path
from subprocess import check_call
from typing import Tuple
Expand All @@ -17,7 +16,6 @@ def main(version_str: str) -> None:

if repo.is_dirty():
raise RuntimeError("Current repository is dirty. Please commit any changes and try again.")

upstream, release_branch = create_release_branch(repo, version)
release_commit = release_changelog(repo, version)
tag = tag_release_commit(release_commit, repo, version)
Expand Down Expand Up @@ -51,8 +49,8 @@ def get_upstream(repo: Repo) -> Remote:
def release_changelog(repo: Repo, version: Version) -> Commit:
print("generate release commit")
check_call(["towncrier", "--yes", "--version", version.public], cwd=str(ROOT_SRC_DIR))
changed = [item.a_path for item in repo.index.diff(None)]
if any((not i.startswith("changelog") or i == "changelog.rst") for i in changed):
changed = [item.a_path for item in repo.index.diff("HEAD")]
if any(not i.startswith("docs/changelog") for i in changed):
raise RuntimeError(f"found changes outside of the changelog domain: {changed}")
repo.index.add(changed)
release_commit = repo.index.commit(f"release {version}")
Expand All @@ -71,4 +69,9 @@ def tag_release_commit(release_commit, repo, version) -> TagReference:


if __name__ == "__main__":
main(sys.argv[1])
import argparse

parser = argparse.ArgumentParser(prog="release")
parser.add_argument("--version", required=True)
options = parser.parse_args()
main(options.version)
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ passenv = *
deps = gitpython >= 2.1.10
towncrier >= 18.5.0
packaging >= 17.1
commands = python {toxinidir}/tasks/release.py {posargs}
skip_install = true
commands = python {toxinidir}/tasks/release.py --version {posargs}
[testenv:notify]
description = notify people about the release of the library
Expand Down

0 comments on commit 61a0ce2

Please sign in to comment.