Skip to content
Merged
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
4 changes: 3 additions & 1 deletion scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def _normalize_release(release: dict) -> dict:
return normalized


def main(fail_on_changes: bool = False) -> None:
def main(fail_on_changes: bool = False) -> dict[str, list]:
"""
Generate tox.ini from the tox.jinja template.

Expand Down Expand Up @@ -825,6 +825,8 @@ def main(fail_on_changes: bool = False) -> None:
"files to reflect the new test targets."
)

return packages


if __name__ == "__main__":
fail_on_changes = len(sys.argv) == 2 and sys.argv[1] == "--fail-on-changes"
Expand Down
55 changes: 55 additions & 0 deletions scripts/update_integration_support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""
Small utility to determine the actual minimum supported version of each framework/library.
"""

import os
import sys
from textwrap import dedent

populate_tox_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "populate_tox"
)
sys.path.append(populate_tox_dir)

from populate_tox import main


def update():
print("Running populate_tox.py...")
packages = main()

print("Figuring out the lowest supported version of integrations...")
min_versions = []

for _, integrations in packages.items():
for integration in integrations:
min_versions.append(
(integration["integration_name"], str(integration["releases"][0]))
)

min_versions = sorted(
set(
[
(integration, tuple([int(v) for v in min_version.split(".")]))
for integration, min_version in min_versions
]
)
)

print()
print("Effective minimal versions:")
print(
dedent("""
- The format is the same as _MIN_VERSIONS in sentry_sdk/integrations/__init__.py for easy replacing.
- When updating these, make sure to also update:
- The docs page for the integration
- The lower bounds in extras_require in setup.py
""")
)
print()
for integration, min_version in min_versions:
print(f'"{integration}": {min_version},')


if __name__ == "__main__":
update()