Skip to content

Commit bcf20e0

Browse files
authored
ci: automate min_compatible_versions updates (#12300)
This change adds a github actions step that fails if there's a diff between `min_compatible_versions.csv` on the base branch and what would be generated on the PR branch. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent a0fa9d0 commit bcf20e0

File tree

7 files changed

+70
-64
lines changed

7 files changed

+70
-64
lines changed

.github/workflows/requirements-locks.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,14 @@ jobs:
3131
- name: Generate riot locks
3232
run: scripts/compile-and-prune-test-requirements
3333

34-
- name: Check git diff
34+
- name: Check locks diff
3535
run: scripts/check-diff '.riot/requirements/' 'Mismatches found between .riot/requirements/*.txt and riotfile.py. Run scripts/compile-and-prune-test-requirements and commit the result.'
36+
37+
- name: Generate min_compatible_versions
38+
run: python scripts/min_compatible_versions.py
39+
40+
- name: Check min_compatible_versions diff
41+
run: scripts/check-diff 'min_compatible_versions.csv' 'Mismatches found between min_compatible_versions.csv and riotfile.py. Run `python scripts/min_compatible_versions.py` and commit the result.'
42+
43+
- name: Check lib-injection min_compatible_versions diff
44+
run: scripts/check-diff 'lib-injection/sources/min_compatible_versions.csv' 'Mismatches found between min_compatible_versions.csv and riotfile.py. Run `python scripts/min_compatible_versions.py` and commit the result.'

.riot/requirements/1d21cf3.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

.riot/requirements/4e93dc8.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.8
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/4e93dc8.in
6+
#
7+
attrs==25.1.0
8+
certifi==2025.1.31
9+
chardet==3.0.4
10+
coverage[toml]==7.6.1
11+
exceptiongroup==1.2.2
12+
hypothesis==6.45.0
13+
idna==2.8
14+
importlib-metadata==8.5.0
15+
iniconfig==2.0.0
16+
mock==5.1.0
17+
opentracing==2.4.0
18+
packaging==24.2
19+
pluggy==1.5.0
20+
pytest==8.3.4
21+
pytest-cov==5.0.0
22+
pytest-mock==3.14.0
23+
pytest-randomly==3.15.0
24+
requests==2.22.0
25+
requests-mock==1.12.1
26+
sortedcontainers==2.4.0
27+
tomli==2.2.1
28+
urllib3==1.25.11
29+
zipp==3.20.2

lib-injection/sources/min_compatible_versions.csv

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ bottle,>=0.12
3131
bytecode,0
3232
cassandra-driver,~=3.24.0
3333
cattrs,<23.1.1
34-
celery,~=5.1.0
34+
celery,~=5.2
3535
celery[redis],0
3636
cfn-lint,~=0.53.1
37-
channels,~=3.0
37+
channels,0
3838
cherrypy,>=17
39-
cohere,==4.57
39+
cohere,==5.4.0
4040
confluent-kafka,~=1.9.2
4141
coverage,0
4242
cryptography,<39
@@ -76,7 +76,7 @@ googleapis-common-protos,0
7676
graphene,~=3.0.0
7777
graphql-core,~=3.2.0
7878
graphql-relay,0
79-
greenlet,~=1.0.0
79+
greenlet,~=1.0
8080
grpcio,~=1.34.0
8181
gunicorn,==20.0.4
8282
gunicorn[gevent],0
@@ -85,25 +85,25 @@ httpx,~=0.17.0
8585
huggingface-hub,0
8686
hypothesis,<6.45.1
8787
importlib-metadata,0
88-
importlib_metadata,<5.0
88+
importlib_metadata,0
8989
itsdangerous,<2.0
9090
jinja2,~=2.10.0
9191
kombu,>=4.2.0
92-
langchain,==0.0.192
92+
langchain,==0.1.20
9393
langchain-anthropic,==0.1.11
9494
langchain-aws,==0.1.3
9595
langchain-cohere,==0.1.4
96-
langchain-community,==0.0.14
96+
langchain-community,==0.0.38
9797
langchain-core,==0.1.52
9898
langchain-openai,==0.1.6
9999
langchain-pinecone,==0.1.0
100-
langchain_experimental,==0.0.47
100+
langgraph,~=0.2.60
101101
logbook,~=1.0.0
102102
loguru,~=0.4.0
103103
lxml,0
104104
lz4,0
105105
mako,~=1.1.0
106-
mariadb,~=1.0.0
106+
mariadb,~=1.0
107107
markupsafe,<2.0
108108
mock,0
109109
molten,>=1.0
@@ -115,17 +115,16 @@ msgpack,~=1.0.0
115115
mysql-connector-python,==8.0.5
116116
mysqlclient,~=2.0
117117
numexpr,==2.8.5
118-
openai,==0.26.5
119-
openai[datalib],==1.30.1
120-
"openai[embeddings,datalib]",==1.1.1
118+
openai,==1.30.3
119+
"openai[embeddings,datalib]",==1.0.0
121120
opensearch-py,0
122121
opensearch-py[async],0
123122
opensearch-py[requests],~=1.1.0
124123
opentelemetry-api,~=1.0.0
125124
opentelemetry-instrumentation-flask,0
126125
opentracing,>=2.0.0
127126
peewee,0
128-
pinecone-client,==2.2.4
127+
pinecone-client,0
129128
pony,0
130129
protobuf,>=3
131130
psutil,0
@@ -159,15 +158,14 @@ ragas,==0.1.21
159158
redis,~=2.0
160159
redis-py-cluster,>=2.0
161160
reno,0
162-
requests,~=2.20.0
161+
requests,~=2.22.0
163162
requests-mock,>=1.4
164163
responses,~=0.16.0
165164
rich,0
166165
rq,~=1.8.0
167166
ruamel.yaml,0
168167
sanic,~=20.12
169168
sanic-testing,~=0.8.3
170-
scikit-learn,==1.0.2
171169
simplejson,0
172170
snowflake-connector-python,~=2.3.0
173171
spyne,0
@@ -182,6 +180,7 @@ typing-extensions,0
182180
typing_extensions,0
183181
urllib3,~=1.0
184182
uwsgi,0
183+
valkey,0
185184
vcrpy,==4.2.1
186185
vertexai,0
187186
vertica-python,>=0.6.0

min_compatible_versions.csv

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ bottle,>=0.12
3131
bytecode,0
3232
cassandra-driver,~=3.24.0
3333
cattrs,<23.1.1
34-
celery,~=5.1.0
34+
celery,~=5.2
3535
celery[redis],0
3636
cfn-lint,~=0.53.1
37-
channels,~=3.0
37+
channels,0
3838
cherrypy,>=17
39-
cohere,==4.57
39+
cohere,==5.4.0
4040
confluent-kafka,~=1.9.2
4141
coverage,0
4242
cryptography,<39
@@ -76,7 +76,7 @@ googleapis-common-protos,0
7676
graphene,~=3.0.0
7777
graphql-core,~=3.2.0
7878
graphql-relay,0
79-
greenlet,~=1.0.0
79+
greenlet,~=1.0
8080
grpcio,~=1.34.0
8181
gunicorn,==20.0.4
8282
gunicorn[gevent],0
@@ -85,25 +85,25 @@ httpx,~=0.17.0
8585
huggingface-hub,0
8686
hypothesis,<6.45.1
8787
importlib-metadata,0
88-
importlib_metadata,<5.0
88+
importlib_metadata,0
8989
itsdangerous,<2.0
9090
jinja2,~=2.10.0
9191
kombu,>=4.2.0
92-
langchain,==0.0.192
92+
langchain,==0.1.20
9393
langchain-anthropic,==0.1.11
9494
langchain-aws,==0.1.3
9595
langchain-cohere,==0.1.4
96-
langchain-community,==0.0.14
96+
langchain-community,==0.0.38
9797
langchain-core,==0.1.52
9898
langchain-openai,==0.1.6
9999
langchain-pinecone,==0.1.0
100-
langchain_experimental,==0.0.47
100+
langgraph,~=0.2.60
101101
logbook,~=1.0.0
102102
loguru,~=0.4.0
103103
lxml,0
104104
lz4,0
105105
mako,~=1.1.0
106-
mariadb,~=1.0.0
106+
mariadb,~=1.0
107107
markupsafe,<2.0
108108
mock,0
109109
molten,>=1.0
@@ -115,17 +115,16 @@ msgpack,~=1.0.0
115115
mysql-connector-python,==8.0.5
116116
mysqlclient,~=2.0
117117
numexpr,==2.8.5
118-
openai,==0.26.5
119-
openai[datalib],==1.30.1
120-
"openai[embeddings,datalib]",==1.1.1
118+
openai,==1.30.3
119+
"openai[embeddings,datalib]",==1.0.0
121120
opensearch-py,0
122121
opensearch-py[async],0
123122
opensearch-py[requests],~=1.1.0
124123
opentelemetry-api,~=1.0.0
125124
opentelemetry-instrumentation-flask,0
126125
opentracing,>=2.0.0
127126
peewee,0
128-
pinecone-client,==2.2.4
127+
pinecone-client,0
129128
pony,0
130129
protobuf,>=3
131130
psutil,0
@@ -159,15 +158,14 @@ ragas,==0.1.21
159158
redis,~=2.0
160159
redis-py-cluster,>=2.0
161160
reno,0
162-
requests,~=2.20.0
161+
requests,~=2.22.0
163162
requests-mock,>=1.4
164163
responses,~=0.16.0
165164
rich,0
166165
rq,~=1.8.0
167166
ruamel.yaml,0
168167
sanic,~=20.12
169168
sanic-testing,~=0.8.3
170-
scikit-learn,==1.0.2
171169
simplejson,0
172170
snowflake-connector-python,~=2.3.0
173171
spyne,0
@@ -182,7 +180,7 @@ typing-extensions,0
182180
typing_extensions,0
183181
urllib3,~=1.0
184182
uwsgi,0
185-
valkey,~=6.0.0
183+
valkey,0
186184
vcrpy,==4.2.1
187185
vertexai,0
188186
vertica-python,>=0.6.0

riotfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
12711271
pys="3.8",
12721272
pkgs={
12731273
"requests": [
1274-
"~=2.23.0",
1274+
"~=2.22.0",
12751275
latest,
12761276
],
12771277
},

scripts/min_compatible_versions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
OUT_DIRECTORIES = (".", "lib-injection/sources")
1717
IGNORED_PACKAGES = {
1818
"attrs",
19+
"bcrypt",
1920
"botocore",
2021
"click",
2122
"pillow",
@@ -55,7 +56,7 @@ def _tree_pkgs_from_riot(node: riotfile.Venv) -> Dict[str, Set]:
5556
def min_version_spec(version_specs: List[str]) -> str:
5657
min_numeric = ""
5758
min_spec = ""
58-
for spec in version_specs:
59+
for spec in sorted(version_specs):
5960
numeric = parse_version(spec.strip("~==<>"))
6061
if not min_numeric or numeric < min_numeric:
6162
min_numeric = numeric

0 commit comments

Comments
 (0)