diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d82704c..008ed21 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -17,7 +17,7 @@ jobs: uses: actions/setup-python@v1 - name: Install dependencies - run: pip3 install black ruff + run: pip3 install black==23.11.0 ruff==0.1.5 - name: run black run: black --check . diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 541282c..56dfdf6 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -16,18 +16,18 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.11.4 + python-version: 3.11 - name: Install dependencies run: pip3 install -U online-judge-verify-helper - name: Copy dependencies run: | - rm -rf /opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/onlinejudge_verify - cp -r ./.github/oj-verify /opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/onlinejudge_verify + rm -rf /opt/hostedtoolcache/Python/3.11/x64/lib/python3.11/site-packages/onlinejudge_verify + cp -r ./.github/oj-verify /opt/hostedtoolcache/Python/3.11/x64/lib/python3.11/site-packages/onlinejudge_verify sleep 5 - - name: run verify + - name: create docs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} YUKICODER_TOKEN: ${{ secrets.YUKICODER_TOKEN }} diff --git a/Makefile b/Makefile index 951a780..beb7a4b 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,6 @@ ruff: oj: verify docs -verify-src: - oj-verify run src/_tests/*/*.test.py - -verify-exp: - oj-verify run expansion/_tests/*/*.test.py - verify: oj-verify run diff --git a/expansion/$tests/polynomial/inv_of_FormalPowerSeries.test.py b/expansion/$tests/polynomial/inv_of_FormalPowerSeries.test.py index 1ffc50d..23a2c29 100644 --- a/expansion/$tests/polynomial/inv_of_FormalPowerSeries.test.py +++ b/expansion/$tests/polynomial/inv_of_FormalPowerSeries.test.py @@ -224,7 +224,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -284,7 +284,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other))) diff --git a/expansion/$tests/polynomial/log_of_FormalPowerSeries.test.py b/expansion/$tests/polynomial/log_of_FormalPowerSeries.test.py index c7dc825..3ad9008 100644 --- a/expansion/$tests/polynomial/log_of_FormalPowerSeries.test.py +++ b/expansion/$tests/polynomial/log_of_FormalPowerSeries.test.py @@ -224,7 +224,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -284,7 +284,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other))) diff --git a/expansion/$tests/polynomial/pow_of_FormalPowerSeries.test.py b/expansion/$tests/polynomial/pow_of_FormalPowerSeries.test.py index d1796ee..64bddce 100644 --- a/expansion/$tests/polynomial/pow_of_FormalPowerSeries.test.py +++ b/expansion/$tests/polynomial/pow_of_FormalPowerSeries.test.py @@ -224,7 +224,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -284,7 +284,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other))) diff --git a/expansion/$tests/polynomial/sqrt_of_FormalPowerSeries.test.py b/expansion/$tests/polynomial/sqrt_of_FormalPowerSeries.test.py index f37eb1b..b993598 100644 --- a/expansion/$tests/polynomial/sqrt_of_FormalPowerSeries.test.py +++ b/expansion/$tests/polynomial/sqrt_of_FormalPowerSeries.test.py @@ -224,7 +224,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -284,7 +284,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other))) diff --git a/expansion/polynomial/FormalPowerSeries998.py b/expansion/polynomial/FormalPowerSeries998.py index a561ccd..298833e 100644 --- a/expansion/polynomial/FormalPowerSeries998.py +++ b/expansion/polynomial/FormalPowerSeries998.py @@ -217,7 +217,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -277,7 +277,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other))) diff --git a/src/polynomial/FormalPowerSeries998.py b/src/polynomial/FormalPowerSeries998.py index 3885350..fd2f49e 100644 --- a/src/polynomial/FormalPowerSeries998.py +++ b/src/polynomial/FormalPowerSeries998.py @@ -8,7 +8,7 @@ class FormalPowerSeries998(list): Comb = Combination(200000) def __init__(self, n): - if type(n) == int: + if isinstance(n, int): super().__init__([0] * n) else: super().__init__(n) @@ -68,7 +68,7 @@ def __isub__(self, other): return self def __mul__(self, other): - if type(other) == int: + if isinstance(other, int): return FormalPowerSeries998([x * other % 998244353 for x in self]) return FormalPowerSeries998(NTT998.multiply(list(self), list(other)))