sdv-installer 0.4.1__tar.gz → 0.4.2.dev0__tar.gz

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.
Files changed (26) hide show
  1. {sdv_installer-0.4.1/sdv_installer.egg-info → sdv_installer-0.4.2.dev0}/PKG-INFO +1 -1
  2. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/pyproject.toml +1 -1
  3. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/__init__.py +1 -1
  4. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/cli/__main__.py +1 -1
  5. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/constants.py +54 -1
  6. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/system_requirements.py +102 -7
  7. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0/sdv_installer.egg-info}/PKG-INFO +1 -1
  8. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/LICENSE +0 -0
  9. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/README.md +0 -0
  10. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/authentication/__init__.py +0 -0
  11. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/authentication/authentication.py +0 -0
  12. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/cli/__init__.py +0 -0
  13. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/config.py +0 -0
  14. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/installation/__init__.py +0 -0
  15. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/installation/installer.py +0 -0
  16. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/__init__.py +0 -0
  17. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/console_utils.py +0 -0
  18. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/data_storage.py +0 -0
  19. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/package_utils.py +0 -0
  20. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer/utils/request_error_handling.py +0 -0
  21. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer.egg-info/SOURCES.txt +0 -0
  22. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer.egg-info/dependency_links.txt +0 -0
  23. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer.egg-info/entry_points.txt +0 -0
  24. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer.egg-info/requires.txt +0 -0
  25. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/sdv_installer.egg-info/top_level.txt +0 -0
  26. {sdv_installer-0.4.1 → sdv_installer-0.4.2.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdv-installer
3
- Version: 0.4.1
3
+ Version: 0.4.2.dev0
4
4
  Summary: Package to install SDV Enterprise packages.
5
5
  Author-email: "DataCebo, Inc." <info@datacebo.com>
6
6
  License-Expression: MIT
@@ -165,7 +165,7 @@ max-doc-length = 100
165
165
  max-line-length = 100
166
166
 
167
167
  [tool.bumpversion]
168
- current_version = "0.4.1"
168
+ current_version = "0.4.2.dev0"
169
169
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
170
170
  serialize = [
171
171
  '{major}.{minor}.{patch}.{release}{candidate}',
@@ -4,4 +4,4 @@ from sdv_installer import config, constants
4
4
 
5
5
 
6
6
  __all__ = ('config', 'constants')
7
- __version__ = '0.4.1'
7
+ __version__ = '0.4.2.dev0'
@@ -14,7 +14,7 @@ from sdv_installer.installation import (
14
14
  from sdv_installer.utils.system_requirements import print_check_results
15
15
 
16
16
  # Adding a new version here to avoid circular imports
17
- SDV_INSTALLER_VERSION = '0.4.1'
17
+ SDV_INSTALLER_VERSION = '0.4.2.dev0'
18
18
 
19
19
 
20
20
  def _validate_install_args(args):
@@ -1,5 +1,6 @@
1
1
  """Constants used across the SDV-Installer."""
2
2
 
3
+ from datetime import date
3
4
  from enum import IntEnum
4
5
 
5
6
  try:
@@ -14,8 +15,60 @@ from sdv_installer.config import PYPI_URL
14
15
 
15
16
  # System Requirement Constants
16
17
 
17
- MIN_PYTHON_VERSION = Version('3.9')
18
18
  MAX_PYTHON_VERSION = Version('3.14')
19
+
20
+ PYTHON_EOL_WARNING_MONTHS = 3
21
+ PYTHON_DEPRECATION_WARNING_MONTHS = 6
22
+ # Python end-of-life dates are from https://devguide.python.org/versions/.
23
+ # SDV Enterprise drops a version 6 months after that end-of-life. Python 3.9 is
24
+ # the exception and is deprecated on 2026-12-22.
25
+ # https://docs.sdv.dev/sdv-enterprise/installation/requirements
26
+ PYTHON_VERSION_SUPPORT = {
27
+ '3.9': {'eol': date(2025, 10, 31), 'deprecation': date(2026, 12, 22)},
28
+ '3.10': {'eol': date(2026, 10, 1), 'deprecation': date(2027, 4, 1)},
29
+ '3.11': {'eol': date(2027, 10, 1), 'deprecation': date(2028, 4, 1)},
30
+ '3.12': {'eol': date(2028, 10, 1), 'deprecation': date(2029, 4, 1)},
31
+ '3.13': {'eol': date(2029, 10, 1), 'deprecation': date(2030, 4, 1)},
32
+ '3.14': {'eol': date(2030, 10, 1), 'deprecation': date(2031, 4, 1)},
33
+ '3.15': {'eol': date(2031, 10, 1), 'deprecation': date(2032, 4, 1)},
34
+ '3.16': {'eol': date(2032, 10, 1), 'deprecation': date(2033, 4, 1)},
35
+ }
36
+
37
+
38
+ def get_min_python_version(today=None):
39
+ """Return the oldest Python version that SDV Enterprise still supports.
40
+
41
+ A version is supported until the ``deprecation`` date in ``PYTHON_VERSION_SUPPORT``.
42
+ That date is 6 months after Python's end-of-life, except where the schedule
43
+ sets a different day.
44
+
45
+ Args:
46
+ today (datetime.date):
47
+ Date used to evaluate the schedule. Defaults to the current date.
48
+
49
+ Returns:
50
+ Version: The minimum supported Python version.
51
+
52
+ Raises:
53
+ ValueError: If every scheduled Python version has reached its drop date.
54
+ """
55
+ if today is None:
56
+ today = date.today()
57
+
58
+ supported_versions = [
59
+ Version(version)
60
+ for version, support in PYTHON_VERSION_SUPPORT.items()
61
+ if today < support['deprecation']
62
+ ]
63
+ if not supported_versions:
64
+ raise ValueError(
65
+ 'No supported Python versions remain. Please contact DataCebo to request a new version.'
66
+ )
67
+
68
+ return min(supported_versions)
69
+
70
+
71
+ MIN_PYTHON_VERSION = get_min_python_version()
19
72
  REQUIRED_BITNESS = '64-bit'
20
73
  AUTH_FILE_NAME = 'auth.json'
21
74
 
@@ -1,10 +1,12 @@
1
1
  """System requirements utility functions."""
2
2
 
3
+ import calendar
3
4
  import platform
4
5
  import re
5
6
  import subprocess
6
7
  import sys
7
8
  import sysconfig
9
+ from datetime import date
8
10
 
9
11
  import pip
10
12
  from packaging.tags import sys_tags
@@ -14,11 +16,14 @@ from sdv_installer.constants import (
14
16
  MAX_PYTHON_VERSION,
15
17
  MIN_OS_VERSIONS,
16
18
  MIN_PIP_VERSION,
17
- MIN_PYTHON_VERSION,
19
+ PYTHON_DEPRECATION_WARNING_MONTHS,
20
+ PYTHON_EOL_WARNING_MONTHS,
21
+ PYTHON_VERSION_SUPPORT,
18
22
  REQUIRED_BITNESS,
19
23
  SUPPORTED_ARCHITECTURES,
20
24
  SUPPORTED_LINUX_DISTROS,
21
25
  SUPPORTED_OSES,
26
+ get_min_python_version,
22
27
  )
23
28
  from sdv_installer.utils.console_utils import print_message
24
29
 
@@ -177,7 +182,7 @@ def validate_system_requirements(info):
177
182
 
178
183
  # Validate Python version
179
184
  python_version = get_python_version_code()
180
- if python_version < MIN_PYTHON_VERSION or python_version > MAX_PYTHON_VERSION:
185
+ if python_version < get_min_python_version() or python_version > MAX_PYTHON_VERSION:
181
186
  errors.append('python_version')
182
187
 
183
188
  # Validate system bitness
@@ -215,14 +220,78 @@ def validate_system_requirements(info):
215
220
  return errors
216
221
 
217
222
 
223
+ def _add_months(day, months):
224
+ """Return the date that is `months` away from `day`."""
225
+ month_index = day.month - 1 + months
226
+ year = day.year + month_index // 12
227
+ month = month_index % 12 + 1
228
+ last_day = calendar.monthrange(year, month)[1]
229
+ return date(year, month, min(day.day, last_day))
230
+
231
+
232
+ def _is_within_upcoming_months(today, target, months):
233
+ """Return whether `target` is in the future and strictly less than `months` away."""
234
+ return today < target < _add_months(today, months)
235
+
236
+
237
+ def get_python_deprecation_warning(python_version, today=None):
238
+ """Return a deprecation warning for a Python version, if one applies.
239
+
240
+ A warning applies when Python's end-of-life is less than 3 months away, or
241
+ when that end-of-life has already passed and SDV Enterprise will drop the
242
+ version in less than 6 months.
243
+
244
+ Args:
245
+ python_version (str):
246
+ Full Python version reported by the interpreter, such as '3.9.1'.
247
+ today (datetime.date):
248
+ Date used to evaluate the schedule. Defaults to the current date.
249
+
250
+ Returns:
251
+ str or None:
252
+ The warning sentence, or None when this version is not near deprecation.
253
+ """
254
+ if today is None:
255
+ today = date.today()
256
+
257
+ version = Version(python_version)
258
+ support = PYTHON_VERSION_SUPPORT.get(f'{version.major}.{version.minor}')
259
+ if support is None:
260
+ return None
261
+
262
+ eol = support['eol']
263
+ deprecation = support['deprecation']
264
+ if _is_within_upcoming_months(today, eol, PYTHON_EOL_WARNING_MONTHS):
265
+ return f'Python {python_version} will reach end-of-life in {eol.strftime("%b %Y")}.'
266
+
267
+ eol_has_passed = today >= eol
268
+ deprecation_is_soon = _is_within_upcoming_months(
269
+ today, deprecation, PYTHON_DEPRECATION_WARNING_MONTHS
270
+ )
271
+ if eol_has_passed and deprecation_is_soon:
272
+ drop_date = f'{deprecation.strftime("%b")} {deprecation.day}, {deprecation.year}'
273
+ return (
274
+ f'Python {python_version} has already reached end-of-life and will be '
275
+ f'deprecated in SDV Enterprise on {drop_date}.'
276
+ )
277
+
278
+ return None
279
+
280
+
218
281
  def print_check_results():
219
282
  """Runs the system checks and prints the result in a user-friendly format."""
220
283
  print_message('Verifying system requirements for SDV Enterprise: \n')
221
284
  info = get_system_info()
222
285
  errors = validate_system_requirements(info)
286
+ python_deprecation_warning = get_python_deprecation_warning(info['python_version'])
223
287
 
224
288
  def mark(key):
225
- return ' (!)' if key in errors else ''
289
+ if key in errors:
290
+ return ' (!)'
291
+ if python_deprecation_warning and key == 'python_version':
292
+ return ' (*)'
293
+
294
+ return ''
226
295
 
227
296
  print_message(f'Operating system: {info["os_system"]}{mark("os_system")}')
228
297
  print_message(f'OS Version: {info["os_version"]}{mark("os_version")}')
@@ -234,15 +303,41 @@ def print_check_results():
234
303
  print_message(f'System bit: {info["system_bit"]}{mark("system_bit")}')
235
304
  print_message(f'Pip version: {info["pip_version"]}{mark("pip_version")}')
236
305
 
237
- print_message(f'\nResult: {"Passed" if not errors else "Failed"}')
238
- if not errors:
239
- print_message('Your system meets the technical requirements for SDV Enterprise.')
240
- sys.exit(0)
306
+ if errors:
307
+ result = 'Failed'
308
+ elif python_deprecation_warning:
309
+ result = 'Passed (Warnings)'
241
310
  else:
311
+ result = 'Passed'
312
+
313
+ print_message(f'\nResult: {result}')
314
+ if errors:
242
315
  print_message(
243
316
  'Your system may not meet the technical requirements for SDV Enterprise. '
244
317
  'Please check the items marked by (!) and try updating the SDV '
245
318
  "Installer if something doesn't seem right."
246
319
  )
247
320
  print_message('The most up-to-date requirements are on the SDV Enterprise docs site.')
321
+ if python_deprecation_warning:
322
+ print_message('')
323
+ print_message(python_deprecation_warning)
324
+ print_message(
325
+ 'Please upgrade your Python version for continued access to SDV Enterprise.'
326
+ )
327
+
248
328
  sys.exit(1)
329
+ elif python_deprecation_warning:
330
+ print_message(
331
+ 'Your system meets the technical requirements for SDV Enterprise, '
332
+ 'with warnings that indicate upcoming deprecations.'
333
+ )
334
+ print_message('')
335
+ print_message(python_deprecation_warning)
336
+ print_message('Please upgrade your Python version for continued access to SDV Enterprise.')
337
+ print_message('')
338
+ print_message("If something doesn't seem right, try updating your SDV Installer version.")
339
+ print_message('The most up-to-date requirements are on the SDV Enterprise docs site.')
340
+ sys.exit(0)
341
+ else:
342
+ print_message('Your system meets the technical requirements for SDV Enterprise.')
343
+ sys.exit(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdv-installer
3
- Version: 0.4.1
3
+ Version: 0.4.2.dev0
4
4
  Summary: Package to install SDV Enterprise packages.
5
5
  Author-email: "DataCebo, Inc." <info@datacebo.com>
6
6
  License-Expression: MIT