Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
# The GitHub editor is 127 chars wide
max-line-length = 127
max-complexity = 10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data/models/ELMo/en/cache
data/models/ELMo/fr/cache
data/sequenceLabelling/CoNLL-2012-NER/eng.*
env
venv
dist
delft.egg-info
build
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ python:
- 3.5
install:
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install flake8
- make venv-create dev-install
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- make flake8-syntax flake8-warning-only
script:
- true # add other tests here
notifications:
Expand Down
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
VENV = venv

PIP = $(VENV)/bin/pip
PYTHON = $(VENV)/bin/python
RUN_GROBID_TAGGER = $(PYTHON) grobidTagger.py
USE_GPU = 0

ARGS =


venv-clean:
@if [ -d "$(VENV)" ]; then \
rm -rf "$(VENV)"; \
fi


venv-create:
virtualenv --system-site-packages -p python3 $(VENV)


dev-install:
$(PIP) install -r requirements.txt
$(PIP) install -r requirements.dev.txt
@if [ "$(USE_GPU)" -eq "1" ]; then \
$(PIP) install -r requirements.gpu.txt; \
else \
$(PIP) install -r requirements.cpu.txt; \
fi


dev-venv: venv-create dev-install


flake8-syntax:
# stop the build if there are Python syntax errors or undefined names
$(PYTHON) -m flake8 delft *.py --count --select=E901,E999,F821,F822,F823 --show-source --statistics


flake8-warning-only:
# exit-zero treats all errors as warnings.
$(PYTHON) -m flake8 delft *.py --count --exit-zero --statistics


flake8:
$(PYTHON) -m flake8 delft *.py


pylint:
$(PYTHON) -m pylint delft *.py


tests: flake8 pylint


grobid-tagger-train-header:
$(RUN_GROBID_TAGGER) header train $(ARGS)
1 change: 1 addition & 0 deletions requirements.cpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==1.12.0
2 changes: 2 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flake8==3.7.7
pylint==2.3.1
1 change: 1 addition & 0 deletions requirements.gpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow_gpu==1.12.0
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ bleach>=2.1.0
regex==2018.2.21
scikit-learn==0.19.1
tqdm==4.21
tensorflow_gpu==1.12.0
gensim==3.4.0
langdetect==1.0.7
textblob==0.15.1
Expand Down