From cc8c39f4d16c83208aef33ebc5601225bc2130e4 Mon Sep 17 00:00:00 2001 From: Azide Date: Fri, 29 Mar 2024 12:04:04 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20=E5=A2=9E=E5=8A=A0pyd?= =?UTF-8?q?1=E5=85=BC=E5=AE=B9=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pyd1-compat.yml | 61 +++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pyd1-compat.yml diff --git a/.github/workflows/pyd1-compat.yml b/.github/workflows/pyd1-compat.yml new file mode 100644 index 0000000..c48f62d --- /dev/null +++ b/.github/workflows/pyd1-compat.yml @@ -0,0 +1,61 @@ +name: pydantic1-compat-test + +on: + push: + branches: + - main + - next + paths: + - admin-frontend/** + - docker/** + - nonebot_bison/** + - tests/** + - pyproject.toml + - poetry.lock + - docker.env.prod + - .github/** + pull_request: + paths: + - admin-frontend/** + - docker/** + - nonebot_bison/** + - tests/** + - pyproject.toml + - poetry.lock + - docker.env.prod + - .github/** + types: + - opened + - synchronize + - reopened + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: pydantic1 test + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.11"] + os: [ubuntu-latest] + fail-fast: false + env: + OS: ${{ matrix.os }} + PYTHON_VERSION: ${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python environment + uses: ./.github/actions/setup-python + with: + python-version: ${{ matrix.python-version }} + + - name: Install prerequisites + run: poetry add pydantic@^1.10 && poetry install + + - name: Run Pytest + run: poetry run pytest -n auto diff --git a/pyproject.toml b/pyproject.toml index 26d85a0..c425807 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,7 @@ target-version = "py310" [tool.black] line-length = 120 preview = true -target-version = ["py310", "py311"] +target-version = ["py310", "py311", "py312"] include = '\.pyi?$' extend-exclude = ''' '''