-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8bf75c
commit 5a5487f
Showing
5 changed files
with
83 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length=120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Contributing | ||
|
||
## Prerequisites | ||
|
||
### For Development | ||
|
||
- [Poetry](https://python-poetry.org/) | ||
|
||
### For Running Test Matrix | ||
|
||
- python 3.5 | ||
- python 3.7 | ||
- python 3.8 | ||
|
||
*multiple python interpreters can be installed and managed using [pyenv](https://github.com/pyenv/pyenv)* | ||
|
||
## Tasks | ||
|
||
Note that a [`Makefile`](./Makefile) is provided for common tasks | ||
|
||
### Installing Dependencies | ||
|
||
make install | ||
|
||
### Running tests | ||
|
||
make test | ||
|
||
### Running Matrix Tests | ||
|
||
*(requires multiple Python interpreters to be installed)* | ||
|
||
make test_matrix | ||
|
||
### Lint | ||
|
||
make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
test: | ||
poetry run nosetests -w tests | ||
|
||
test_matrix: | ||
poetry run nox --session test | ||
|
||
lint: | ||
poetry run nox --session lint | ||
|
||
all: | ||
poetry run nox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import nox | ||
import tempfile | ||
from pathlib import Path | ||
import os | ||
from distutils.dir_util import copy_tree | ||
|
||
python_versions = [ | ||
"3.8", | ||
] | ||
|
||
sphinx_versions = [ | ||
"^3.0", | ||
] | ||
|
||
@nox.session(python=python_versions, reuse_venv=True) | ||
@nox.parametrize("sphinx", sphinx_versions) | ||
def tests(session, sphinx): | ||
# see https://github.com/python-poetry/poetry/issues/2920#issuecomment-693147409 | ||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
copy_tree( | ||
Path.cwd(), tmp_dir | ||
) | ||
os.chdir(tmp_dir) | ||
|
||
session.run('poetry', 'add', f'sphinx@{sphinx}', external=True) | ||
session.run('poetry', 'install', external=True) | ||
session.run('nosetests', '-w', 'tests') | ||
|
||
@nox.session(python=None) | ||
def lint(session): | ||
session.run('flake8', 'sphinxcontrib', external=True) |