Skip to content

Commit

Permalink
chore: enable mypy and small style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
k4black committed Nov 17, 2023
1 parent 2f6f4c1 commit 4d3eace
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ jobs:
cp -r evaluate_app/* hf_evaluate_codebleu
cd hf_evaluate_codebleu
git add .
git commit --allow-empty -m "Auto files update [${{ github.ref_name }}]"
git commit --allow-empty -m "chore(auto): update changelog and version [${{ github.ref_name }}]"
ls -lah
git push https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu main
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
branches: [ main ]


# TODO: add windows-latest build

jobs:
lint-python:
runs-on: ubuntu-latest
Expand All @@ -27,8 +25,8 @@ jobs:
run: python -m black codebleu --check
- name: Run ruff check
run: python -m ruff codebleu
# - name: Run mypy check
# run: python -m mypy codebleu
- name: Run mypy check
run: python -m mypy codebleu

# First run tests to fail fast, then testing on all python versions and os
fast-tests-python:
Expand Down
20 changes: 4 additions & 16 deletions evaluate_app/tests.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
test_cases = [
{
"predictions": [0, 0],
"references": [1, 1],
"result": {"metric_score": 0}
},
{
"predictions": [1, 1],
"references": [1, 1],
"result": {"metric_score": 1}
},
{
"predictions": [1, 0],
"references": [1, 1],
"result": {"metric_score": 0.5}
}
]
{"predictions": [0, 0], "references": [1, 1], "result": {"metric_score": 0}},
{"predictions": [1, 1], "references": [1, 1], "result": {"metric_score": 1}},
{"predictions": [1, 0], "references": [1, 1], "result": {"metric_score": 0.5}},
]
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import requests
from setuptools import setup
from setuptools.dist import Distribution

from tree_sitter import Language

ROOT = Path(__file__).parent
Expand Down Expand Up @@ -59,7 +58,7 @@ def build_tree_sitter_languages(languages: dict[str, str], languages_folder: Pat

build_tree_sitter_languages(
tree_sitter_languages,
ROOT / "tree_sitter",
ROOT / "tree_sitter_languages",
ROOT / "codebleu" / "my-languages.so",
)

Expand Down

0 comments on commit 4d3eace

Please sign in to comment.