File tree 3 files changed +47
-4
lines changed
3 files changed +47
-4
lines changed Original file line number Diff line number Diff line change
1
+ """Script that exits 1 if the current environment is not
2
+ in sync with the `requirements-dev.lock` file.
3
+ """
4
+
5
+ from pathlib import Path
6
+
7
+ import importlib_metadata
8
+
9
+
10
+ def should_run_sync () -> bool :
11
+ dev_lock = Path (__file__ ).parent .parent .joinpath ("requirements-dev.lock" )
12
+
13
+ for line in dev_lock .read_text ().splitlines ():
14
+ if not line or line .startswith ("#" ) or line .startswith ("-e" ):
15
+ continue
16
+
17
+ dep , lock_version = line .split ("==" )
18
+
19
+ try :
20
+ version = importlib_metadata .version (dep )
21
+
22
+ if lock_version != version :
23
+ print (f"mismatch for { dep } current={ version } lock={ lock_version } " )
24
+ return True
25
+ except Exception :
26
+ print (f"could not import { dep } " )
27
+ return True
28
+
29
+ return False
30
+
31
+
32
+ def main () -> None :
33
+ if should_run_sync ():
34
+ exit (1 )
35
+ else :
36
+ exit (0 )
37
+
38
+
39
+ if __name__ == "__main__" :
40
+ main ()
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ dev-dependencies = [
60
60
" time-machine" ,
61
61
" nox" ,
62
62
" dirty-equals>=0.6.0" ,
63
+ " importlib-metadata>=6.7.0" ,
63
64
" azure-identity >=1.14.1" ,
64
65
" types-tqdm > 4"
65
66
]
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ annotated-types==0.6.0
11
11
anyio==4.1.0
12
12
argcomplete==3.1.2
13
13
attrs==23.1.0
14
- azure-core==1.29.5
14
+ azure-core==1.29.6
15
15
azure-identity==1.15.0
16
16
black==23.3.0
17
17
certifi==2023.7.22
@@ -29,18 +29,19 @@ h11==0.14.0
29
29
httpcore==1.0.2
30
30
httpx==0.25.2
31
31
idna==3.4
32
+ importlib-metadata==7.0.0
32
33
iniconfig==2.0.0
33
34
isort==5.10.1
34
35
msal==1.26.0
35
- msal-extensions==1.0 .0
36
+ msal-extensions==1.1 .0
36
37
mypy==1.7.1
37
38
mypy-extensions==1.0.0
38
39
nodeenv==1.8.0
39
40
nox==2023.4.22
40
41
numpy==1.26.2
41
42
packaging==23.2
42
- pandas==2.1.3
43
- pandas-stubs==2.1.1.230928
43
+ pandas==2.1.4
44
+ pandas-stubs==2.1.4.231218
44
45
pathspec==0.11.2
45
46
platformdirs==3.11.0
46
47
pluggy==1.3.0
@@ -69,5 +70,6 @@ typing-extensions==4.8.0
69
70
tzdata==2023.3
70
71
urllib3==2.1.0
71
72
virtualenv==20.24.5
73
+ zipp==3.17.0
72
74
# The following packages are considered to be unsafe in a requirements file:
73
75
setuptools==68.2.2
You can’t perform that action at this time.
0 commit comments