Skip to content

Commit 69a4188

Browse files
committed
NOBUG: Improve documentation
1 parent 1ac2ba2 commit 69a4188

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

CONTRIBUTING.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,31 @@ Non-Goals:
2929
Development
3030
-----------
3131

32+
For many tasks, it is okay to just develop using a single installed python version. But if you need to test/debug the project in multiple python versions, you need to install those version::
33+
34+
1. (Optional) Install multiple python versions
35+
36+
1. (Optional) Install [pyenv](https://github.com/pyenv/pyenv-installer) to manage python versions
37+
2. (Optional) Using pyenv, install the python versions used in testing::
38+
39+
pyenv install 2.7.16
40+
pyenv install 3.6.8
41+
42+
It may be okay to run and test python against locally installed libraries, but if you need to have a consistent build, it is recommended to manage your environment using virtualenv: [virtualenv](https://virtualenv.pypa.io/en/latest/ ), [virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/ ):
43+
44+
1. (Optional) Setup a local virtual environment with all necessary tools and libraries::
45+
46+
mkvirtualenv cpplint [-p /usr/bin/python3]
47+
pip install .[dev]
48+
49+
Alternatively you can locally install patches like this::
50+
51+
pip install --user -e .[dev]
52+
3253
You can setup your local environment for developing patches for cpplint like this:
3354

3455
.. code-block:: bash
3556
36-
pip install --user -e .[dev]
3757
./setup.py lint
3858
./setup.py style
3959
./setup.py test
@@ -53,12 +73,12 @@ To release a new version:
5373
git commit -m "Releasing x.y.z"
5474
git add cpplint.py changelog.rst
5575
# test-release (on env by mkvirtualenv -p /usr/bin/python3)
56-
pip install --upgrade setuptools wheels twine
76+
pip install --upgrade setuptools wheel twine
5777
twine upload --repository testpypi dist/*
5878
# ... Check website and downloads from https://test.pypi.org/project/cpplint/
5979
# Actual release
6080
python3 setup.py sdist bdist_wheel
61-
twine upload dist/*
81+
twine upload dist/*
6282
git tag x.y.z
6383
git push
6484
git push --tags

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import cpplint as cpplint
77

88
class Cmd(Command):
9+
'''
10+
Superclass for other commands to run via setup.py, declared in setup.cfg.
11+
These commands will auto-install setup_requires in a temporary folder.
12+
'''
913
user_options = [
1014
('executable', 'e', 'The executable to use for the command')
1115
]
@@ -21,6 +25,7 @@ def execute(self, *k):
2125

2226

2327
class Lint(Cmd):
28+
'''run with python setup.py lint'''
2429
description = 'Run linting of the code'
2530
user_options = Cmd.user_options + [
2631
('jobs', 'j', 'Use multiple processes to speed up the linting')

0 commit comments

Comments
 (0)