This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit ffb6ac8 committed Jan 7, 2025 · 7 / 7
1 parent c236f05 commit ffb6ac8 Copy full SHA for ffb6ac8
File tree 10 files changed +880
-72
lines changed
10 files changed +880
-72
lines changed Original file line number Diff line number Diff line change 8
8
poetry-version :
9
9
description : Poetry version to set up
10
10
required : true
11
- default : ' 1.8.4 '
11
+ default : ' 2.0.0 '
12
12
poetry-lockfile :
13
13
description : Path to the Poetry lockfile to restore cache from
14
14
required : true
Original file line number Diff line number Diff line change @@ -42,25 +42,23 @@ jobs:
42
42
run : poetry install -C api --with dev
43
43
44
44
- 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
46
46
47
47
- 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
49
49
50
50
- 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
52
52
53
53
- 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
55
55
56
56
- 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
58
58
59
59
- name : Run mypy
60
60
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 .
64
62
65
63
- name : Set up dotenvs
66
64
run : |
80
78
ssrf_proxy
81
79
82
80
- 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
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ jobs:
38
38
if : steps.changed-files.outputs.any_changed == 'true'
39
39
run : |
40
40
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 ./
43
43
44
44
- name : Dotenv check
45
45
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
47
47
48
48
- name : Lint hints
49
49
if : failure()
Original file line number Diff line number Diff line change 70
70
tidb
71
71
72
72
- 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
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ FROM python:3.12-slim-bookworm AS base
4
4
WORKDIR /app/api
5
5
6
6
# Install Poetry
7
- ENV POETRY_VERSION=1.8.4
7
+ ENV POETRY_VERSION=2.0.0
8
8
9
9
# if you located in China, you can use aliyun mirror to speed up
10
10
# RUN pip install --no-cache-dir poetry==${POETRY_VERSION} -i https://mirrors.aliyun.com/pypi/simple/
Original file line number Diff line number Diff line change 79
79
2 . Run the tests locally with mocked system environment variables in ` tool.pytest_env ` section in ` pyproject.toml `
80
80
81
81
``` 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
83
83
```
Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " dify-api"
3
3
requires-python = " >=3.11,<3.13"
4
+ dynamic = [ " dependencies" ]
4
5
5
6
[build-system ]
6
- requires = [" poetry-core" ]
7
+ requires = [" poetry-core>=2.0.0 " ]
7
8
build-backend = " poetry.core.masonry.api"
8
9
9
10
[tool .poetry ]
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ if ! command -v ruff &> /dev/null || ! command -v dotenv-linter &> /dev/null; th
9
9
fi
10
10
11
11
# run ruff linter
12
- poetry run -C api ruff check --fix ./api
12
+ poetry run -C api ruff check --fix ./
13
13
14
14
# run ruff formatter
15
- poetry run -C api ruff format ./api
15
+ poetry run -C api ruff format ./
16
16
17
17
# 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
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then
12
12
# update poetry.lock
13
13
# refreshing lockfile only without updating locked versions
14
14
echo " poetry.lock is outdated, refreshing without updating locked versions ..."
15
- poetry lock -C api --no-update
15
+ poetry lock -C api
16
16
else
17
17
echo " poetry.lock is ready."
18
18
fi
You can’t perform that action at this time.
0 commit comments