Skip to content

Commit b4ed5d0

Browse files
committed
Add pre-commit scripts and HOWTORELEASE docs
1 parent 970075f commit b4ed5d0

File tree

4 files changed

+57
-2
lines changed

4 files changed

+57
-2
lines changed

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
exclude: '^($|.*\.bin)'
2+
repos:
3+
- repo: https://github.com/ambv/black
4+
rev: 18.6b4
5+
hooks:
6+
- id: black
7+
args: [--safe, --quiet]
8+
language_version: python3.6
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v1.3.0
11+
hooks:
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
- repo: local
15+
hooks:
16+
- id: rst
17+
name: rst
18+
entry: rst-lint --encoding utf-8
19+
files: ^(CHANGELOG.rst|README.rst|HOWTORELEASE.rst|changelog/.*)$
20+
language: python
21+
additional_dependencies: [pygments, restructuredtext_lint]
22+
python_version: python3.6

HOWTORELEASE.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Here are the steps on how to make a new release.
2+
3+
1. Create a ``release-VERSION`` branch from ``upstream/master``.
4+
2. Update ``CHANGELOG.rst``.
5+
3. Push a branch with the changes.
6+
4. Once all builds pass, push a tag to ``upstream``.
7+
5. Merge the PR.

README.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,26 @@ temporarily:
322322
return my_cm
323323
324324
325+
Contributing
326+
============
327+
328+
Contributions are welcome! After cloning the repository, create a virtual env
329+
and install ``pytest-mock`` in editable mode with ``dev`` extras:
330+
331+
.. code-block:: console
332+
333+
$ pip install --editable .[dev]
334+
$ pre-commit install
335+
336+
Tests are run with ``tox``, you can run the baseline environments before submitting a PR:
337+
338+
.. code-block:: console
339+
340+
$ tox -e py27,py36,linting
341+
342+
Style checks and formatting are done automatically during commit courtesy of
343+
`pre-commit <https://pre-commit.com>`_.
344+
325345
License
326346
=======
327347

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from setuptools import setup
2-
31
from io import open
42

3+
from setuptools import setup
4+
55
setup(
66
name='pytest-mock',
77
entry_points={
@@ -23,6 +23,12 @@
2323
description='Thin-wrapper around the mock package for easier use with py.test',
2424
long_description=open('README.rst', encoding='utf-8').read(),
2525
keywords="pytest mock",
26+
extras_require={
27+
"dev": [
28+
"pre-commit",
29+
"tox",
30+
]
31+
},
2632
classifiers=[
2733
'Development Status :: 5 - Production/Stable',
2834
'Framework :: Pytest',

0 commit comments

Comments
 (0)