From b285c738b5311aa2a0f4e15e712a79907c6560df Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Fri, 17 Oct 2025 23:25:33 +0300 Subject: [PATCH 01/10] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BA=D1=83=D1=87=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_heap_sort.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test_heap_sort.py diff --git a/test_heap_sort.py b/test_heap_sort.py new file mode 100644 index 0000000..ed0d48c --- /dev/null +++ b/test_heap_sort.py @@ -0,0 +1,25 @@ +from heap_sort import heap_sort + +# unit тесты +def test_unit_sort_1(): + assert heap_sort([1,32253,3,533,5,0]) == [0, 1, 3, 5, 533, 32253] + +def test_unit_sort_2(): + assert heap_sort([9, 8, 7, 6, 5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5, 6, 7, 8, 9] + +# критические случаи +def test_crit_case_sort_1(): + assert heap_sort([1, 1, 1, 1, 1, 1]) == [1, 1, 1, 1, 1, 1] + +def test_crit_case_sort_2(): + assert heap_sort([0, 1, 3, 5, 533, 32253]) == [0, 1, 3, 5, 533, 32253] + +def test_crit_case_sort_3(): + assert heap_sort([1]) == [1] + +def test_crit_case_sort_4(): + assert heap_sort([]) == [] + +# property based тест с другой реализованной сортировкой +def test_prop_based_sort(): + assert sorted([1,32253,3,533,5,0]) == heap_sort([1,32253,3,533,5,0]) From e42219af2f34bf3664ca1034b13910e74e4c4823 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Fri, 17 Oct 2025 23:26:18 +0300 Subject: [PATCH 02/10] =?UTF-8?q?=D0=A1=D0=BE=D1=80=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BA=D1=83=D1=87=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- heap_sort.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 heap_sort.py diff --git a/heap_sort.py b/heap_sort.py new file mode 100644 index 0000000..bc31788 --- /dev/null +++ b/heap_sort.py @@ -0,0 +1,45 @@ +# функция для постройки максимальной кучи +def built_heap(array, lenght, ind): + + # создание корня и потомков + large = ind + left = ind * 2 + 1 + right = ind * 2 +2 + + # сравнивание корня с потомками и проверка существования потомков + if left < lenght and array[large] < array[left]: + large = left + + if right < lenght and array[large] < array[right]: + large = right + + # если наибольший элемент не корень, меняем значения местами и делаем рекурсию + if large != ind: + array[ind], array[large] = array[large], array[ind] + built_heap(array, lenght, large) + + +def heap_sort(array): + lenght = len(array) + + # построение максимальной кучи, начиная с последнего узла + for ind in range(lenght // 2 - 1, -1, -1): + built_heap(array, lenght, ind) + + # извлечение элементов из кучи + for ind in range(lenght - 1, 0, -1): + + # перемещаем корень в конец, т.к. это макс элемент + array[ind], array[0] = array[0], array[ind] + + # создаем уже уменьшанную кучу + built_heap(array, ind, 0) + + return array + + + + +# a = [1,32253,3,533,5,0] +# heap_sort(a) +# print(a) \ No newline at end of file From 9befb838967c6d1c59f50c3c3fafb1ba12da2512 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Fri, 17 Oct 2025 23:31:56 +0300 Subject: [PATCH 03/10] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D0=B1=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0fcacce --- /dev/null +++ b/requirements.txt @@ -0,0 +1,54 @@ +26 aur/amd-disable-c6 1.0-1 (+0 0.00) + Disable AMD C6 state on boot to prevent Ryzen freezes +25 aur/saturn-git 1.1.1.r4.g310bd4d-1 (+0 0.00) + Your go-to ToS Compliant Custom Deezer Client - Freezer Reborn +24 aur/netdata-v1 2.2.6-3 (+0 0.00) + Real-time performance monitoring. Freeze the version on 2.2.6 since version 2.3.0 has deprecated UI v1 +23 aur/strix-claw r6.78eef095b3-1 (+0 0.00) (сирота в AUR) + Daemon that prevents freezes of Asus Strix Claw mice +22 aur/pip-chill 1.0.3-1 (+0 0.00) + A more relaxed pip freeze +21 aur/hyprfreeze-git 1.1.2.r2.6b67416-2 (+1 0.00) + Utility to suspend a game process (and other programs) in Hyprland +20 aur/saturn-bin 1.1.1-2 (+1 0.00) + Your go-to ToS Compliant Custom Deezer Client - Freezer Reborn +19 aur/obs-freeze-filter 0.3.5-1 (+1 0.00) + Filter to freeze a frame of a source +18 aur/python-cx-freeze 8.4.1-1 (+1 0.00) + Create standalone executables from Python scripts +17 aur/python-frozen-flask 1.0.2-1 (+0 0.00) + Freezes a Flask application into a set of static files +16 aur/still 0.0.7-1 (+1 0.75) + Freeze the screen of a Wayland compositor until a provided command exits +15 aur/linux-baytrail49-docs 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) + Kernel hackers manual - HTML documentation that comes with the Linux-baytrail49 kernel with baytrail freeze fixes +14 aur/linux-baytrail49-headers 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) + Header files and scripts for building modules for Linux-baytrail49 kernel with baytrail freeze fixes +13 aur/linux-baytrail49 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) + The Linux-baytrail49 with baytrail freeze fixes and integrated RTL8723BS WIFI driver + kernel and modules +12 aur/helm-freeze 1.1.0-1 (+0 0.00) + Freeze your charts in the wished versions +11 aur/nora 0.2.0-1 (+1 0.00) + Freezes the screen for another program +10 aur/python-opentype-feature-freezer 1.32.2-1 (+2 0.00) + Freeze OpenType features in a font +9 aur/wayfreeze-git r65.8277f98-1 (+1 0.01) + Tool to freeze the screen of a Wayland compositor +8 aur/python-cx-freeze-git r2066.6cdbad7-1 (+1 0.00) (сирота в AUR) + Create standalone executables from Python scripts (built from latest commit) +7 aur/rseye-git r39.0babe11-1 (+0 0.00) + Freeze screen regularly to help prevent Repetitive Strain Injury (RSI) and protect the eyes. +6 aur/freezetag-git r24.89ac8a8-1 (+0 0.00) + A tool that saves, strips, and restores file paths and music metadata. +5 aur/freeze-bin 0.2.2-1 (+3 0.33) + Generate images of code and terminal output. +4 extra/python-freezegun 1.5.5-1 (39.6 KiB 176.7 KiB) + Let your Python tests travel through time +3 extra/perl-freezethaw 0.5001-9 (14.1 KiB 28.6 KiB) + Convert arbitrary objects to/from strings +2 extra/python-pytest-freezer 0.4.9-1 (6.3 KiB 8.6 KiB) + Pytest plugin providing a fixture interface for freezegun +1 extra/ruby-ice_nine 0.11.2-6 (19.9 KiB 50.8 KiB) + Deep freeze Ruby objects +==> Пакеты для установки (пример: 1 2 3, 1-3 или ^4) +==> \ No newline at end of file From 547747ee1cde34abe5b646ab77961848f130316f Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Fri, 17 Oct 2025 23:34:41 +0300 Subject: [PATCH 04/10] =?UTF-8?q?=D0=9E=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- heap_sort.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/heap_sort.py b/heap_sort.py index bc31788..47e4c3c 100644 --- a/heap_sort.py +++ b/heap_sort.py @@ -40,6 +40,3 @@ def heap_sort(array): -# a = [1,32253,3,533,5,0] -# heap_sort(a) -# print(a) \ No newline at end of file From 5eafac936e380a5dd0719b556717abc112272de1 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 18 Oct 2025 02:00:43 +0300 Subject: [PATCH 05/10] =?UTF-8?q?=D0=9F=D0=B0=D0=BF=D0=BA=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .githab/workflows/run_tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .githab/workflows/run_tests.yml diff --git a/.githab/workflows/run_tests.yml b/.githab/workflows/run_tests.yml new file mode 100644 index 0000000..252fd42 --- /dev/null +++ b/.githab/workflows/run_tests.yml @@ -0,0 +1,19 @@ +name: Automated tests + +on: push + +jobs: + test: + runs-on: endeavouros-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: setup Python + uses: actions/setup-python@v4 + with: + python-verion: "3.13" + - name: install dependencies + run: yay -r requirements.txt + - name: Run tests + run: pytest From b3d309e67b1b5ac734560ad712be0bfc277d2c19 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 16 Nov 2025 02:51:13 +0300 Subject: [PATCH 06/10] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=B0=D0=BB=20run=5Ftests.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .githab/workflows/run_tests.yml | 42 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.githab/workflows/run_tests.yml b/.githab/workflows/run_tests.yml index 252fd42..28d2755 100644 --- a/.githab/workflows/run_tests.yml +++ b/.githab/workflows/run_tests.yml @@ -1,19 +1,33 @@ -name: Automated tests +sname: Python application -on: push +on: [push] + +permissions: + contents: read jobs: - test: - runs-on: endeavouros-latest + build: + + runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: setup Python - uses: actions/setup-python@v4 - with: - python-verion: "3.13" - - name: install dependencies - run: yay -r requirements.txt - - name: Run tests - run: pytest + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + pip install hypothesis + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest \ No newline at end of file From 5e7eb817d4d8bbb0f167425aed36b1c58c4f15b2 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 16 Nov 2025 02:59:41 +0300 Subject: [PATCH 07/10] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20re?= =?UTF-8?q?quirements.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 54 ------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0fcacce..0000000 --- a/requirements.txt +++ /dev/null @@ -1,54 +0,0 @@ -26 aur/amd-disable-c6 1.0-1 (+0 0.00) - Disable AMD C6 state on boot to prevent Ryzen freezes -25 aur/saturn-git 1.1.1.r4.g310bd4d-1 (+0 0.00) - Your go-to ToS Compliant Custom Deezer Client - Freezer Reborn -24 aur/netdata-v1 2.2.6-3 (+0 0.00) - Real-time performance monitoring. Freeze the version on 2.2.6 since version 2.3.0 has deprecated UI v1 -23 aur/strix-claw r6.78eef095b3-1 (+0 0.00) (сирота в AUR) - Daemon that prevents freezes of Asus Strix Claw mice -22 aur/pip-chill 1.0.3-1 (+0 0.00) - A more relaxed pip freeze -21 aur/hyprfreeze-git 1.1.2.r2.6b67416-2 (+1 0.00) - Utility to suspend a game process (and other programs) in Hyprland -20 aur/saturn-bin 1.1.1-2 (+1 0.00) - Your go-to ToS Compliant Custom Deezer Client - Freezer Reborn -19 aur/obs-freeze-filter 0.3.5-1 (+1 0.00) - Filter to freeze a frame of a source -18 aur/python-cx-freeze 8.4.1-1 (+1 0.00) - Create standalone executables from Python scripts -17 aur/python-frozen-flask 1.0.2-1 (+0 0.00) - Freezes a Flask application into a set of static files -16 aur/still 0.0.7-1 (+1 0.75) - Freeze the screen of a Wayland compositor until a provided command exits -15 aur/linux-baytrail49-docs 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) - Kernel hackers manual - HTML documentation that comes with the Linux-baytrail49 kernel with baytrail freeze fixes -14 aur/linux-baytrail49-headers 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) - Header files and scripts for building modules for Linux-baytrail49 kernel with baytrail freeze fixes -13 aur/linux-baytrail49 4.9.330.315.057159bf2-1 (+3 0.00) (устарел: 2025-03-20) - The Linux-baytrail49 with baytrail freeze fixes and integrated RTL8723BS WIFI driver + kernel and modules -12 aur/helm-freeze 1.1.0-1 (+0 0.00) - Freeze your charts in the wished versions -11 aur/nora 0.2.0-1 (+1 0.00) - Freezes the screen for another program -10 aur/python-opentype-feature-freezer 1.32.2-1 (+2 0.00) - Freeze OpenType features in a font -9 aur/wayfreeze-git r65.8277f98-1 (+1 0.01) - Tool to freeze the screen of a Wayland compositor -8 aur/python-cx-freeze-git r2066.6cdbad7-1 (+1 0.00) (сирота в AUR) - Create standalone executables from Python scripts (built from latest commit) -7 aur/rseye-git r39.0babe11-1 (+0 0.00) - Freeze screen regularly to help prevent Repetitive Strain Injury (RSI) and protect the eyes. -6 aur/freezetag-git r24.89ac8a8-1 (+0 0.00) - A tool that saves, strips, and restores file paths and music metadata. -5 aur/freeze-bin 0.2.2-1 (+3 0.33) - Generate images of code and terminal output. -4 extra/python-freezegun 1.5.5-1 (39.6 KiB 176.7 KiB) - Let your Python tests travel through time -3 extra/perl-freezethaw 0.5001-9 (14.1 KiB 28.6 KiB) - Convert arbitrary objects to/from strings -2 extra/python-pytest-freezer 0.4.9-1 (6.3 KiB 8.6 KiB) - Pytest plugin providing a fixture interface for freezegun -1 extra/ruby-ice_nine 0.11.2-6 (19.9 KiB 50.8 KiB) - Deep freeze Ruby objects -==> Пакеты для установки (пример: 1 2 3, 1-3 или ^4) -==> \ No newline at end of file From 796fc55272e76e8bed5b07683fb879217478111e Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Thu, 4 Dec 2025 14:32:44 +0300 Subject: [PATCH 08/10] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BB=20.githab=20=D0=BD=D0=B0?= =?UTF-8?q?=20.github?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {.githab => .github}/workflows/run_tests.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.githab => .github}/workflows/run_tests.yml (100%) diff --git a/.githab/workflows/run_tests.yml b/.github/workflows/run_tests.yml similarity index 100% rename from .githab/workflows/run_tests.yml rename to .github/workflows/run_tests.yml From 649833381f525baf5b678c876385bb88185f7785 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Thu, 4 Dec 2025 14:48:29 +0300 Subject: [PATCH 09/10] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F?= =?UTF-8?q?=D0=BB=20=D0=B2=20run=5Ftests.yml=20sname=20=D0=BD=D0=B0=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 28d2755..4e867b5 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -1,4 +1,4 @@ -sname: Python application +name: Python application on: [push] From ad8eeb509ab81e67cd9c3aca98461403b80ee2b6 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Thu, 4 Dec 2025 15:05:33 +0300 Subject: [PATCH 10/10] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F?= =?UTF-8?q?=D0=BB=20=D0=B2=20run=5Ftests.yml=20flake8=20=D0=BD=D0=B0=20ruf?= =?UTF-8?q?f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_tests.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 4e867b5..0695e93 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -19,15 +19,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - pip install hypothesis - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 + pip install ruff + pip install pytest + - name: Lint with ruff run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + ruff check --output-format=github - name: Test with pytest run: | pytest \ No newline at end of file