Skip to content

Commit

Permalink
Merge pull request #1 from Totto16/python3.12
Browse files Browse the repository at this point in the history
Python3.12
  • Loading branch information
Totto16 authored Nov 20, 2024
2 parents a5d4991 + f81299e commit f0fb08c
Show file tree
Hide file tree
Showing 23 changed files with 1,676 additions and 109 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,67 @@
name: Python Lints / Checks

on:
pull_request:
push:
branches:
- main

jobs:
mypy_lint:
name: Lint with Mypy
runs-on: ubuntu-latest
name: Lint with Mypy and Ruff
runs-on: ubuntu-24.04
container:
image: python:3.11-bookworm
image: python:3.12-bookworm
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
apt-get update
apt-get install cmake --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
- name: run lint
run: |
pipenv run mypy
pipenv run ruff-ci
pipenv run ruff-ci github
tests:
name: Test with pytest
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
container:
image: python:3.11-bookworm
image: python:3.12-bookworm
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
apt-get update
apt-get install ffmpeg cmake --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
apt-get update
apt-get install ffmpeg -y
- name: run tests
run: |
pipenv run test
sonarqube_checks:
name: SonarQube Checks
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- mypy_lint
- tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
sudo apt-get update
sudo apt-get install python3.11 --install-recommends ffmpeg -y
sudo apt-get install python3.12 ffmpeg --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
- name: run coverage report
Expand All @@ -75,7 +78,7 @@ jobs:
project: "Video Language Detection"
path: "."
format: HTML
out: "reports" # this is the default, no need to specify unless you wish to override it
out: "reports"
args: >
--failOnCVSS 7
--enableRetired
Expand All @@ -85,8 +88,6 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__pycache__
.mypy_cache
Pipfile.lock
model/
/src/tmp/
/data/
Expand All @@ -9,3 +8,4 @@ model/
/.coverage
/coverage.xml
/config.ini
/config.yaml
12 changes: 6 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ stages: # List of stages for jobs, and their order of execution
python-lint-job:
stage: python_checks
allow_failure: false
image: python:3.11-bookworm
image: python:3.12-bookworm
script:
- pip install pipenv -U --quiet
- pipenv install --dev
- pipenv run lint
- pipenv run mypy
- pipenv run ruff-ci gitlab

python-test-job:
stage: python_checks
allow_failure: false
image: python:3.11-bookworm
image: python:3.12-bookworm
script:
- pip install pipenv -U --quiet
- pipenv install --dev
- apt-get update
- apt-get install ffmpeg -y
- apt-get install ffmpeg --no-install-recommends -y
- pipenv run test

sonarqube-check:
Expand All @@ -42,9 +43,8 @@ sonarqube-check:
script:
- pip install pipenv -U --quiet
- pipenv install --dev
# TODO:check if this is even debian / ubuntu or alpine and install ffprobe
- sudo apt-get update
- sudo apt-get install ffmpeg -y
- sudo apt-get install ffmpeg --no-install-recommends -y
- pipenv run coverage
- sonar-scanner
allow_failure: false
Expand Down
1 change: 1 addition & 0 deletions IMDB/imdb-dataset-parser
Submodule imdb-dataset-parser added at b84b9c
2 changes: 1 addition & 1 deletion IMDB2sql
13 changes: 8 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"


[packages]
python-ffmpeg = "*"
torchaudio = "*"
speechbrain = "*"
torchvision = "*"
torch = "*"
speechbrain = "*"
python-ffmpeg = "*"
pynvml = "*"
humanize = "*"
enlighten = "*"
Expand All @@ -32,9 +35,9 @@ chardet = "*"
[scripts]
check = "python src/entry.py"
lint = "bash -c 'pipenv run mypy && pipenv run ruff'"
mypy = "mypy src/ tests/ ffmpeg/ --strict --ignore-missing-imports --enable-incomplete-feature=Unpack "
mypy = "mypy src/ tests/ ffmpeg/ --strict --ignore-missing-imports"
ruff = "ruff check src/ tests/ ffmpeg/"
ruff-ci = "ruff check src/ tests/ ffmpeg/ --format=github"
ruff-ci = "ruff check src/ tests/ ffmpeg/ --output-format"
ruff-fix = "ruff check src/ tests/ ffmpeg/ --fix"
schema = "python src/entry.py schema"
test = "pytest tests/"
Expand All @@ -43,4 +46,4 @@ extract_translation = "pygettext3 -d video_language_detect -o locales/video_lang
generate_translation = "bash -c 'for PO_FILE in locales/*/LC_MESSAGES/*.po; do MO_FILE=\"${PO_FILE/.po/.mo}\"; msgfmt -o \"$MO_FILE\" \"$PO_FILE\"; done'"

[requires]
python_version = "3.11"
python_version = "3.12"
Loading

0 comments on commit f0fb08c

Please sign in to comment.