Skip to content

Commit 22fc4b7

Browse files
committed
Improve documentation and build files
1 parent 76f6a12 commit 22fc4b7

File tree

6 files changed

+33
-76
lines changed

6 files changed

+33
-76
lines changed

.travis.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
sudo: false
22
language: python
3-
matrix:
4-
include:
5-
- python: 2.7
6-
- python: 3.5
7-
- python: 3.6
8-
- python: 3.7
9-
dist: xenial
10-
sudo: true
3+
python:
4+
- "2.7"
5+
- "3.5"
6+
- "3.6"
7+
- "3.7"
8+
- "3.8"
119
install:
12-
- pip install flake8
13-
- pip install mock
14-
- pip install pytest==3.5.1
15-
- pip install pytest-cov==2.5.1
16-
- pip install python-coveralls==2.9.1
10+
- pip install flake8 mock pytest pytest-cov coveralls
1711
- pip install sphinx sphinx_rtd_theme
1812
- pip install .
1913
script:

README.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ visualize, inspect and manipulate binary trees. It allows you to skip the
4040
tedious work of setting up test data, and dive straight into practising your
4141
algorithms. Heaps and BSTs (binary search trees) are also supported.
4242

43-
Announcements
44-
=============
45-
46-
* Please see the releases_ page for details on the latest updates.
47-
48-
.. _releases: https://github.com/joowani/binarytree/releases
49-
5043
Requirements
5144
============
5245

docs/contributing.rst

Lines changed: 20 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
11
Contributing
22
------------
33

4-
Instructions
4+
Requirements
55
============
66

7-
Before submitting a pull request on GitHub_, please make sure you meet the
8-
following **requirements**:
9-
10-
* The pull request points to the dev_ (development) branch.
11-
* All changes are squashed into a single commit (I like to use ``git rebase -i``
12-
to do this).
13-
* The commit message is in present tense (good: "Add feature", bad:
14-
"Added feature").
15-
* Correct and consistent style: Sphinx_-compatible docstrings, correct snake
16-
and camel casing, and PEP8_ compliance (see below).
17-
* No classes/methods/functions with missing docstrings or commented-out lines.
18-
You can take a look at the source code on GitHub_ for examples.
19-
* The test coverage_ remains at %100. You may find yourself having to write
20-
superfluous unit tests to keep this number up. If a piece of code is trivial
21-
and has no need for tests, use this_ to exclude it from coverage.
22-
* No build failures on TravisCI_. The builds automatically trigger on PR
23-
submissions.
24-
* Does not break backward-compatibility (unless there is a really good reason).
25-
* Compatibility with all supported Python versions: 2.7, 3.4, 3.5 and 3.6.
26-
27-
.. warning::
28-
The dev branch is occasionally rebased_, and its commit history may be
29-
overwritten in the process. Before you begin feature work, git fetch or
30-
pull to ensure that your local branch has not diverged. If you see git
31-
conflicts and just want to start from scratch, run these commands:
32-
33-
.. code-block:: bash
34-
35-
~$ git checkout dev
36-
~$ git fetch origin
37-
~$ git reset --hard origin/dev # THIS WILL WIPE ALL LOCAL CHANGES
7+
When submitting a pull request, please ensure your changes meet the following
8+
requirements:
9+
10+
* Pull request points to dev_ (development) branch.
11+
* Changes are squashed into a single commit.
12+
* Commit message is in present tense (e.g. "Add foo" over "Added foo").
13+
* Sphinx_-compatible docstrings.
14+
* PEP8_ compliance.
15+
* Test coverage_ remains at %100.
16+
* No build failures on TravisCI_.
17+
* Up-to-date documentation (see below).
18+
* Maintains backward-compatibility.
19+
* Maintains compatibility with Python 2.7+ and 3.4+.
3820

3921
Style
4022
=====
4123

42-
To ensure PEP8_ compliance, run flake8_:
24+
Run flake8_ to check style:
4325

4426
.. code-block:: bash
4527
@@ -48,17 +30,11 @@ To ensure PEP8_ compliance, run flake8_:
4830
~$ cd binarytree
4931
~$ flake8
5032
51-
You must resolve all issues reported. If there is a good reason to ignore
52-
errors coming from a specific piece of code, visit here_ to see how to exclude
53-
the lines.
5433
5534
Testing
5635
=======
5736

58-
To test your changes, run the unit tests that come with **binarytree** on your
59-
local machine. The tests use pytest_.
60-
61-
To run the unit tests:
37+
Run unit tests:
6238

6339
.. code-block:: bash
6440
@@ -67,44 +43,35 @@ To run the unit tests:
6743
~$ cd binarytree
6844
~$ py.test --verbose
6945
70-
To run the unit tests with coverage report:
46+
Run unit tests with coverage:
7147

7248
.. code-block:: bash
7349
7450
~$ pip install coverage pytest pytest-cov
7551
~$ git clone https://github.com/joowani/binarytree.git
7652
~$ cd binarytree
77-
~$ py.test --verbose --cov=binarytree --cov-report=html
53+
~$ py.test --cov=binarytree --cov-report=html
7854
7955
# Open the generated file htmlcov/index.html in a browser
8056
8157
Documentation
8258
=============
8359

84-
The documentation (including the README) is written in reStructuredText_ and
85-
uses Sphinx_. To build an HTML version of the documentation on your local
86-
machine:
60+
Documentation uses reStructuredText_ and Sphinx_. To build locally:
8761

8862
.. code-block:: bash
8963
9064
~$ pip install sphinx sphinx_rtd_theme
9165
~$ git clone https://github.com/joowani/binarytree.git
9266
~$ cd binarytree/docs
9367
~$ sphinx-build . build
68+
# Open build/index.html in a browser
9469
95-
# Open the generated file build/index.html in a browser
96-
97-
As always, thank you for your contribution!
9870
99-
.. _rebased: https://git-scm.com/book/en/v2/Git-Branching-Rebasing
10071
.. _dev: https://github.com/joowani/binarytree/tree/dev
101-
.. _GitHub: https://github.com/joowani/binarytree
10272
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
10373
.. _coverage: https://coveralls.io/github/joowani/binarytree
104-
.. _this: http://coverage.readthedocs.io/en/latest/excluding.html
10574
.. _TravisCI: https://travis-ci.org/joowani/binarytree
10675
.. _Sphinx: https://github.com/sphinx-doc/sphinx
10776
.. _flake8: http://flake8.pycqa.org
108-
.. _here: http://flake8.pycqa.org/en/latest/user/violations.html#in-line-ignoring-errors
109-
.. _pytest: https://github.com/pytest-dev/pytest
11077
.. _reStructuredText: https://en.wikipedia.org/wiki/ReStructuredText

docs/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Exceptions
22
----------
33

4-
The page lists the exceptions raised by **binarytree**:
4+
This page contains exceptions raised by **binarytree**:
55

66
.. automodule:: binarytree.exceptions
77
:members:

pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pytest]
22
python_files = tests.py test_*.py *_tests.py
3-
addopts = -vv -p no:warnings --cov=binarytree
4-
norecursedirs = venv htmlcov build dist .idea .git
3+
addopts = -s -vv -p no:warnings --cov=binarytree
4+
norecursedirs = .cache .git .idea .pytest_cache build dist docs htmlcov venv

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[bdist_wheel]
22
universal = 1
3+
4+
[flake8]
5+
exclude = .cache,.git,.idea,.pytest_cache,__pycache__,docs/conf.py,dist,venv

0 commit comments

Comments
 (0)