Skip to content

Commit

Permalink
replace 'tox' with 'nox'
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Sep 16, 2020
1 parent d8bf75c commit 5a5487f
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length=120
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
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
13 changes: 13 additions & 0 deletions Makefile
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
31 changes: 31 additions & 0 deletions noxfile.py
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)
28 changes: 0 additions & 28 deletions tox.ini

This file was deleted.

0 comments on commit 5a5487f

Please sign in to comment.