Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to Poetry #154

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,18 @@ python:
- '3.7'
- '3.8'

# Travis python3.7 workaround
# See https://github.com/travis-ci/travis-ci/issues/9815
#matrix:
# include:
# - python: 3.7
# dist: xenial
# sudo: true

before_install:
- sudo apt-get update
- sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk texlive-luatex texlive-xetex
- pip install poetry

install:
- pip install tox-travis
- python setup.py install
- poetry install
script:
- tox
- poetry run nox

after_success:
- which python
- pip install sphinxcontrib-plantuml
- cd docs
- make latexpdf

39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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

*you must install the dependencies before running other tasks*

### 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
4 changes: 0 additions & 4 deletions doc-requirements.txt

This file was deleted.

38 changes: 38 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import nox
import tempfile
from pathlib import Path
import os
from distutils.dir_util import copy_tree

python_versions = [
"3.5",
"3.6",
"3.7",
"3.8",
]

sphinx_versions = [
"~2.2",
"~2.3",
"~2.4",
"~3.0",
"~3.2",
]

@nox.session(python=python_versions, reuse_venv=True)
@nox.parametrize("sphinx", sphinx_versions)
def test(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)