Skip to content

Commit bf7efe7

Browse files
authored
SONARPY-1791: Typeshed add Scikit-learn stubs (#1778)
1 parent 92d62ef commit bf7efe7

File tree

326 files changed

+244015
-76
lines changed

Some content is hidden

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

326 files changed

+244015
-76
lines changed

.cirrus.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ build_task:
7474
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
7575
build_script:
7676
- git submodule update --init
77+
- cd python-frontend/typeshed_serializer/resources/python-type-stubs
78+
- git sparse-checkout set stubs/sklearn
79+
- git checkout
80+
- cd -
7781
- source cirrus-env BUILD
7882
- regular_mvn_build_deploy_analyze
7983
- ./check-license-compliance.sh
@@ -90,6 +94,10 @@ build_win_task:
9094
build_script:
9195
- git config --global core.autocrlf input
9296
- git submodule update --init
97+
- cd python-frontend/typeshed_serializer/resources/python-type-stubs
98+
- git sparse-checkout set stubs/sklearn
99+
- git checkout
100+
- cd -
93101
- source cirrus-env CI
94102
- unset SONARSOURCE_QA
95103
- mvn.cmd package -DskipTypeshed=true

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
[submodule "tools/typeshed_serializer/resources/typeshed"]
99
path = python-frontend/typeshed_serializer/resources/typeshed
1010
url = https://github.com/python/typeshed.git
11+
[submodule "tools/typeshed_serializer/resources/python-type-stubs"]
12+
path = python-frontend/typeshed_serializer/resources/python-type-stubs
13+
url = https://github.com/microsoft/python-type-stubs

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ The Python interpreter is not required in that case.
3232
- Maven 3.0.0 or newer
3333
- Python 3.9 or newer
3434
- [tox](https://tox.readthedocs.io/en/latest/) - `pip install tox`
35-
- Run `git submodule update --init` to retrieve [Typeshed](https://github.com/python/typeshed) as a Git submodule
35+
- Run `git submodule update --init` to retrieve [Typeshed](https://github.com/python/typeshed) and [SKlearn stubs](https://github.com/microsoft/python-type-stubs/tree/main/stubs/sklearn) as a Git submodules.
36+
- Run the following commands to extract only the needed files for the SKlearn stubs
37+
```
38+
cd python-frontend/typeshed_serializer/resources/python-type-stubs
39+
git sparse-checkout set stubs/sklearn
40+
git checkout
41+
```
3642

3743
All the above should be available in PATH.
3844

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
{
2-
'scikit-learn:sklearn/base.py':[
3-
489,
2+
"scikit-learn:sklearn/base.py": [
3+
489
44
],
5-
'scikit-learn:sklearn/datasets/tests/test_base.py':[
6-
78,
5+
"scikit-learn:sklearn/datasets/tests/test_base.py": [
6+
78
77
],
8-
'scikit-learn:sklearn/externals/_arff.py':[
8+
"scikit-learn:sklearn/externals/_arff.py": [
99
508,
1010
583,
11-
624,
11+
624
1212
],
13-
'scikit-learn:sklearn/metrics/tests/test_pairwise.py':[
14-
976,
13+
"scikit-learn:sklearn/metrics/tests/test_pairwise.py": [
14+
976
1515
],
16-
'scikit-learn:sklearn/metrics/tests/test_ranking.py':[
16+
"scikit-learn:sklearn/metrics/tests/test_ranking.py": [
1717
1200,
1818
1536,
1919
1538,
2020
1554,
2121
1561,
2222
1568,
23-
1576,
23+
1576
2424
],
25-
'scikit-learn:sklearn/model_selection/tests/test_search.py':[
25+
"scikit-learn:sklearn/model_selection/tests/test_search.py": [
2626
877,
27-
883,
28-
],
29-
'scikit-learn:sklearn/utils/fixes.py':[
30-
46,
27+
883
3128
],
29+
"scikit-learn:sklearn/utils/fixes.py": [
30+
46
31+
]
3232
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scikit-learn:sklearn/linear_model/tests/test_coordinate_descent.py": [
3+
1062
4+
]
5+
}
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
{
2-
'scikit-learn:sklearn/gaussian_process/tests/test_kernels.py':[
3-
384,
2+
"scikit-learn:sklearn/covariance/tests/test_graphical_lasso.py": [
3+
234
44
],
5-
'scikit-learn:sklearn/metrics/tests/test_score_objects.py':[
5+
"scikit-learn:sklearn/gaussian_process/tests/test_kernels.py": [
6+
384
7+
],
8+
"scikit-learn:sklearn/metrics/tests/test_score_objects.py": [
69
224,
7-
466,
10+
466
811
],
9-
'scikit-learn:sklearn/model_selection/tests/test_split.py':[
10-
938,
12+
"scikit-learn:sklearn/model_selection/tests/test_split.py": [
13+
938
1114
],
12-
'scikit-learn:sklearn/tests/test_base.py':[
15+
"scikit-learn:sklearn/tests/test_base.py": [
1316
217,
14-
228,
17+
228
1518
],
16-
'scikit-learn:sklearn/tests/test_pipeline.py':[
19+
"scikit-learn:sklearn/tests/test_pipeline.py": [
1720
198,
18-
220,
21+
220
1922
],
20-
'scikit-learn:sklearn/utils/estimator_checks.py':[
21-
3132,
23+
"scikit-learn:sklearn/utils/estimator_checks.py": [
24+
3132
2225
],
23-
'scikit-learn:sklearn/utils/tests/test_pprint.py':[
26+
"scikit-learn:sklearn/utils/tests/test_pprint.py": [
2427
287,
2528
672,
26-
677,
27-
],
29+
677
30+
]
2831
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scikit-learn:sklearn/linear_model/tests/test_coordinate_descent.py": [
3+
1049
4+
]
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"scikit-learn:sklearn/neighbors/tests/test_kde.py": [
3+
112,
4+
174
5+
]
6+
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
2-
'scikit-learn:sklearn/tree/tests/test_tree.py':[
2+
"scikit-learn:sklearn/cluster/tests/test_hierarchical.py": [
3+
643
4+
],
5+
"scikit-learn:sklearn/tree/tests/test_tree.py": [
36
2207,
4-
2301,
7+
2301
58
],
9+
"scikit-learn:sklearn/utils/tests/test_fast_dict.py": [
10+
15,
11+
19,
12+
23
13+
]
614
}
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
2-
'scikit-learn:sklearn/_loss/tests/test_loss.py':[
2+
"scikit-learn:sklearn/_loss/tests/test_loss.py": [
33
838,
4-
839,
4+
839
55
],
6-
'scikit-learn:sklearn/linear_model/_glm/tests/test_glm.py':[
7-
453,
8-
464,
6+
"scikit-learn:sklearn/ensemble/tests/test_voting.py": [
7+
101
98
],
10-
'scikit-learn:sklearn/linear_model/tests/test_logistic.py':[
11-
2222,
9+
"scikit-learn:sklearn/linear_model/_glm/tests/test_glm.py": [
10+
453,
11+
464
1212
],
13+
"scikit-learn:sklearn/linear_model/tests/test_logistic.py": [
14+
2222
15+
]
1316
}

0 commit comments

Comments
 (0)