python-sdk-remote 0.0.92__py3-none-any.whl → 0.0.93__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_sdk_remote/constants.py +1 -1
- python_sdk_remote/get_dependencies.py +58 -0
- {python_sdk_remote-0.0.92.dist-info → python_sdk_remote-0.0.93.dist-info}/METADATA +1 -1
- {python_sdk_remote-0.0.92.dist-info → python_sdk_remote-0.0.93.dist-info}/RECORD +6 -5
- {python_sdk_remote-0.0.92.dist-info → python_sdk_remote-0.0.93.dist-info}/WHEEL +0 -0
- {python_sdk_remote-0.0.92.dist-info → python_sdk_remote-0.0.93.dist-info}/top_level.txt +0 -0
python_sdk_remote/constants.py
CHANGED
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
from logger_local.LoggerComponentEnum import LoggerComponentEnum
|
|
4
4
|
|
|
5
5
|
PYTHON_SDK_LOCAL_COMPONENT_ID = 184
|
|
6
|
-
PYTHON_SDK_LOCAL_COMPONENT_NAME = '
|
|
6
|
+
PYTHON_SDK_LOCAL_COMPONENT_NAME = 'python_sdk_remote'
|
|
7
7
|
|
|
8
8
|
ENVIRONMENT_NAME = os.getenv("ENVIRONMENT_NAME")
|
|
9
9
|
BRAND_NAME = os.getenv("BRAND_NAME")
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# pip install BeautifulSoup4 requests importlib-metadata
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import json
|
|
5
|
+
from collections import defaultdict
|
|
6
|
+
|
|
7
|
+
import importlib_metadata
|
|
8
|
+
import requests
|
|
9
|
+
from bs4 import BeautifulSoup
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def install(packages):
|
|
13
|
+
print("Installing...", packages)
|
|
14
|
+
if isinstance(packages, str):
|
|
15
|
+
packages = [packages]
|
|
16
|
+
try:
|
|
17
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "-U", "--no-deps"] + packages, check=False)
|
|
18
|
+
except Exception as e:
|
|
19
|
+
print(e)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_dependencies_per_package(include_packages):
|
|
23
|
+
dependencies_per_package = defaultdict(list)
|
|
24
|
+
for dist in importlib_metadata.distributions():
|
|
25
|
+
package_name = dist.metadata['Name']
|
|
26
|
+
if package_name not in include_packages:
|
|
27
|
+
continue
|
|
28
|
+
|
|
29
|
+
dependencies = dist.metadata.get_all('Requires-Dist', [])
|
|
30
|
+
for dependency in dependencies:
|
|
31
|
+
depend_on = dependency.split()[0]
|
|
32
|
+
if depend_on in include_packages:
|
|
33
|
+
dependencies_per_package[depend_on].append(package_name)
|
|
34
|
+
|
|
35
|
+
return dependencies_per_package
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def get_included_packages():
|
|
39
|
+
url = "https://pypi.org/user/circles/"
|
|
40
|
+
class_name = "package-snippet__title"
|
|
41
|
+
|
|
42
|
+
response = requests.get(url)
|
|
43
|
+
soup = BeautifulSoup(response.text, "html.parser")
|
|
44
|
+
package_names = soup.find_all("h3", class_=class_name)
|
|
45
|
+
included_packages = [package_name.text for package_name in package_names]
|
|
46
|
+
install(included_packages)
|
|
47
|
+
return included_packages
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def main():
|
|
51
|
+
include_packages = get_included_packages()
|
|
52
|
+
dependencies_per_package = get_dependencies_per_package(include_packages)
|
|
53
|
+
with open('dependencies.json', 'w') as f:
|
|
54
|
+
json.dump(dependencies_per_package, f, indent=4)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if __name__ == "__main__":
|
|
58
|
+
main()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
python_sdk_remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
python_sdk_remote/constants.py,sha256=
|
|
2
|
+
python_sdk_remote/constants.py,sha256=JxgyxvUsE1U78bAtmpTMi_5-tFlzm18kjZrjTRy3ngU,1142
|
|
3
|
+
python_sdk_remote/get_dependencies.py,sha256=C4erKsifmBRztgak1QLtI9_4qidkmmdd7j9GTJiWRjE,1757
|
|
3
4
|
python_sdk_remote/http_response.py,sha256=V41nUBDOsKc7lL0QfBDNY98gPsOaDGNytTsZvMJ24dQ,2819
|
|
4
5
|
python_sdk_remote/item.py,sha256=HnSLHkZTKTLNhlaZoPhKAwqG-yHPsd7zvqPPOqnrKVg,287
|
|
5
6
|
python_sdk_remote/mini_logger.py,sha256=y24kZgGhh0lySoAD_HLAjp7jDca9fPItrNjKabhgDgc,3790
|
|
@@ -8,7 +9,7 @@ python_sdk_remote/unified_json.py,sha256=tLkikIVpFAtpioYwtovkGX8-3U9YElGWe4Ph34q
|
|
|
8
9
|
python_sdk_remote/utilities.py,sha256=6nzFctCgvWmlTLswv6HD3x0UUG3ivRpCujy_WPavbJ4,9664
|
|
9
10
|
python_sdk_remote/valid_json_versions.py,sha256=-ZU65JYI6gTEfK8o6gu9Dmm9SQmwzj5pDbEXiyUbBhQ,138
|
|
10
11
|
python_sdk_remote/validate_environment.py,sha256=_h2cHtFT76J30m-ezqe_Dj2zevI4hzReXu6oXV7XHww,2441
|
|
11
|
-
python_sdk_remote-0.0.
|
|
12
|
-
python_sdk_remote-0.0.
|
|
13
|
-
python_sdk_remote-0.0.
|
|
14
|
-
python_sdk_remote-0.0.
|
|
12
|
+
python_sdk_remote-0.0.93.dist-info/METADATA,sha256=8vXH97rSzvtRRWxx1nEyng1M5bFri8S_ZJ-OFLhgiW4,595
|
|
13
|
+
python_sdk_remote-0.0.93.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
14
|
+
python_sdk_remote-0.0.93.dist-info/top_level.txt,sha256=JTpEq_svPlI5hTlPq30Ne-NkR-u5464gjVDP2U74PvE,18
|
|
15
|
+
python_sdk_remote-0.0.93.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|