Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARPY-1522 Add protobuf stubs for Python 3.12 and 3.13 #2187

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,6 @@ public static boolean areSourcePythonVersionsGreaterOrEqualThan(Set<Version> sou
.allMatch(version -> version.compare(required.major(), required.minor()) >= 0);
}

/**
* @return the set of versions which are supported but not serialized due to SONARPY-1522
*/
public static Set<Version> getNotSerializedVersions() {
return EnumSet.of(V_312, V_313);
}

private static void logErrorMessage(String propertyValue) {
LOG.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.sonar.plugins.python.api.PythonVersionUtils;
import org.sonar.python.index.AmbiguousDescriptor;
import org.sonar.python.index.Descriptor;

Expand Down Expand Up @@ -50,13 +49,6 @@ static boolean isValidForPythonVersion(List<String> validForPythonVersions, Set<
if (validForPythonVersions.isEmpty()) {
return true;
}
// TODO: SONARPY-1522 - remove this workaround when we will have all the stubs for Python 3.12.
Set<String> notSerializedVersions =
PythonVersionUtils.getNotSerializedVersions().stream().map(PythonVersionUtils.Version::serializedValue).collect(Collectors.toSet());
if (notSerializedVersions.containsAll(supportedPythonVersions)
&& validForPythonVersions.contains(PythonVersionUtils.Version.V_311.serializedValue())) {
return true;
}
HashSet<String> intersection = new HashSet<>(validForPythonVersions);
intersection.retainAll(supportedPythonVersions);
return !intersection.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,6 @@ public static boolean isValidForProjectPythonVersion(List<String> validForPython
if (validForPythonVersions.isEmpty()) {
return true;
}
// TODO: SONARPY-1522 - remove this workaround when we will have all the stubs for Python 3.12.
Set<String> notSerializedVersions = PythonVersionUtils.getNotSerializedVersions().stream().map(PythonVersionUtils.Version::serializedValue).collect(Collectors.toSet());
if (notSerializedVersions.containsAll(supportedPythonVersions)
&& validForPythonVersions.contains(PythonVersionUtils.Version.V_311.serializedValue())) {
return true;
}
HashSet<String> intersection = new HashSet<>(validForPythonVersions);
intersection.retainAll(supportedPythonVersions);
return !intersection.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


__future__�
_Feature__future__._Feature"builtins.object*�
__future__�
_Feature__future__._Feature"builtins.object*�
__init____future__._Feature.__init__"
None*4
self*
Expand All @@ -25,7 +25,7 @@ GTuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]
builtins.int" builtins.int"__future__._VersionInfo
None*/
compiler_flag
builtins.int" builtins.intz36z37z38z39z310z311*�
builtins.int" builtins.intz36z37z38z39z310z311z312z313*�
getOptionalRelease&__future__._Feature.getOptionalRelease"�
RTypeAlias[Tuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]]�
GTuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]
Expand All @@ -35,7 +35,7 @@ GTuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]
builtins.str" builtins.str
builtins.int" builtins.int"__future__._VersionInfo*4
self*
__future__._Feature"__future__._Featurez36z37z38z39z310z311*�
__future__._Feature"__future__._Featurez36z37z38z39z310z311z312z313*�
getMandatoryRelease'__future__._Feature.getMandatoryRelease"�
^Union[TypeAlias[Tuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]],None]�
RTypeAlias[Tuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]]�
Expand All @@ -47,37 +47,37 @@ GTuple[builtins.int,builtins.int,builtins.int,builtins.str,builtins.int]
builtins.int" builtins.int"__future__._VersionInfo
None*4
self*
__future__._Feature"__future__._Featurez36z37z38z39z310z311j36j37j38j39j310j311rj
__future__._Feature"__future__._Featurez36z37z38z39z310z311z312z313j36j37j38j39j310j311j312j313rt
compiler_flag!__future__._Feature.compiler_flag
builtins.int" builtins.int*36*37*38*39*310*311*�
builtins.int" builtins.int*36*37*38*39*310*311*312*313*�
__annotations____future__.__annotations__W
builtins.dict[builtins.str,Any]
builtins.str" builtins.str
Any"builtins.dict*36*37*38*39*310*311*s
Any"builtins.dict*36*37*38*39*310*311*312*313*}
absolute_import__future__.absolute_import*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*e
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*o
division__future__.division*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*i
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*s

generators__future__.generators*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*o
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*y
nested_scopes__future__.nested_scopes*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*q
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*{
print_function__future__.print_function*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*u
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*
unicode_literals__future__.unicode_literals*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*q
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*{
with_statement__future__.with_statement*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*q
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*{
barry_as_FLUFL__future__.barry_as_FLUFL*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*q
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*{
generator_stop__future__.generator_stop*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*k
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*u
annotations__future__.annotations*
__future__._Feature"__future__._Feature*36*37*38*39*310*311*�
__future__._Feature"__future__._Feature*36*37*38*39*310*311*312*313*�
all_feature_names__future__.all_feature_namesJ
builtins.list[builtins.str]
builtins.str" builtins.str"builtins.list*36*37*38*39*310*311*�
builtins.str" builtins.str"builtins.list*36*37*38*39*310*311*312*313*�
__all____future__.__all__J
builtins.list[builtins.str]
builtins.str" builtins.str"builtins.list*36*37*38*39*310*311
builtins.str" builtins.str"builtins.list*36*37*38*39*310*311*312*313
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

__main__f
__main__p
__getattr____main__.__getattr__"
Any*
builtins.str" builtins.strz36z37z38z39z310z311*�
builtins.str" builtins.strz36z37z38z39z310z311z312z313*�
__annotations____main__.__annotations__W
builtins.dict[builtins.str,Any]
builtins.str" builtins.str
Any"builtins.dict*36*37*38*39*310*311
Any"builtins.dict*36*37*38*39*310*311*312*313
Expand Down
Loading