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

Add isort and pytest to dev dependencies #56

Merged
merged 2 commits into from
Apr 4, 2022
Merged
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
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