Az-r-ow
commited on
Commit
·
d1c7aff
1
Parent(s):
4fbdbc2
ci(data_processing): updated ci to test all test files recursively
Browse files- .github/workflows/build.yml +26 -28
- .gitignore +4 -0
- app/travel_resolver/tests/data_processing_test.py +0 -1
.github/workflows/build.yml
CHANGED
|
@@ -5,17 +5,16 @@ name: CI
|
|
| 5 |
|
| 6 |
on:
|
| 7 |
push:
|
| 8 |
-
branches:
|
| 9 |
-
- "**"
|
| 10 |
- "!gh-pages"
|
| 11 |
pull_request:
|
| 12 |
-
branches:
|
| 13 |
- "**"
|
| 14 |
- "!gh-pages"
|
| 15 |
|
| 16 |
jobs:
|
| 17 |
build:
|
| 18 |
-
|
| 19 |
runs-on: ubuntu-latest
|
| 20 |
strategy:
|
| 21 |
fail-fast: false
|
|
@@ -23,27 +22,26 @@ jobs:
|
|
| 23 |
python-version: ["3.12"]
|
| 24 |
|
| 25 |
steps:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
python -m unittest travel_resolver.tests.langage_detection_test
|
|
|
|
| 5 |
|
| 6 |
on:
|
| 7 |
push:
|
| 8 |
+
branches:
|
| 9 |
+
- "**"
|
| 10 |
- "!gh-pages"
|
| 11 |
pull_request:
|
| 12 |
+
branches:
|
| 13 |
- "**"
|
| 14 |
- "!gh-pages"
|
| 15 |
|
| 16 |
jobs:
|
| 17 |
build:
|
|
|
|
| 18 |
runs-on: ubuntu-latest
|
| 19 |
strategy:
|
| 20 |
fail-fast: false
|
|
|
|
| 22 |
python-version: ["3.12"]
|
| 23 |
|
| 24 |
steps:
|
| 25 |
+
- uses: actions/checkout@v4
|
| 26 |
+
- name: Set up Python ${{ matrix.python-version }}
|
| 27 |
+
uses: actions/setup-python@v3
|
| 28 |
+
with:
|
| 29 |
+
python-version: ${{ matrix.python-version }}
|
| 30 |
+
|
| 31 |
+
- name: Install dependencies
|
| 32 |
+
run: |
|
| 33 |
+
python -m pip install --upgrade pip
|
| 34 |
+
python -m pip install flake8 pytest
|
| 35 |
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
| 36 |
+
|
| 37 |
+
- name: Lint with flake8
|
| 38 |
+
run: |
|
| 39 |
+
# stop the build if there are Python syntax errors or undefined names
|
| 40 |
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
| 41 |
+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
| 42 |
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
| 43 |
+
|
| 44 |
+
- name: Test libs
|
| 45 |
+
run: |
|
| 46 |
+
cd ./app && \
|
| 47 |
+
python -m unittest discover travel_resolver.tests -p "*_test.py"
|
|
|
.gitignore
CHANGED
|
@@ -162,3 +162,7 @@ cython_debug/
|
|
| 162 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 163 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 164 |
#.idea/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 163 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 164 |
#.idea/
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
# Remove test ouptuts
|
| 168 |
+
output.*
|
app/travel_resolver/tests/data_processing_test.py
CHANGED
|
@@ -2,7 +2,6 @@ import unittest
|
|
| 2 |
from pathlib import Path
|
| 3 |
from travel_resolver.libs.nlp.data_processing import (
|
| 4 |
get_tagged_content,
|
| 5 |
-
process_sentence,
|
| 6 |
convert_tagged_sentence_to_bio,
|
| 7 |
from_tagged_file_to_bio_file,
|
| 8 |
from_bio_file_to_examples,
|
|
|
|
| 2 |
from pathlib import Path
|
| 3 |
from travel_resolver.libs.nlp.data_processing import (
|
| 4 |
get_tagged_content,
|
|
|
|
| 5 |
convert_tagged_sentence_to_bio,
|
| 6 |
from_tagged_file_to_bio_file,
|
| 7 |
from_bio_file_to_examples,
|