Skip to content

Commit d36bbda

Browse files
Merge pull request #216 from dashscope/dev/v2-change
dev/v2-change
2 parents f2a915e + 89916e9 commit d36bbda

562 files changed

Lines changed: 12097 additions & 5121 deletions

File tree

Some content is hidden

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

‎.github/workflows/unit_test.yml‎

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ on:
99
- 'main'
1010

1111
jobs:
12-
test:
12+
current:
1313
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'docs:')) }}
1414

1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
1818
os: [ ubuntu-latest ]
19-
python-version: [ '3.9', '3.12', '3.13', '3.14' ]
20-
19+
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
2120

2221
steps:
2322
- name: Checkout repository
@@ -55,10 +54,55 @@ jobs:
5554
run: |
5655
python -m pip list --format=columns
5756
58-
- name: Run tests with coverage
57+
- name: Run current tests with coverage
5958
run: |
60-
coverage run -m pytest tests/unit
59+
coverage run -m pytest tests --ignore=tests/legacy_1x
6160
6261
- name: Generate coverage report
6362
run: |
6463
coverage report -m
64+
65+
legacy:
66+
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'docs:')) }}
67+
68+
runs-on: ${{ matrix.os }}
69+
strategy:
70+
matrix:
71+
os: [ ubuntu-latest ]
72+
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
73+
74+
steps:
75+
- name: Checkout repository
76+
uses: actions/checkout@v4
77+
78+
- name: Set up Python ${{ matrix.python-version }}
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
83+
- name: Cache pip dependencies
84+
uses: actions/cache@v4
85+
with:
86+
path: ~/.cache/pip
87+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
88+
restore-keys: |
89+
${{ runner.os }}-pip-
90+
91+
- name: Update setuptools
92+
run: |
93+
pip install --upgrade pip
94+
pip install setuptools==68.2.2 wheel==0.41.2
95+
96+
- name: Set PYTHONPATH
97+
run: |
98+
echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}/src" >> $GITHUB_ENV
99+
100+
- name: Install dependencies
101+
run: |
102+
export PIP_DEFAULT_TIMEOUT=300
103+
pip install -r requirements.txt
104+
pip install -r requirements-test.txt
105+
106+
- name: Run archived legacy tests
107+
run: |
108+
python -m pytest tests/legacy_1x

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,5 @@ cython_debug/
144144
# Local design/analysis docs — kept out of the public repo
145145
/md/
146146

147-
# Local PyPI investigation tooling; the CI guard lives in tests/unit/.
147+
# Local PyPI investigation tooling; the CI guard lives in tests/legacy_1x/unit/.
148148
/scripts/

