Skip to content

Commit

Permalink
patch done
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Nov 30, 2024
1 parent 02e8788 commit b07d699
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 25 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# exclude:
# # exclude py3.12 for windows latest due UserWarning: Unsupported Windows version (2022server). ONNX Runtime supports Windows 10 and above, only.
# - os: windows-latest
# python-version: "3.12"

steps:

Expand All @@ -54,12 +50,6 @@ jobs:
# windows requires update pip via python module
python -m pip install --upgrade pip
- name: Patch onnxruntime warning
if: ${{ matrix.python-version == '3.12' && matrix.os == 'windows-latest' }}
run: |
git apply github-windows-py3_12.patch
cat credsweeper/ml_model/ml_validator.py
- name: Install application
run: |
python -m pip install .
Expand All @@ -81,6 +71,11 @@ jobs:
run: |
pip install pytest pytest-random-order deepdiff
- name: Suppress warning ``...Unsupported Windows version (2022server)...``
if: ${{ matrix.python-version == '3.12' && matrix.os == 'windows-latest' }}
run: |
echo "PYTHONWARNINGS=ignore::UserWarning:onnxruntime.capi.onnxruntime_validation:26" >> $env:GITHUB_ENV
- name: UnitTest with pytest
run: |
# put the command into one line to use in various OS to avoid processing differences in new line char sequence
Expand Down
2 changes: 2 additions & 0 deletions credsweeper/ml_model/ml_validator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import hashlib
import logging
import string
# import warnings
from pathlib import Path
from typing import List, Tuple, Union, Optional, Dict

Expand All @@ -12,6 +13,7 @@
import credsweeper.ml_model.features as features
from credsweeper.utils import Util

# warnings.filterwarnings("ignore", category=UserWarning, module='.*onnxruntime.*', message=".*2022server.*")
logger = logging.getLogger(__name__)


Expand Down
14 changes: 0 additions & 14 deletions github-windows-py3_12.patch

This file was deleted.

4 changes: 3 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

class TestApp(TestCase):

def setUp(self):
self.maxDiff = None

@staticmethod
def _m_credsweeper(args) -> Tuple[str, str]:
proc = subprocess.Popen(
Expand Down Expand Up @@ -325,7 +328,6 @@ def test_help_p(self) -> None:
else:
text = ' '.join([text, line])
expected = " ".join(text.split())
self.maxDiff = None
self.assertEqual(expected, output)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Expand Down

0 comments on commit b07d699

Please sign in to comment.