Skip to content

Commit a9875e3

Browse files
committed
Update contributing docs, Makefile and tox
1 parent 0c287b4 commit a9875e3

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

CONTRIBUTING.rst

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,55 @@ Thou shalt receive cookies for your welcomed contribution.
1616
Development
1717
-----------
1818

19-
Locally
20-
~~~~~~~
19+
1. Set up a virtual environment
2120

22-
Ensure you have all the development dependencies:
21+
.. code:: console
2322
24-
.. code:: bash
23+
$ python3 -m venv .venv
24+
$ .venv/bin/activate
2525
26-
$ pipenv install --dev
26+
2. Install package in editable mode with dependencies
2727

28-
Install the library in *development* mode so you can test it out whilst
29-
developing features.
28+
.. code:: console
3029
31-
.. code:: bash
30+
$ pip install ".[test,docs]" -e .
3231
33-
$ python setup.py develop
32+
3. Run unit tests
3433

35-
On a raspberry pi
34+
.. code:: console
35+
36+
$ make test # run under current python version
37+
38+
$ pip install tox pyenv tox-pyenv # Install pyenv tox to run under all python versions
39+
$ git clone https://github.com/momo-lab/xxenv-latest.git "$(pyenv root)"/plugins/xxenv-latest
40+
$ for v in 2.7 3.4 3.5 3.6 3.7; do pyenv la test install "$v"; done
41+
$ pyenv versions --base > .python-version
42+
$ make test-all # run under tox for all supported python versions
43+
44+
4. Run integration tests (on Raspberry Pi)
45+
46+
.. code:: console
47+
48+
$ make test-integration
49+
50+
51+
5. Build docs
52+
53+
.. code:: console
54+
55+
$ make doc
56+
$ make doc-serve # run HTTP server to view docs
57+
58+
6. Run examples
59+
60+
.. code:: console
61+
62+
$ cd examples
63+
$ PYTHONPATH=.. python3 video_file.py
64+
$ PYTHONPATH=.. python3 advanced_usage.py
65+
66+
67+
On a Raspberry Pi
3668
~~~~~~~~~~~~~~~~~
3769

3870
There's also an Ansible playbook in ``devenv`` which will set up a

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PYTHON2:=python2
2-
PYTHON3:=python3
1+
PYTHON2 ?= python2
2+
PYTHON3 ?= python3
33

44
.PHONY: init
55
init:
@@ -9,14 +9,17 @@ init:
99
test:
1010
pytest tests/unit --cov-branch --cov=omxplayer
1111

12-
.PHONY: test
12+
.PHONY: test-all
1313
test-all:
1414
tox
1515

16+
.PHONY: test-integration
17+
test-integration:
18+
pytest tests/integration/test.py
19+
1620
.PHONY: dist
1721
dist:
18-
$(PYTHON3) setup.py sdist
19-
$(PYTHON3) setup.py bdist_wheel --universal
22+
$(PYTHON3) setup.py sdist bdist_wheel --universal
2023

2124
dist-upload: clean dist
2225
twine upload dist/*

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070

7171
packages=find_packages(exclude=['*test*']),
7272
install_requires=lib_deps,
73-
test_requires=test_deps,
7473
extras_require={
7574
'test': test_deps,
7675
'docs': doc_deps

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27, py34, py35, py36
2+
envlist = py27, py35, py36, py37
33

44
[testenv]
55
# Necessary for tox and pipenv to play nicely together

0 commit comments

Comments
 (0)