sdv-installer 0.0.0.dev11__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.
@@ -0,0 +1,173 @@
1
+ """System requirements utility functions."""
2
+
3
+ import platform
4
+ import re
5
+ import subprocess
6
+ import sys
7
+ import sysconfig
8
+
9
+ import pip
10
+ from packaging.tags import sys_tags
11
+ from packaging.version import Version
12
+
13
+ from sdv_installer.constants import (
14
+ MAX_PYTHON_VERSION,
15
+ MIN_PYTHON_VERSION,
16
+ REQUIRED_BITNESS,
17
+ )
18
+ from sdv_installer.utils.console_utils import print_message
19
+
20
+
21
+ def get_os_info():
22
+ """Detects the operating system type and version.
23
+
24
+ Returns:
25
+ Tuple[str, str, Optional[str], bool]: A tuple containing:
26
+ - os_system (str): 'macOS', 'Linux', or other OS name.
27
+ - os_version (str): The major OS version (e.g., '14').
28
+ - linux_distro (Optional[str]): Pretty name of the Linux distribution, if applicable.
29
+ - is_linux (bool): Whether the OS is Linux.
30
+ """
31
+ system = platform.system()
32
+ version = platform.version()
33
+ is_linux = sys.platform == 'linux'
34
+ linux_distro = None
35
+
36
+ if sys.platform == 'darwin':
37
+ version = subprocess.check_output(['sw_vers', '-productVersion'], text=True).strip()
38
+ system = 'macOS'
39
+
40
+ elif is_linux:
41
+ version = platform.release()
42
+ output = subprocess.run('cat /etc/*-release', shell=True, capture_output=True, text=True)
43
+ match = re.search(r"PRETTY_NAME='(.*)'", output.stdout.strip())
44
+ linux_distro = match.group(1) if match else None
45
+
46
+ return system, version.split('.')[0], linux_distro, is_linux
47
+
48
+
49
+ def get_architecture():
50
+ """Determines the system architecture (e.g., arm64, x86_64).
51
+
52
+ Returns:
53
+ str: The system's architecture identifier.
54
+ """
55
+ if platform.system().lower() == 'windows':
56
+ return sysconfig.get_platform()
57
+
58
+ return subprocess.check_output(['uname', '-m'], text=True).strip().lower()
59
+
60
+
61
+ def get_current_platform_tag():
62
+ """Returns the normalized platform tag for the current system."""
63
+ return sysconfig.get_platform().replace('-', '_').replace('.', '_')
64
+
65
+
66
+ def get_python_version_code():
67
+ """Returns the current Python major and minor version as a tuple."""
68
+ major = sys.version_info.major
69
+ minor = sys.version_info.minor
70
+ return Version(f'{major}.{minor}')
71
+
72
+
73
+ def get_system_info():
74
+ """Collects all relevant system information for SDV Installer validation.
75
+
76
+ Returns:
77
+ dict: A dictionary with system attributes including:
78
+ - os_system (str)
79
+ - os_version (str)
80
+ - linux_distro (Optional[str])
81
+ - architecture (str)
82
+ - python_version (str)
83
+ - system_bit (str)
84
+ - pip_version (str)
85
+ - platform_tag (str)
86
+ - processor (str)
87
+ - is_linux (bool)
88
+ """
89
+ os_system, os_version, linux_distro, is_linux = get_os_info()
90
+ arch = get_architecture()
91
+ python_version = platform.python_version()
92
+ bitness = '64-bit' if sys.maxsize > 2**32 else '32-bit'
93
+ pip_version = pip.__version__
94
+ processor = platform.processor()
95
+ platform_tag = get_current_platform_tag()
96
+
97
+ return {
98
+ 'os_system': os_system,
99
+ 'os_version': os_version,
100
+ 'linux_distro': linux_distro,
101
+ 'architecture': arch,
102
+ 'python_version': python_version,
103
+ 'system_bit': bitness,
104
+ 'pip_version': pip_version,
105
+ 'platform_tag': platform_tag,
106
+ 'processor': processor,
107
+ 'is_linux': is_linux,
108
+ }
109
+
110
+
111
+ def get_user_supported_tags():
112
+ """Retrieves the set of platform tags supported by the current Python environment.
113
+
114
+ These tags are used to determine compatibility with precompiled wheels.
115
+
116
+ Returns:
117
+ Set[str]:
118
+ A set of supported platform tag strings.
119
+ """
120
+ return {tag.platform for tag in sys_tags()}
121
+
122
+
123
+ def validate_system_requirements(info):
124
+ """Validates the current system against the minimum technical requirements.
125
+
126
+ Args:
127
+ info (dict): A dictionary containing system info (as from `get_system_info`).
128
+
129
+ Returns:
130
+ List[str]: A list of keys that failed validation (e.g., ['python_version']).
131
+ """
132
+ errors = []
133
+ python_version = get_python_version_code()
134
+ if python_version < MIN_PYTHON_VERSION or python_version > MAX_PYTHON_VERSION:
135
+ errors.append('python_version')
136
+
137
+ if info['system_bit'] != REQUIRED_BITNESS:
138
+ errors.append('system_bit')
139
+
140
+ return errors
141
+
142
+
143
+ def print_check_results():
144
+ """Runs the system checks and prints the result in a user-friendly format."""
145
+ print_message('Verifying system requirements for SDV Enterprise: \n')
146
+ info = get_system_info()
147
+ errors = validate_system_requirements(info)
148
+
149
+ def mark(key):
150
+ return ' (!)' if key in errors else ''
151
+
152
+ print_message(f'Operating system: {info["os_system"]}')
153
+ print_message(f'OS Version: {info["os_version"]}')
154
+ if info['is_linux'] and info['linux_distro']:
155
+ print_message(f'Linux Distribution: {info["linux_distro"]}')
156
+
157
+ print_message(f'Architecture: {info["architecture"]}')
158
+ print_message(f'Python Version: {info["python_version"]}{mark("python_version")}')
159
+ print_message(f'System bit: {info["system_bit"]}{mark("system_bit")}')
160
+ print_message(f'Pip version: {info["pip_version"]}')
161
+
162
+ print_message(f'\nResult: {"Passed" if not errors else "Failed"}')
163
+ if not errors:
164
+ print_message('Your system meets the technical requirements for SDV Enterprise.')
165
+ sys.exit(0)
166
+ else:
167
+ print_message(
168
+ 'Your system may not meet the technical requirements for SDV Enterprise. '
169
+ 'Please check the items marked by (!) and try updating the SDV '
170
+ "Installer if something doesn't seem right."
171
+ )
172
+ print_message('The most up-to-date requirements are on the SDV Enterprise docs site.')
173
+ sys.exit(1)
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: sdv-installer
3
+ Version: 0.0.0.dev11
4
+ Summary: Package to install SDV Enterprise packages.
5
+ Author-email: "DataCebo, Inc." <info@datacebo.com>
6
+ License: MIT
7
+ Keywords: sdv,synthetic-data,synthetic-data-generation,timeseries,single-table,multi-table
8
+ Classifier: Development Status :: 1 - Planning
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: Free for non-commercial use
11
+ Classifier: Natural Language :: English
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: <3.14,>=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: requests
24
+ Requires-Dist: platformdirs
25
+ Requires-Dist: pip
26
+ Requires-Dist: packaging
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest; extra == "test"
29
+ Requires-Dist: invoke; extra == "test"
30
+ Requires-Dist: packaging; extra == "test"
31
+ Provides-Extra: dev
32
+ Requires-Dist: pip>=9.0.1; extra == "dev"
33
+ Requires-Dist: pytest; extra == "dev"
34
+ Requires-Dist: invoke; extra == "dev"
35
+ Requires-Dist: bump-my-version>=0.18.3; extra == "dev"
36
+ Requires-Dist: ruff>=0.7.1; extra == "dev"
37
+ Requires-Dist: twine<4,>=1.10.0; extra == "dev"
38
+ Requires-Dist: wheel>=0.30.0; extra == "dev"
39
+ Requires-Dist: coverage; extra == "dev"
40
+ Requires-Dist: tomli; extra == "dev"
41
+ Dynamic: license-file
42
+
43
+ _This package is part of [The Synthetic Data Vault Project](https://sdv.dev/),
44
+ a project from [DataCebo](https://datacebo.com/)._
45
+
46
+ # Overview
47
+
48
+ The [**Synthetic Data Vault**](https://docs.sdv.dev/sdv) (SDV) is a Python
49
+ library designed to be your one-stop shop for creating tabular synthetic data.
50
+ You can get started with the publicly-available SDV Community for exploring the
51
+ benefits of synthetic data. When you're ready to take synthetic data to the
52
+ next level, upgrade to [SDV Enterprise](https://docs.sdv.dev/sdv/explore/sdv-enterprise)
53
+ and purchase [Bundles](https://docs.sdv.dev/sdv/explore/sdv-bundles) to access additional features.
54
+
55
+ This package provides a CLI for SDV Enterprise customers to easily access and
56
+ manage all SDV-related software. It allows you to:
57
+
58
+ * Input your SDV username and license key
59
+ * List out all the SDV-related packages that you have access to
60
+ * Download and install those packages
61
+
62
+ ```
63
+ % sdv-installer install
64
+
65
+ Username: <email>
66
+ License Key: ********************************
67
+
68
+ Installing SDV Enterprise:
69
+ sdv-enterprise (version 0.30.0) - Installed!
70
+
71
+ Installing Bundles:
72
+ bundle-cag - Installed!
73
+ bundle-xsynthesizers - Installed!
74
+
75
+ Success! All packages have been installed. You are ready to use SDV Enterprise.
76
+ ```
77
+
78
+ # How it works
79
+
80
+ The SDV Installer is a convenience wrapper around
81
+ [pip](https://pypi.org/project/pip/), the package installer for Python.
82
+ Under-the-hood, SDV Installer takes your input, determines which
83
+ package you can access, and calls pip to install those packages with the
84
+ appropriate flags and options.
85
+
86
+ To see the exact pip commands, use the `--debug` flag:
87
+
88
+ ```
89
+ % sdv-installer install --debug
90
+
91
+ Username: <email>
92
+ License Key: ********************************
93
+
94
+ Installing SDV Enterprise:
95
+
96
+ pip install sdv-enterprise==0.30.0 --index-url <URL>@pypi.datacebo.com/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.datacebo.com
97
+
98
+ Installing Bundles:
99
+ ...
100
+
101
+ Success! All packages have been installed. You are ready to use SDV Enterprise.
102
+ ```
103
+
104
+ # Get the SDV Installer
105
+
106
+ Get the latest version of the SDV Installer.
107
+
108
+ ```
109
+ pip install sdv-installer --update
110
+ ```
111
+
112
+ SDV Installer is set up to access and manage all SDV-related packages – SDV
113
+ Enterprise, as well as Bundles. You can manage installation for a variety of
114
+ scenarios, including offline installation, partial installation, upgrading, and
115
+ more.
116
+
117
+
118
+ **For more details about installing SDV Enterprise, please see our
119
+ [Installation
120
+ Guide](https://docs.sdv.dev/sdv-enterprise/installation/instructions).**
@@ -0,0 +1,21 @@
1
+ sdv_installer/__init__.py,sha256=RXeNlhAjGFz_gGk863kczpcHlW6cT51e0hxKRNahmdo,142
2
+ sdv_installer/config.py,sha256=SvS980hLC9nVDHNF7-B-yeVbylvYCELYEL131mXWzgs,534
3
+ sdv_installer/constants.py,sha256=6Br9LZhun3q779UI64kBiEdYKs4Ene-n0H18lQ-T2-Q,3241
4
+ sdv_installer/authentication/__init__.py,sha256=-iqEkKCShkX8sfR31olJQwgdgPNP9xcoHFdGc_YI6tQ,212
5
+ sdv_installer/authentication/authentication.py,sha256=5p_SOUN_SfEiyH7Jp7iy6DTBgulC7mpeXYpkp2Q3lCg,2255
6
+ sdv_installer/cli/__init__.py,sha256=JMCw-iO9uuWICi6BI8nHcMhJ4quXye32FE_BX2eKlfQ,44
7
+ sdv_installer/cli/__main__.py,sha256=vGeXYvceBg1BMkHenoqdYjaeS-4nyFVEsEoku9KJgzU,4927
8
+ sdv_installer/installation/__init__.py,sha256=5Uf1aAq89-END8vbHtZV3rcfN7wWfp887EKAw-t-t1U,350
9
+ sdv_installer/installation/installer.py,sha256=yIGWXmGsNlRiQ1u4Abm1hkYq7Q7q-RFpp9OuJQNwWtg,16289
10
+ sdv_installer/utils/__init__.py,sha256=NLBXxSvHn2rEoyo6CxuM-CFAyPSBwnb2oocwQGBES1A,1572
11
+ sdv_installer/utils/console_utils.py,sha256=seNY-tntEZ5HUhiehsHetgVdcf-rSTGaduK2sbRR71c,9202
12
+ sdv_installer/utils/data_storage.py,sha256=aVWwqwQQ9WpFKgJyMKTc-9vDG3Bly-amvFDWv0kjoMM,2619
13
+ sdv_installer/utils/package_utils.py,sha256=qydAmKCndXOuUODvZsC3YI_7wpoWtFIsZmtJvXZOKkk,9034
14
+ sdv_installer/utils/request_error_handling.py,sha256=C5hFXL8r8HbBWAZB0NzGc1owWyjc84QXvrrDN9Jv4os,1975
15
+ sdv_installer/utils/system_requirements.py,sha256=SVCNodGfQRfvlVPqt-prjq1l53cVX7w_WWXC856dFFY,5750
16
+ sdv_installer-0.0.0.dev11.dist-info/licenses/LICENSE,sha256=yvPXLYJjZGdrkpah9WFuFg_V6kdZuwgyGkDLrJMMTV0,1065
17
+ sdv_installer-0.0.0.dev11.dist-info/METADATA,sha256=bAZmeyk6lfBepc8asMZu_qNM57suwm-pZSO7G9jWrwY,4197
18
+ sdv_installer-0.0.0.dev11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ sdv_installer-0.0.0.dev11.dist-info/entry_points.txt,sha256=ozVfQCFQrrd5TZgfBk_wbUBpM_WkKDJCLpEHS6BAIDU,69
20
+ sdv_installer-0.0.0.dev11.dist-info/top_level.txt,sha256=JZIG54yO4VvC8VDszSiKdCyBZyxos0BUkFADrBBYWXI,14
21
+ sdv_installer-0.0.0.dev11.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sdv-installer = sdv_installer.cli.__main__:run_cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 DataCebo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ sdv_installer