Skip to content

Commit 3a682eb

Browse files
authored
Merge pull request #56 from dayyass/develop
release v0.1.0
2 parents 4bcb627 + dd07adb commit 3a682eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+325805
-509
lines changed

.coveragerc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[run]
2+
branch = True
3+
source = pytorch_ner
4+
5+
[report]
6+
exclude_lines =
7+
pragma: no cover
8+
if self\.debug
9+
raise AssertionError
10+
raise NotImplementedError
11+
if __name__ == .__main__.:
12+
13+
omit =
14+
pytorch_ner/__main__.py
15+
16+
show_missing = True
17+
ignore_errors = False

.dockerignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/codecov.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will install Python dependencies and run codecov
2+
# https://github.com/codecov/codecov-action#example-workflowyml-with-codecov-action
3+
4+
name: codecov
5+
6+
on:
7+
push:
8+
branches: [main, develop]
9+
pull_request:
10+
branches: [main, develop]
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
steps:
19+
- uses: actions/checkout@master
20+
- name: Set up Python
21+
uses: actions/setup-python@master
22+
with:
23+
python-version: 3.7
24+
- name: Install dependencies
25+
run: |
26+
pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install pytest pytest-cov
29+
- name: Generate coverage report
30+
run: |
31+
pytest --cov=./ --cov-report=xml
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v2
34+
with:
35+
flags: unittests
36+
env_vars: OS,PYTHON
37+
fail_ci_if_error: true
38+
verbose: true

.github/workflows/lint.yml renamed to .github/workflows/linter.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
1+
# This workflow will install Python dependencies and run linter
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: lint
4+
name: linter
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main, develop]
99
pull_request:
10-
branches: [ main ]
10+
branches: [main, develop]
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
1518
steps:
1619
- uses: actions/checkout@v2
17-
- name: Set up Python 3.8
20+
- name: Set up Python
1821
uses: actions/setup-python@v2
1922
with:
20-
python-version: 3.8
23+
python-version: 3.7
2124
- name: Install dependencies
2225
run: |
23-
python -m pip install --upgrade pip
26+
pip install --upgrade pip
2427
pip install isort black flake8 types-PyYAML mypy
2528
- name: Code format check with isort
2629
run: |
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
1+
# This workflow will install Python dependencies and run tests with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: test
4+
name: tests
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main, develop]
99
pull_request:
10-
branches: [ main ]
10+
branches: [main, develop]
1111

1212
jobs:
1313
build:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ['3.6', '3.7', '3.8']
18-
os: [ubuntu-latest] # macOS-latest, windows-latest
17+
python-version: ['3.6', '3.7', '3.8', '3.9']
18+
os: [ubuntu-latest, macOS-latest, windows-latest]
1919
steps:
2020
- uses: actions/checkout@v2
21-
- name: Set up Python ${{ matrix.python-version }}
21+
- name: Set up Python
2222
uses: actions/setup-python@v2
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install dependencies
2626
run: |
27-
python -m pip install --upgrade pip
28-
python -m pip install pytest
27+
pip install --upgrade pip
2928
pip install -r requirements.txt
30-
- name: Test with pytest
29+
- name: Tests
3130
run: |
32-
pytest
31+
python -m unittest discover

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
*.DS_Store
2-
*__pycache__/
3-
*.pyc
4-
/venv/
5-
/models/
2+
.python-version
3+
*.ipynb
4+
*.ipynb_checkpoints
5+
6+
# cache
7+
*__pycache__
8+
*.mypy_cache
9+
*.cache
10+
11+
# coverage
12+
*.coverage
13+
*coverage.xml
14+
15+
venv
616
.idea
17+
dist
18+
19+
*.egg-info
20+
21+
models/*
22+
!models/README.md

.pre-commit-config.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.3.0
4-
hooks:
5-
- id: no-commit-to-branch
6-
args: ['--branch', 'main']
2+
73
- repo: https://github.com/pre-commit/mirrors-isort
84
rev: v5.6.4
95
hooks:
106
- id: isort
117
args: ["--profile", "black"]
8+
129
- repo: https://github.com/psf/black
1310
rev: 20.8b1
1411
hooks:
1512
- id: black
13+
1614
- repo: https://github.com/pre-commit/pre-commit-hooks
1715
rev: v2.3.0
1816
hooks:
17+
- id: flake8
18+
args: ["--ignore", "E501,W503"]
19+
- id: check-json
1920
- id: check-yaml
20-
- id: name-tests-test
21-
args: ['--django']
21+
# - id: name-tests-test
22+
# args: ['--django']
2223
- id: debug-statements
24+
- id: end-of-file-fixer
25+
types: [python]
2326
- id: trailing-whitespace
2427
- id: check-docstring-first
2528
- id: requirements-txt-fixer
26-
- id: flake8
27-
args: ["--ignore", "E501,W503"]
29+
- id: check-added-large-files
30+
2831
- repo: https://github.com/pre-commit/mirrors-mypy
2932
rev: v0.790
3033
hooks:

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM pytorch/pytorch:1.6.0-cuda10.1-cudnn7-runtime
1+
FROM python:3.7-slim-buster
22
MAINTAINER Dani El-Ayyass <[email protected]>
33

4-
COPY requirements.txt .
4+
WORKDIR /workdir
55

6-
RUN pip install --upgrade pip
7-
RUN pip install -r requirements.txt
6+
COPY config.yaml ./
7+
COPY data/conll2003/* data/conll2003/
88

9-
EXPOSE 6006
10-
VOLUME /workspace
11-
WORKDIR /workspace
9+
RUN pip install --upgrade pip && \
10+
pip install --no-cache-dir pytorch-ner
1211

12+
CMD ["bash"]

0 commit comments

Comments
 (0)