You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
289
324
290
325
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