Skip to content

Commit 45f169a

Browse files
committed
feat: use tags.json5 when generate problems
1 parent fbab795 commit 45f169a

File tree

174 files changed

+688
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+688
-362
lines changed

.github/workflows/ci-test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ on:
66
pull_request:
77
types: [opened, synchronize, reopened]
88

9+
env:
10+
TARGET_PYTHON_VERSION: "3.13"
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1218

1319
steps:
1420
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1521

1622
- name: Set up Python
1723
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
1824
with:
19-
python-version: "3.13"
25+
python-version: ${{ matrix.python-version }}
2026

2127
- name: Install Poetry
2228
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
@@ -30,7 +36,7 @@ jobs:
3036
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
3137
with:
3238
path: .venv
33-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
39+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
3440

3541
- name: Install dependencies
3642
run: |
@@ -67,11 +73,13 @@ jobs:
6773
run: make test
6874

6975
- name: SonarQube Scan
76+
if: matrix.python-version == env.TARGET_PYTHON_VERSION
7077
uses: SonarSource/sonarqube-scan-action@1a6d90ebcb0e6a6b1d87e37ba693fe453195ae25 # v5.3.1
7178
env:
7279
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7380

7481
- name: Upload coverage reports to Codecov
82+
if: matrix.python-version == env.TARGET_PYTHON_VERSION
7583
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7684
with:
7785
fail_ci_if_error: true

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PYTHON_VERSION = 3.13
2-
PROBLEM ?= find_all_anagrams_in_a_string
2+
PROBLEM ?= daily_temperatures
33
FORCE ?= 0
44
COMMA := ,
55

@@ -42,6 +42,7 @@ define lint_target
4242
endef
4343

4444
lint:
45+
python scripts/sort_tags.py
4546
poetry sort
4647
npx prettier --write "**/*.{ts,tsx,css,json,yaml,yml,md}"
4748
$(call lint_target,.)

leetcode/accounts_merge/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_accounts_merge, run_accounts_merge
66
from .solution import Solution

leetcode/add_binary/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_add_binary, run_add_binary
66
from .solution import Solution

leetcode/balanced_binary_tree/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_is_balanced, run_is_balanced
66
from .solution import Solution

leetcode/basic_calculator/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_calculate, run_calculate
66
from .solution import Solution

leetcode/best_time_to_buy_and_sell_stock/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_max_profit, run_max_profit
66
from .solution import Solution

leetcode/binary_search/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_search, run_search
66
from .solution import Solution

leetcode/binary_tree_level_order_traversal/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_level_order, run_level_order
66
from .solution import Solution

leetcode/binary_tree_right_side_view/test_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from leetcode_py.test_utils import logged_test
3+
from leetcode_py import logged_test
44

55
from .helpers import assert_right_side_view, run_right_side_view
66
from .solution import Solution, SolutionBFS, SolutionDFS

0 commit comments

Comments
 (0)