‎.pre-commit-config.yaml‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ repos:
33
rev: v4.3.0
44
hooks:
55
- id: check-ast
6-
exclude: ^tests/legacy/
6+
exclude: ^tests/legacy_1x/legacy/
77
- id: sort-simple-yaml
8-
exclude: ^tests/legacy/
8+
exclude: ^tests/legacy_1x/legacy/
99
- id: check-yaml
1010
exclude: |
1111
(?x)^(
1212
meta.yaml
13-
| tests/legacy/
13+
| tests/legacy_1x/legacy/
1414
)$
1515
- id: check-xml
16-
exclude: ^tests/legacy/
16+
exclude: ^tests/legacy_1x/legacy/
1717
- id: check-toml
18-
exclude: ^tests/legacy/
18+
exclude: ^tests/legacy_1x/legacy/
1919
- id: check-docstring-first
20-
exclude: ^tests/legacy/
20+
exclude: ^tests/legacy_1x/legacy/
2121
- id: check-json
22-
exclude: ^tests/legacy/
22+
exclude: ^tests/legacy_1x/legacy/
2323
- id: fix-encoding-pragma
24-
exclude: ^tests/legacy/
24+
exclude: ^tests/legacy_1x/legacy/
2525
- id: detect-private-key
26-
exclude: ^tests/legacy/
26+
exclude: ^tests/legacy_1x/legacy/
2727
- id: trailing-whitespace
28-
exclude: ^tests/legacy/
28+
exclude: ^tests/legacy_1x/legacy/
2929
- repo: https://github.com/asottile/add-trailing-comma
3030
rev: v3.1.0
3131
hooks:
3232
- id: add-trailing-comma
3333
# examples/01_atomic_capabilities/audio is ported verbatim from the sibling repo's
3434
# samples/ tree, whose hooks exempt samples/.
35-
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
35+
exclude: ^(tests/legacy_1x/legacy|examples/01_atomic_capabilities/audio)/
3636
- repo: https://github.com/pre-commit/mirrors-mypy
3737
rev: v1.7.0
3838
hooks:
@@ -45,7 +45,7 @@ repos:
4545
pb2\.py$
4646
| grpc\.py$
4747
| ^docs
48-
| ^tests/legacy/
48+
| ^tests/legacy_1x/legacy/
4949
| ^examples/01_atomic_capabilities/audio/
5050
| \.html$
5151
| \.pyi$
@@ -67,13 +67,13 @@ repos:
6767
hooks:
6868
- id: black
6969
args: [ --line-length=79 ]
70-
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
70+
exclude: ^(tests/legacy_1x/legacy|examples/01_atomic_capabilities/audio)/
7171
- repo: https://github.com/PyCQA/flake8
7272
rev: 6.1.0
7373
hooks:
7474
- id: flake8
7575
args: [ "--extend-ignore=E203"]
76-
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
76+
exclude: ^(tests/legacy_1x/legacy|examples/01_atomic_capabilities/audio)/
7777
- repo: https://github.com/pylint-dev/pylint
7878
rev: v3.0.2
7979
hooks:
@@ -97,6 +97,7 @@ repos:
9797
--disable=R0913,
9898
--disable=E0401,
9999
--disable=E1101,
100+
--disable=E0611, # Runtime meta-path aliases are invisible to astroid
100101
--disable=C0415,
101102
--disable=W0603,
102103
--disable=R1705,
@@ -122,6 +123,7 @@ repos:
122123
--disable=C0114, # Disable missing module docstring for quick dev
123124
--disable=C0115, # Disable missing class docstring for quick dev
124125
--disable=C0116, # Disable missing function or method docstring for quick dev
126+
--disable=E0603, # Absolute self-imports and lazy exports in reinforcement
125127
]
126128
# Tests get their own entry (pylint 3.0.2 discovers rcfiles from the
127129
# invocation CWD, not per linted-file directory, so a tests/pylintrc
@@ -132,7 +134,7 @@ repos:
132134
- id: pylint
133135
name: pylint (tests)
134136
files: ^tests/
135-
exclude: ^tests/legacy/
137+
exclude: ^tests/legacy_1x/legacy/
136138
args: [
137139
--disable=W0511,
138140
--disable=W0718,
@@ -141,6 +143,7 @@ repos:
141143
--disable=R0913,
142144
--disable=E0401,
143145
--disable=E1101,
146+
--disable=E0611, # Runtime meta-path aliases are invisible to astroid
144147
--disable=C0415,
145148
--disable=W0603,
146149
--disable=R1705,
@@ -190,19 +193,19 @@ repos:
190193
hooks:
191194
- id: eslint
192195
files: \.(js|jsx)$
193-
exclude: '(.*js_third_party.*|^tests/legacy/)'
196+
exclude: '(.*js_third_party.*|^tests/legacy_1x/legacy/)'
194197
args: [ '--fix' ]
195198
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
196199
rev: v14.4.0
197200
hooks:
198201
- id: stylelint
199202
files: \.(css)$
200-
exclude: '(.*css_third_party.*|^tests/legacy/)'
203+
exclude: '(.*css_third_party.*|^tests/legacy_1x/legacy/)'
201204
args: [ '--fix' ]
202205
- repo: https://github.com/pre-commit/mirrors-prettier
203206
rev: 'v3.0.0'
204207
hooks:
205208
- id: prettier
206209
additional_dependencies: [ 'prettier@3.0.0' ]
207210
files: \.(tsx?)$
208-
exclude: ^tests/legacy/
211+
exclude: ^tests/legacy_1x/legacy/

‎MANIFEST.in‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include dashscope/resources/qwen.tiktoken
1+
include dashscope/legacy_1x/tokenizers/qwen.tiktoken
22
include dashscope/py.typed
33
include dashscope/__init__.pyi
44
include NOTICE

0 commit comments

Comments
 (0)