Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ffb6ac8

Browse files
committedJan 7, 2025·
update
1 parent c236f05 commit ffb6ac8

File tree

10 files changed

+880
-72
lines changed

10 files changed

+880
-72
lines changed
 

‎.github/actions/setup-poetry/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
poetry-version:
99
description: Poetry version to set up
1010
required: true
11-
default: '1.8.4'
11+
default: '2.0.0'
1212
poetry-lockfile:
1313
description: Path to the Poetry lockfile to restore cache from
1414
required: true

‎.github/workflows/api-tests.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,23 @@ jobs:
4242
run: poetry install -C api --with dev
4343

4444
- name: Check dependencies in pyproject.toml
45-
run: poetry run -C api bash dev/pytest/pytest_artifacts.sh
45+
run: poetry run -P api bash dev/pytest/pytest_artifacts.sh
4646

4747
- name: Run Unit tests
48-
run: poetry run -C api bash dev/pytest/pytest_unit_tests.sh
48+
run: poetry run -P api bash dev/pytest/pytest_unit_tests.sh
4949

5050
- name: Run ModelRuntime
51-
run: poetry run -C api bash dev/pytest/pytest_model_runtime.sh
51+
run: poetry run -P api bash dev/pytest/pytest_model_runtime.sh
5252

5353
- name: Run dify config tests
54-
run: poetry run -C api python dev/pytest/pytest_config_tests.py
54+
run: poetry run -P api python dev/pytest/pytest_config_tests.py
5555

5656
- name: Run Tool
57-
run: poetry run -C api bash dev/pytest/pytest_tools.sh
57+
run: poetry run -P api bash dev/pytest/pytest_tools.sh
5858

5959
- name: Run mypy
6060
run: |
61-
pushd api
62-
poetry run python -m mypy --install-types --non-interactive .
63-
popd
61+
poetry run -C api python -m mypy --install-types --non-interactive .
6462
6563
- name: Set up dotenvs
6664
run: |
@@ -80,4 +78,4 @@ jobs:
8078
ssrf_proxy
8179
8280
- name: Run Workflow
83-
run: poetry run -C api bash dev/pytest/pytest_workflow.sh
81+
run: poetry run -P api bash dev/pytest/pytest_workflow.sh

‎.github/workflows/style.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838
if: steps.changed-files.outputs.any_changed == 'true'
3939
run: |
4040
poetry run -C api ruff --version
41-
poetry run -C api ruff check ./api
42-
poetry run -C api ruff format --check ./api
41+
poetry run -C api ruff check ./
42+
poetry run -C api ruff format --check ./
4343
4444
- name: Dotenv check
4545
if: steps.changed-files.outputs.any_changed == 'true'
46-
run: poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example
46+
run: poetry run -P api dotenv-linter ./api/.env.example ./web/.env.example
4747

4848
- name: Lint hints
4949
if: failure()

‎.github/workflows/vdb-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ jobs:
7070
tidb
7171
7272
- name: Test Vector Stores
73-
run: poetry run -C api bash dev/pytest/pytest_vdb.sh
73+
run: poetry run -P api bash dev/pytest/pytest_vdb.sh

‎api/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM python:3.12-slim-bookworm AS base
44
WORKDIR /app/api
55

66
# Install Poetry
7-
ENV POETRY_VERSION=1.8.4
7+
ENV POETRY_VERSION=2.0.0
88

99
# if you located in China, you can use aliyun mirror to speed up
1010
# RUN pip install --no-cache-dir poetry==${POETRY_VERSION} -i https://mirrors.aliyun.com/pypi/simple/

‎api/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@
7979
2. Run the tests locally with mocked system environment variables in `tool.pytest_env` section in `pyproject.toml`
8080

8181
```bash
82-
poetry run -C api bash dev/pytest/pytest_all_tests.sh
82+
poetry run -P api bash dev/pytest/pytest_all_tests.sh
8383
```

‎api/poetry.lock

+860-51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[project]
22
name = "dify-api"
33
requires-python = ">=3.11,<3.13"
4+
dynamic = [ "dependencies" ]
45

56
[build-system]
6-
requires = ["poetry-core"]
7+
requires = ["poetry-core>=2.0.0"]
78
build-backend = "poetry.core.masonry.api"
89

910
[tool.poetry]

‎dev/reformat

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ if ! command -v ruff &> /dev/null || ! command -v dotenv-linter &> /dev/null; th
99
fi
1010

1111
# run ruff linter
12-
poetry run -C api ruff check --fix ./api
12+
poetry run -C api ruff check --fix ./
1313

1414
# run ruff formatter
15-
poetry run -C api ruff format ./api
15+
poetry run -C api ruff format ./
1616

1717
# run dotenv-linter linter
18-
poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example
18+
poetry run -P api dotenv-linter ./api/.env.example ./web/.env.example

‎dev/sync-poetry

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then
1212
# update poetry.lock
1313
# refreshing lockfile only without updating locked versions
1414
echo "poetry.lock is outdated, refreshing without updating locked versions ..."
15-
poetry lock -C api --no-update
15+
poetry lock -C api
1616
else
1717
echo "poetry.lock is ready."
1818
fi

0 commit comments

Comments
 (0)
Please sign in to comment.