11import requests
22
33shared_library_version = "1.7.10"
4- github_download_url = "https://github.com// bogdanfinn/tls-client/releases/download/v{}/{}"
4+ github_download_url = "https://github.com/bogdanfinn/tls-client/releases/download/v{}/{}"
55github_repo_filenames = [
66 # Windows
7- f"tls-client-windows-32-v { shared_library_version } .dll" ,
8- f"tls-client-windows-64-v { shared_library_version } .dll" ,
7+ f"tls-client-windows-32-{ shared_library_version } .dll" ,
8+ f"tls-client-windows-64-{ shared_library_version } .dll" ,
99 # MacOS
10- f"tls-client-darwin-arm64-v { shared_library_version } .dylib" ,
11- f"tls-client-darwin-amd64-v { shared_library_version } .dylib" ,
10+ f"tls-client-darwin-arm64-{ shared_library_version } .dylib" ,
11+ f"tls-client-darwin-amd64-{ shared_library_version } .dylib" ,
1212 # Linux
13- f"tls-client-linux-alpine-amd64-v{ shared_library_version } .so" ,
14- f"tls-client-linux-ubuntu-amd64-v{ shared_library_version } .so" ,
15- f"tls-client-linux-arm64-v{ shared_library_version } .so"
13+ # f"tls-client-linux-alpine-amd64-{shared_library_version}.so", # Removed in 1.7.8
14+ f"tls-client-linux-ubuntu-amd64-{ shared_library_version } .so" ,
15+ f"tls-client-linux-ubuntu-amd64-{ shared_library_version } .so" ,
16+ f"tls-client-linux-arm64-{ shared_library_version } .so"
1617]
1718dependency_filenames = [
1819 # Windows
2829]
2930
3031for github_filename , dependency_filename in zip (github_repo_filenames , dependency_filenames ):
31- response = requests .get (
32- url = github_download_url .format (shared_library_version , github_filename )
33- )
34-
35- with open (f"../async_tls_client/dependencies/{ dependency_filename } " , "wb" ) as f :
32+ filepath = f"../async_tls_client/dependencies/{ dependency_filename } "
33+ url = github_download_url .format (shared_library_version , github_filename )
34+ print (f'Downloading { url } ...' )
35+ response = requests .get (url = url )
36+ if not response .ok :
37+ print (f'Failed to fetch ({ response .status_code } )' )
38+ print (f'Writing to "{ filepath } "...' )
39+ with open (filepath , "wb" ) as f :
3640 f .write (response .content )
0 commit comments