Skip to content

Commit 0018d20

Browse files
committed
Update docs
1 parent cc67416 commit 0018d20

File tree

2 files changed

+65
-29
lines changed

2 files changed

+65
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.eggs/
55
.idea
66
.nox/
7+
.python-version
78
b2.egg-info
89
build
910
coverage.xml

README.md

+64-29
Original file line numberDiff line numberDiff line change
@@ -256,35 +256,70 @@ We encourage outside contributors to perform changes on our codebase. Many such
256256

257257
* provide guidance (through the issue reporting system)
258258
* provide tool assisted code review (through the Pull Request system)
259+
* maintain a set of unit tests
259260
* maintain a set of integration tests (run with a production cloud)
260-
* maintain a set of (well over a hundred) unit tests
261-
* automatically run unit tests on 14 versions of python (including osx, Jython and pypy)
262-
* format the code automatically using [yapf](https://github.com/google/yapf)
263-
* use static code analysis to find subtle/potential issues with maintainability
264-
* maintain other Continous Integration tools (coverage tracker)
265-
266-
You'll need to some Python packages installed. To get all the latest things:
267-
268-
* `pip install --upgrade --upgrade-strategy eager -r requirements.txt -r requirements-test.txt -r requirements-setup.txt`
269-
270-
There is a `Makefile` with a rule to run the unit tests using the currently active Python:
271-
272-
make setup
273-
make test
274-
275-
will install the required packages, then run the unit tests.
276-
277-
To test in multiple python virtual environments, set the enviroment variable `PYTHON_VIRTUAL_ENVS`
278-
to be a space-separated list of their root directories. When set, the makefile will run the
279-
unit tests in each of the environments.
280-
281-
Before checking in, use the `pre-commit.sh` script to check code formatting, run
282-
unit tests, run integration tests etc.
283-
284-
The integration tests need a file in your home directory called `.b2_auth`
285-
that contains two lines with nothing on them but your application key ID and application key:
286-
287-
applicationKeyId
288-
applicationKey
261+
* maintain development automation tools using [nox](https://github.com/theacodes/nox) that can easily:
262+
* format the code using [yapf](https://github.com/google/yapf)
263+
* runs linters to find subtle/potential issues with maintainability
264+
* run the test suite on multiple Python versions using [pytest](https://github.com/pytest-dev/pytest)
265+
* maintain Continuous Integration (by using GitHub Actions) that:
266+
* runs all sorts of linters
267+
* checks if the Python distribution can be built
268+
* runs all tests on a matrix of 6 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows)
269+
* checks if the documentation can be built properly
270+
* maintain other Continuous Integration tools (coverage tracker)
271+
272+
You'll need to have [nox](https://github.com/theacodes/nox) installed:
273+
274+
* `pip install nox`
275+
276+
With `nox`, you can run different sessions (default are `lint` and `test`):
277+
278+
* `format` -> Format the code.
279+
* `lint` -> Run linters.
280+
* `test` (`test-3.5`, `test-3.6`, `test-3.7`, `test-3.8`) -> Run test suite.
281+
* `cover` -> Perform coverage analysis.
282+
* `build` -> Build the distribution.
283+
* `deploy` -> Deploy the distribution to the PyPi.
284+
* `doc` -> Build the documentation.
285+
* `doc_cover` -> Perform coverage analysis for the documentation.
286+
287+
For example:
288+
289+
$ nox -s format
290+
nox > Running session format
291+
nox > Creating virtual environment (virtualenv) using python3.8 in .nox/format
292+
...
293+
294+
$ nox --no-venv -s format
295+
nox > Running session format
296+
...
297+
298+
$ nox -s test
299+
nox > Running session test-3.5
300+
...
301+
nox > Running session test-3.6
302+
...
303+
nox > Running session test-3.7
304+
...
305+
nox > Running session test-3.8
306+
...
307+
308+
$ nox -s test-3.8
309+
nox > Running session test-3.8
310+
nox > Re-using existing virtual environment at .nox/test-3-8.
311+
...
312+
313+
Session `test` can run on many python versions.
314+
In order to do it, given Python interpreter must be installed in the operating system or via [pyenv](https://github.com/pyenv/pyenv).
315+
316+
Sessions other than `test` use the latest stable Python. You can change it:
317+
318+
export PYTHON_DEFAULT_VERSION=3.7
319+
320+
The integration tests need two environment variables:
321+
322+
export TEST_APPLICATION_KEY=your_app_key
323+
export TEST_APPLICATION_KEY_ID=your_app_key_id
289324

290325
We marked the places in the code which are significantly less intuitive than others in a special way. To find them occurrences, use `git grep '*magic*'`.

0 commit comments

Comments
 (0)