Skip to content

Commit

Permalink
Add isort and pytest to dev dependencies (#56)
Browse files Browse the repository at this point in the history
* add: dev dependencies to setup.cfg

* add: isort to dev deps and ci
  • Loading branch information
eggplants authored Apr 4, 2022
1 parent 39bf07b commit b25680c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/py-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r requirements_dev.txt
python -m pip install ".[dev]"
- name: Run unittest
run: python -m unittest discover -p 'test_*.py' -s tests
run: pytest
5 changes: 4 additions & 1 deletion .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements_dev.txt
pip install ".[dev]"
- name: Run isort
run: |
isort --diff --check .
- name: Run yapf
run: |
yapf --diff --recursive budoux tests scripts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ A training dataset is a large text file that consists of sentences separated by
Assuming the text file is saved as `mysource.txt`, you can build your own custom model by running the following commands.

```shellsession
$ pip install -r requirements_dev.txt
$ pip install .[dev]
$ python scripts/encode_data.py mysource.txt -o encoded_data.txt
$ python scripts/train.py encoded_data.txt -o weights.txt
$ python scripts/build_model.py weights.txt -o mymodel.json
Expand Down
2 changes: 1 addition & 1 deletion budoux/feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import sys
import typing

from .utils import SEP, INVALID, Result
from .utils import INVALID, SEP, Result

with open(os.path.join(os.path.dirname(__file__), 'unicode_blocks.json')) as f:
block_starts: typing.List[int] = json.load(f)
Expand Down
2 changes: 1 addition & 1 deletion budoux/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from html.parser import HTMLParser

from .feature_extractor import get_feature
from .utils import SEP, INVALID, Result
from .utils import INVALID, SEP, Result

MODEL_DIR = os.path.join(os.path.dirname(__file__), 'models')
PARENT_CSS_STYLE = 'word-break: keep-all; overflow-wrap: break-word;'
Expand Down
10 changes: 0 additions & 10 deletions requirements_dev.txt

This file was deleted.

15 changes: 15 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ packages = find:
include_package_data = True
test_suite = tests

[options.extras_require]
dev =
build
flake8
html5lib
isort
numpy
mypy
pytest
toml
twine
types-html5lib
types-setuptools
yapf

[options.entry_points]
console_scripts =
budoux = budoux.main:main
Expand Down

0 comments on commit b25680c

Please sign in to comment.