Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

- [ ] Target: for bug or doc fixes, target `master`; for new features, target `features`;
- [ ] Add a new news fragment into the changelog folder
* name it `$issue_id.$type` for example (588.bug)
* if you don't have an issue_id change it to the pr id after creating the pr
* ensure type is one of `removal`, `feature`, `bugfix`, `vendor`, `doc` or `trivial`
* Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
- [ ] Target: for `bugfix`, `vendor`, `doc` or `trivial` fixes, target `master`; for removals or features target `features`;
- [ ] Make sure to include reasonable tests for your change if necessary

Unless your change is trivial documentation fix (e.g., a typo or reword of a small section) please:
Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

- [ ] Make sure to include one or more tests for your change;
- [ ] Add yourself to `AUTHORS`;
- [ ] Add a new entry to `CHANGELOG.rst`
* Choose any open position to avoid merge conflicts with other PRs.
* Add a link to the issue you are fixing (if any) using RST syntax.
* The pytest team likes to have people to acknowledged in the `CHANGELOG`, so please add a thank note to yourself ("Thanks @user for the PR") and a link to your GitHub profile. It may sound weird thanking yourself, but otherwise a maintainer would have to do it manually before or after merging instead of just using GitHub's merge button. This makes it easier on the maintainers to merge PRs.
12 changes: 8 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
3.1.1 (unreleased)
==================
..
You should *NOT* be adding new change log entries to this file, this
file is managed by towncrier. You *may* edit previous change logs to
fix problems like typo corrections or such.
To add a new change log entry, please see
https://pip.pypa.io/en/latest/development/#adding-a-news-entry
we named the news folder changelog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you plan to run this once with some dummy entries for review only? Then before merging you can discard that commit (like I did with the pre-release tasks).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoddemus im planning to open a own pr against my branch and refer it here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! 👍


* Fix encoding errors for unicode warnings in Python 2. (towncrier: 2436.bugfix)

* Fix issue with non-ascii contents in doctest text files. (towncrier: 2434.bugfix)
.. towncrier release notes start


3.1.0 (2017-05-22)
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include CHANGELOG.rst
include LICENSE
include AUTHORS
include pyproject.toml

include README.rst
include CONTRIBUTING.rst
Expand All @@ -9,6 +10,7 @@ include HOWTORELEASE.rst
include tox.ini
include setup.py

recursive-include changelog *
recursive-include scripts *.py
recursive-include scripts *.bat

Expand Down
1 change: 1 addition & 0 deletions changelog/2390.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
initial addition of towncrier
1 change: 1 addition & 0 deletions changelog/2434.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue with non-ascii contents in doctest text files.
1 change: 1 addition & 0 deletions changelog/2436.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix encoding errors for unicode warnings in Python 2.
38 changes: 38 additions & 0 deletions changelog/_template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% for section in sections %}
{% set underline = "-" %}
{% if section %}
{{section}}
{{ underline * section|length }}{% set underline = "~" %}

{% endif %}
{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section] and category != 'trivial' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure, is this an ordered dict sorted by the order the categories appear in the pyproject.toml file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understandign is, that it is ordered


{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category]|dictsort(by='value') %}
- {{ text }}{% if category != 'vendor' %} ({{ values|sort|join(', ') }}){% endif %}

{% endfor %}
{% else %}
- {{ sections[section][category]['']|sort|join(', ') }}


{% endif %}
{% if sections[section][category]|length == 0 %}

No significant changes.


{% else %}
{% endif %}
{% endfor %}
{% else %}

No significant changes.


{% endif %}
{% endfor %}
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.towncrier]
package = "pytest"
filename = "CHANGELOG.rst"
directory = "changelog/"
template = "changelog/_template.rst"

[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Removals"
showcontent = true

[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true

[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true

[[tool.towncrier.type]]
directory = "vendor"
name = "Vendored Libraries"
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "trivial"
name = "Trivial Changes"
showcontent = false
4 changes: 2 additions & 2 deletions scripts/check-manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import os
import subprocess
import sys

from check_manifest import main

if os.path.isdir('.git'):
sys.exit(subprocess.call('check-manifest', shell=True))
sys.exit(main())
else:
print('No .git directory found, skipping checking the manifest file')
sys.exit(0)
11 changes: 11 additions & 0 deletions scripts/check-rst.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

from __future__ import print_function

import subprocess
import glob
import sys

sys.exit(subprocess.call([
'rst-lint', '--encoding', 'utf-8',
'CHANGELOG.rst', 'HOWTORELEASE.rst', 'README.rst',
] + glob.glob('changelog/[0-9]*.*')))
16 changes: 15 additions & 1 deletion tasks/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ def devpi_upload(ctx, version, user, password=None):
'(if not given assumed logged in)',
})
def pre_release(ctx, version, user, password=None):
"""Generates new docs, release announcements and uploads a new release to devpi for testing."""
"""Generates new docs, release announcements and uploads a new release to devpi for testing."""
announce(ctx, version)
regen(ctx)
changelog(ctx, version, write_out=True)

msg = 'Preparing release version {}'.format(version)
check_call(['git', 'commit', '-a', '-m', msg])
Expand Down Expand Up @@ -146,3 +147,16 @@ def publish_release(ctx, version, user, pypi_name):
print(' ', ','.join(emails))
print()
print('And announce it on twitter adding the #pytest hash tag.')


@invoke.task(help={
'version': 'version being released',
'write_out': 'write changes to the actial changelog'
})
def changelog(ctx, version, write_out=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to call this from the pre_release tag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i got sidetracked because it looked like invoke can run dependent taks, bt it cant pass dependent data along with them, so its useless

if write_out:
addopts = []
else:
addopts = ['--draft']
check_call(['towncrier', '--version', version] + addopts)

1 change: 1 addition & 0 deletions tasks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
invoke
tox
gitpython
towncrier
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ deps =
commands =
{envpython} scripts/check-manifest.py
flake8 pytest.py _pytest testing
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst --encoding utf-8
{envpython} scripts/check-rst.py

[testenv:py27-xdist]
deps=pytest-xdist>=1.13
Expand Down