Skip to content

Commit

Permalink
Package maintenance (#44)
Browse files Browse the repository at this point in the history
* Add some demo content to *ignore files

* update dependencies

* update some type annotations

* Add tests for orchestration

* Document new orchestration parameter

* update dependency versions and lock file

* update notebook metadata

* update dependencies in poetry lock file

* add isort config to keep the sorting of imports under control a bit

* revert src structure thanks to flit being a bit strict

* update widget use to silence / fix deprecation warnings

* fix type annotations

* add a rtd config file

* update the testing pipeline

* update the install method on travis

* Add some dependency versions for better install experience

* remove black, flake8 from test deps (should be dev deps)

* make travis run a bit smooother

* removing py 3.5 from test suite

* installing example dependencies in travis

* update python dependencies [ci skip]

* Removing poetry lock file [ci skip]

* add mypy to testing stages

* Document abstract methods in queueing module

* Try to re-enable matrix expansion of unit tests in travis

* fix the travis pipeline to make it how it used to be

* Version bump [ci skip]
  • Loading branch information
janfreyberg authored Sep 29, 2019
1 parent 3621cc9 commit 5c392a8
Show file tree
Hide file tree
Showing 42 changed files with 405 additions and 1,451 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.venv/*
.hypothesis/*
.pytest_cache/*
.vscode/*
htmlcov/*
pip-wheel-metadata/*
dist/*
*Dockerfile
postgres-data
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ api/config.ini
scratchpad.ipynb
.mypy_cache/
.coverage*
postgres-data/

.DS_Store
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[isort]
skip=tests/,.venv/
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
repos:
- repo: https://github.com/pre-commit/mirrors-isort
rev: HEAD # Use the revision sha / tag you want to point at
rev: v4.3.21 # Use the revision sha / tag you want to point at
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: stable
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
rev: v2.3.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.730 # Use the sha / tag you want to point at
hooks:
- id: mypy
8 changes: 8 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
system_packages: true
41 changes: 23 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,48 @@ stages:
- "Static code analysis"
- test
- deploy
notifications:
email: false
python:
- "3.5"
- "3.6"
- "3.7"
notifications:
email: false
install:
- pip install --upgrade pip
- pip install poetry
- poetry install
script:
# run tests, and get coverage:
- poetry run python -m pytest --cov=src/
- python -m pytest --cov=superintendent/
# test that the notebooks all run smoothly
- find docs -name '*.ipynb' -o -name 'examples/*.ipynb' | xargs poetry run jupyter nbconvert --to notebook --execute
- find docs -name '*.ipynb' -o -name 'examples/*.ipynb' | xargs jupyter nbconvert --to notebook --execute
# submit coverage report to coveralls
- poetry run coveralls
- python -m coveralls
install:
- pip install -qq --upgrade pip
- pip install -q '.[test,examples]'
jobs:
include:
- stage: "Static code analysis"
name: "black formatting test"
script:
install:
- pip install -qq black
- black --check src/
script:
- black --check superintendent/
python: "3.7"
install: skip
- stage: "Static code analysis"
name: "flake8 check"
script:
install:
- pip install -qq flake8 docargs
- flake8 src/
script:
- flake8 superintendent/
python: "3.7"
- stage: "Static code analysis"
name: "mypy check"
script:
- mypy --ignore-missing-imports superintendent/
python: "3.7"
install: skip
install:
- pip install -qq mypy
- stage: deploy
name: "Deploy to pypi"
if: tag IS present
script:
- poetry build
- poetry publish --username $PYPI_USER --password $PYPI_PASSWORD
- flit build
- env FLIT_USERNAME=$PYPI_USER FLIT_PASSWORD=$PYPI_PASSWORD flit publish
python: "3.7"
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@

![](logo.png)

**`superintendent`** provides an `ipywidget`-based interactive labelling tool for your data. It allows you to flexibly label all kinds of data. It also allows you to combine your data-labelling task with a statistical or machine learning model to enable quick and practical active learning.
**`superintendent`** provides an `ipywidget`-based interactive labelling tool
for your data. It allows you to flexibly label all kinds of data. It also allows
you to combine your data-labelling task with a statistical or machine learning
model to enable quick and practical active learning.

## Getting started

Take a look at the documentation: http://www.janfreyberg.com/superintendent/

It has some explanations of how the library works, and it also has many examples.
It has some explanations of how the library works, and it also has many
examples.

If you'd like to try the library without installing it, check out the [repository on binder](https://mybinder.org/v2/gh/janfreyberg/superintendent/master?filepath=examples.ipynb).
If you'd like to try the library without installing it, check out the
[repository on binder](https://mybinder.org/v2/gh/janfreyberg/superintendent/master?filepath=examples.ipynb).

## Installation

Expand All @@ -35,10 +40,13 @@ also have to enable the ipyevents jupyter extension:
jupyter nbextension enable --py --sys-prefix ipyevents
```

If you also want to run the examples, you need three additional packages: `requests`, `bs4` and `wordcloud`. You can install them via pip by running:
If you also want to run the examples, you need three additional packages:
`requests`, `bs4` and `wordcloud`. You can install them via pip by running:

```
pip install superintendent[examples]
```

If you want to contribute to `superintendent`, you will need to install the test dependencies as well. You can do so with `pip install superintendent[tests,examples]`
If you want to contribute to `superintendent`, you will need to install the test
dependencies as well. You can do so with
`pip install superintendent[tests,examples]`
4 changes: 2 additions & 2 deletions docs/examples/labelling-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.7.0"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down Expand Up @@ -1618,5 +1618,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion docs/examples/labelling-text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.7.3"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
2 changes: 1 addition & 1 deletion examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 5c392a8

Please sign in to comment.