Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.32.0] - 2025-08-13
### Added
- Add `--min-cutoff-threshold` argument to folder scan command
- Add `--depth` argument to `folder-scan` and `folder-hash` commands

## [1.31.4] - 2025-08-20
### Added
- Added support for empty dependency track project policy checks
Expand Down Expand Up @@ -648,3 +653,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.31.2]: https://github.com/scanoss/scanoss.py/compare/v1.31.1...v1.31.2
[1.31.3]: https://github.com/scanoss/scanoss.py/compare/v1.31.2...v1.31.3
[1.31.4]: https://github.com/scanoss/scanoss.py/compare/v1.31.3...v1.31.4
[1.32.0]: https://github.com/scanoss/scanoss.py/compare/v1.31.2...v1.32.0
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ requests
crc32c>=2.2
binaryornot
progress
grpcio>1.42.0
grpcio>=1.70.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify gRPC version compatibility across the codebase.

The update from grpcio>1.42.0 to grpcio>=1.70.0 is a significant version bump. This change aligns with the protobuf runtime validation added throughout the codebase, but requires verification that all gRPC-related code is compatible with the new minimum version.


🏁 Script executed:

#!/bin/bash
# Search for gRPC version checks and compatibility guards in the codebase
echo "Searching for gRPC version compatibility checks..."
rg -n "GRPC_GENERATED_VERSION|GRPC_VERSION|_version_not_supported" --type=py

echo -e "\nSearching for potential version-specific gRPC code..."
rg -nC3 "grpc\.|grpcio" --type=py -g '!requirements.txt' -g '!setup.cfg'

Length of output: 110731


Ensure grpcio requirement matches generated‐code version checks

The generated gRPC stubs in *.pb2_grpc.py perform runtime guards against the embedded GRPC_GENERATED_VERSION (1.73.0 in protoc_gen_swagger stubs and 1.73.1 in Scanoss API stubs). With requirements.txt currently set to:

- grpcio>=1.70.0
+ grpcio>=1.73.1

installations of grpcio 1.70.x–1.72.x will trigger a RuntimeError on import since first_version_is_lower('1.72.0','1.73.1') is true. To resolve this critical mismatch:

• Update requirements.txt (line 5) to grpcio>=1.73.1 to satisfy the highest GRPC_GENERATED_VERSION.
• Optionally, if you prefer to lock to 1.73.0 instead, regenerate the Swagger stubs so their GRPC_GENERATED_VERSION matches (but note Scanoss API stubs require 1.73.1).

Please confirm that moving to grpcio ≥1.73.1 is acceptable for all environments and downstream consumers.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
grpcio>=1.70.0
grpcio>=1.73.1
🤖 Prompt for AI Agents
In requirements.txt around line 5 the grpcio pin is too low (grpcio>=1.70.0)
which will cause runtime import RuntimeError due to generated gRPC stubs
expecting GRPC_GENERATED_VERSION up to 1.73.1; update the requirement on line 5
to grpcio>=1.73.1 to satisfy the highest embedded generated version (or
alternatively regenerate Swagger/Scanoss stubs to match a lower grpcio if you
cannot bump), and verify this bump is acceptable for all environments and
downstream consumers.

protobuf>3.19.1
protoc-gen-openapiv2
pypac
urllib3
pyOpenSSL
Expand Down
27 changes: 8 additions & 19 deletions scanoss.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"settings": {
"skip": {
"patterns": {},
"patterns": {
"scanning": [
"src/protoc_gen_swagger",
"docs",
"scanoss_common_pb2_grpc.py"
]
},
"sizes": {}
}
},
Expand All @@ -11,23 +17,6 @@
"purl": "pkg:github/scanoss/scanoss.py"
}
],
"remove": [
{
"path": "docs/make.bat",
"purl": "pkg:github/twilight-logic/ar488"
},
{
"path": "src/protoc_gen_swagger/options/annotations_pb2_grpc.py",
"purl": "pkg:pypi/bauplan"
},
{
"path": "src/protoc_gen_swagger/options/openapiv2_pb2_grpc.py",
"purl": "pkg:pypi/bauplan"
},
{
"path": "src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py",
"purl": "pkg:pypi/bauplan"
}
]
"remove": []
}
}
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ install_requires =
crc32c>=2.2
binaryornot
progress
grpcio>1.42.0
grpcio>=1.70.0
protobuf>3.19.1
protoc-gen-openapiv2
pypac
pyOpenSSL
google-api-core
Expand Down
30 changes: 18 additions & 12 deletions src/protoc_gen_swagger/options/annotations_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions src/protoc_gen_swagger/options/annotations_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""

import builtins
import google.protobuf.descriptor
import google.protobuf.descriptor_pb2
import google.protobuf.internal.extension_dict
import protoc_gen_swagger.options.openapiv2_pb2

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

OPENAPIV2_SWAGGER_FIELD_NUMBER: builtins.int
OPENAPIV2_OPERATION_FIELD_NUMBER: builtins.int
OPENAPIV2_SCHEMA_FIELD_NUMBER: builtins.int
OPENAPIV2_TAG_FIELD_NUMBER: builtins.int
OPENAPIV2_FIELD_FIELD_NUMBER: builtins.int
openapiv2_swagger: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FileOptions, protoc_gen_swagger.options.openapiv2_pb2.Swagger]
"""ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project.

All IDs are the same, as assigned. It is okay that they are the same, as they extend
different descriptor messages.
"""
openapiv2_operation: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MethodOptions, protoc_gen_swagger.options.openapiv2_pb2.Operation]
"""ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project.

All IDs are the same, as assigned. It is okay that they are the same, as they extend
different descriptor messages.
"""
openapiv2_schema: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MessageOptions, protoc_gen_swagger.options.openapiv2_pb2.Schema]
"""ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project.

All IDs are the same, as assigned. It is okay that they are the same, as they extend
different descriptor messages.
"""
openapiv2_tag: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.ServiceOptions, protoc_gen_swagger.options.openapiv2_pb2.Tag]
"""ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project.

All IDs are the same, as assigned. It is okay that they are the same, as they extend
different descriptor messages.
"""
openapiv2_field: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FieldOptions, protoc_gen_swagger.options.openapiv2_pb2.JSONSchema]
"""ID assigned by protobuf-global-extension-registry@google.com for grpc-gateway project.

All IDs are the same, as assigned. It is okay that they are the same, as they extend
different descriptor messages.
"""
20 changes: 20 additions & 0 deletions src/protoc_gen_swagger/options/annotations_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings


GRPC_GENERATED_VERSION = '1.73.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in protoc_gen_swagger/options/annotations_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
Loading