Skip to content

Commit

Permalink
Merge pull request #134 from CDU-data-science-team/0.5.5
Browse files Browse the repository at this point in the history
0.5.5
  • Loading branch information
yiwen-h committed Sep 1, 2023
2 parents 0bd2b53 + c7806c3 commit 95e56e0
Show file tree
Hide file tree
Showing 40 changed files with 12,657 additions and 2,148 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ omit = tests\*
*\params.py
api\test_api.py
setup.py
test_rules.py

source = api
pxtextmining

[report]
exclude_lines =
if __name__ == .__main__.:
8 changes: 8 additions & 0 deletions .github/workflows/test_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- development
- main

jobs:
build:
Expand All @@ -20,6 +21,8 @@ jobs:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Ruff
uses: chartboost/ruff-action@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -29,3 +32,8 @@ jobs:
run: poetry install --with dev
- name: Run tests
run: poetry run pytest tests/* -sx
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version }} == "3.10"
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
exclude: '(build|datasets|current_best_multilabel|docs)/.*'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
name: Check for files larger than 75 MB
args: [ "--maxkb=750000" ]
- id: end-of-file-fixer
name: Check for a blank line at the end of scripts (auto-fixes)
exclude: 'json'
- id: trailing-whitespace
name: Check for trailing whitespaces (auto-fixes)
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort - Sort Python imports (auto-fixes)
args: [ "--profile", "black", "--filter-files" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.272
hooks:
- id: ruff
name: Ruff linting
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
name: black - consistent Python code formatting (auto-fixes)
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.10.12-slim-bookworm
VOLUME /data

COPY docker-requirements.txt requirements.txt
RUN pip install --upgrade pip setuptools \
&& pip install -r requirements.txt \
&& rm -rf /root/.cache

COPY api/bert_sentiment bert_sentiment
COPY --chmod=755 docker_run.py docker_run.py

LABEL org.opencontainers.image.source=https://github.com/cdu-data-science-team/pxtextmining

ENTRYPOINT ["python3", "docker_run.py"]
166 changes: 90 additions & 76 deletions api/requirements.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 95e56e0

Please sign in to comment.