paramsx 1.0.6__tar.gz → 1.0.8__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.

Potentially problematic release.


This version of paramsx might be problematic. Click here for more details.

@@ -1,10 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: paramsx
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Librería para gestionar y respaldar parámetros de AWS SSM de manera sencilla y eficiente.
5
5
  Home-page: https://github.com/pistatxos/paramsx
6
6
  Author: Mariox
7
7
  Author-email: info@tomonota.net
8
8
  License-File: LICENSE
9
9
  Requires-Dist: boto3
10
- Requires-Dist: windows-curses; platform_system == "Windows"
@@ -0,0 +1,19 @@
1
+ import os
2
+ import shutil
3
+
4
+ def run_post_install():
5
+ config_dir = os.path.expanduser("~/.xsoft")
6
+ os.makedirs(config_dir, exist_ok=True)
7
+
8
+ config_file = os.path.join(os.path.dirname(__file__), "paramsx", "paramsx_config.py")
9
+ target_file = os.path.join(config_dir, "paramsx_config.py")
10
+
11
+ if not os.path.exists(target_file):
12
+ if os.path.exists(config_file):
13
+ shutil.copy(config_file, target_file)
14
+ print(f"Archivo de configuración copiado a {target_file}")
15
+ else:
16
+ print(f"Advertencia: No se encontró {config_file}. No se creó la configuración inicial.")
17
+
18
+ if __name__ == "__main__":
19
+ run_post_install()
@@ -1,10 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: paramsx
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Librería para gestionar y respaldar parámetros de AWS SSM de manera sencilla y eficiente.
5
5
  Home-page: https://github.com/pistatxos/paramsx
6
6
  Author: Mariox
7
7
  Author-email: info@tomonota.net
8
8
  License-File: LICENSE
9
9
  Requires-Dist: boto3
10
- Requires-Dist: windows-curses; platform_system == "Windows"
@@ -6,6 +6,7 @@ paramsx/__init__.py
6
6
  paramsx/funcions.py
7
7
  paramsx/main.py
8
8
  paramsx/paramsx_config.py
9
+ paramsx/post_install.py
9
10
  paramsx/text.py
10
11
  paramsx.egg-info/PKG-INFO
11
12
  paramsx.egg-info/SOURCES.txt
@@ -0,0 +1 @@
1
+ boto3
@@ -4,18 +4,25 @@ import os
4
4
  import sys
5
5
  import shutil
6
6
  import platform
7
+ import subprocess
7
8
 
8
9
  class CustomInstallCommand(install):
9
10
  def run(self):
10
11
  # Ejecutar instalación predeterminada
11
12
  install.run(self)
12
13
 
13
- # Detectar el sistema operativo
14
+ # 1. Agregar directorio de scripts al PATH
15
+ self._add_scripts_to_path()
16
+
17
+ # 2. Ejecutar script de post-instalación
18
+ self.run_post_install_script()
19
+
20
+ def _add_scripts_to_path(self):
14
21
  system = platform.system()
15
22
  scripts_dir = None
16
23
 
17
24
  if system == "Windows":
18
- # Ruta del directorio de scripts para Windows
25
+ # Ruta del directorio de scripts en Windows
19
26
  scripts_dir = os.path.join(
20
27
  os.path.expanduser("~"),
21
28
  "AppData",
@@ -25,43 +32,18 @@ class CustomInstallCommand(install):
25
32
  "Scripts",
26
33
  )
27
34
  elif system in ["Linux", "Darwin"]: # Linux o macOS
28
- # Ruta del directorio de scripts para Linux/macOS
29
35
  scripts_dir = os.path.join(os.path.dirname(sys.executable), "bin")
30
36
 
31
37
  if scripts_dir:
32
- # Verificar si el directorio ya está en el PATH
33
38
  path_env = os.environ.get("PATH", "")
34
39
  if scripts_dir not in path_env:
35
40
  if system == "Windows":
36
- # Agregar al PATH en Windows
37
41
  os.system(f'setx PATH "{path_env};{scripts_dir}"')
38
42
  print(f"Se agregó {scripts_dir} al PATH. Reinicia tu terminal para que los cambios surtan efecto.")
39
43
  elif system == "Darwin":
40
- # Usar .zshrc en macOS
41
- zshrc_path = os.path.expanduser("~/.zshrc")
42
- self._add_to_shell_config(zshrc_path, scripts_dir)
44
+ self._add_to_shell_config("~/.zshrc", scripts_dir)
43
45
  elif system == "Linux":
44
- # Usar .bashrc en Linux
45
- bashrc_path = os.path.expanduser("~/.bashrc")
46
- self._add_to_shell_config(bashrc_path, scripts_dir)
47
-
48
- # Crear el directorio de configuración de paramsx
49
- config_dir = os.path.expanduser("~/.xsoft")
50
- os.makedirs(config_dir, exist_ok=True)
51
-
52
- # Archivo de configuración
53
- config_file = "paramsx/paramsx_config.py"
54
- target_file = os.path.join(config_dir, "paramsx_config.py")
55
-
56
- if os.path.exists(target_file):
57
- print(f"El archivo de configuración ya existe en {target_file}. No se sobrescribirá.")
58
- else:
59
- if os.path.exists(config_file):
60
- shutil.copy(config_file, target_file)
61
- print(f"Archivo de configuración copiado a {target_file}")
62
- else:
63
- print(f"Advertencia: No se encontró {config_file}. No se creó la configuración inicial.")
64
-
46
+ self._add_to_shell_config("~/.bashrc", scripts_dir)
65
47
 
66
48
  def _add_to_shell_config(self, config_file, scripts_dir):
67
49
  """Añadir el directorio de scripts al archivo de configuración de shell."""
@@ -75,6 +57,13 @@ class CustomInstallCommand(install):
75
57
  f.write(f"{export_line}\n")
76
58
  print(f"Se creó {config_file} y se agregó {scripts_dir}.")
77
59
 
60
+ def run_post_install_script(self):
61
+ post_install_script = os.path.join(os.path.dirname(__file__), "post_install.py")
62
+ if os.path.exists(post_install_script):
63
+ subprocess.run([sys.executable, post_install_script], check=True)
64
+ else:
65
+ print("Advertencia: El script de post-instalación no se encontró.")
66
+
78
67
  install_requires = ["boto3"]
79
68
 
80
69
  # Añadir windows-curses si el sistema es Windows
@@ -83,16 +72,13 @@ if platform.system() == "Windows":
83
72
 
84
73
  setup(
85
74
  name="paramsx",
86
- version="1.0.6",
75
+ version="1.0.8",
87
76
  packages=find_packages(),
88
77
  include_package_data=True,
89
78
  package_data={
90
79
  'paramsx': ['paramsx_config.py'], # Archivos específicos
91
80
  },
92
- install_requires=[
93
- "boto3",
94
- "windows-curses; platform_system == 'Windows'"
95
- ],
81
+ install_requires=install_requires,
96
82
  entry_points={
97
83
  "console_scripts": [
98
84
  "paramsx=paramsx.main:entry_point",
@@ -1,4 +0,0 @@
1
- boto3
2
-
3
- [:platform_system == "Windows"]
4
- windows-curses
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes