pyhabitat 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 pyhabitat might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhabitat
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: A lightweight library for detecting system environment, GUI, and build properties.
5
5
  Author-email: George Clayton Bennett <george.bennett@memphistn.gov>
6
6
  License-Expression: MIT
@@ -35,6 +35,10 @@ Ultimately, [City-of-Memphis-Wastewater](https://github.com/City-of-Memphis-Wast
35
35
 
36
36
  ---
37
37
 
38
+ Read the code on [github](https://github.com/City-of-Memphis-Wastewater/pyhabitat/blob/main/pyhabitat/environment.py).
39
+
40
+ ---
41
+
38
42
  ## 🚀 Features
39
43
 
40
44
  * **Definitive Environment Checks:** Rigorous checks catered to Termux and iSH (iOS Alpine). Accurate, typical modern detection for Windows, macOS (Apple), Linux, FreeBSD, Android.
@@ -49,7 +53,7 @@ pip install pyhabitat
49
53
  ```
50
54
  ---
51
55
 
52
- ## 📚 API Reference
56
+ ## 📚 Function Reference
53
57
 
54
58
  ### OS and Environment
55
59
 
@@ -107,7 +111,7 @@ elif is_frozen():
107
111
  elif is_termux():
108
112
  # Expected cases:
109
113
  #- pkg install python-numpy python-cryptography
110
- #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
114
+ #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
111
115
  #- Auto-selection of 'termux-open-url' and 'xdg-open' in logic.
112
116
  #- Installation on the system, like orchestrating the construction of Termux Widget entries in ~/.shortcuts.
113
117
  print("Running in the Termux environment on Android.")
@@ -20,6 +20,10 @@ Ultimately, [City-of-Memphis-Wastewater](https://github.com/City-of-Memphis-Wast
20
20
 
21
21
  ---
22
22
 
23
+ Read the code on [github](https://github.com/City-of-Memphis-Wastewater/pyhabitat/blob/main/pyhabitat/environment.py).
24
+
25
+ ---
26
+
23
27
  ## 🚀 Features
24
28
 
25
29
  * **Definitive Environment Checks:** Rigorous checks catered to Termux and iSH (iOS Alpine). Accurate, typical modern detection for Windows, macOS (Apple), Linux, FreeBSD, Android.
@@ -34,7 +38,7 @@ pip install pyhabitat
34
38
  ```
35
39
  ---
36
40
 
37
- ## 📚 API Reference
41
+ ## 📚 Function Reference
38
42
 
39
43
  ### OS and Environment
40
44
 
@@ -92,7 +96,7 @@ elif is_frozen():
92
96
  elif is_termux():
93
97
  # Expected cases:
94
98
  #- pkg install python-numpy python-cryptography
95
- #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
99
+ #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
96
100
  #- Auto-selection of 'termux-open-url' and 'xdg-open' in logic.
97
101
  #- Installation on the system, like orchestrating the construction of Termux Widget entries in ~/.shortcuts.
98
102
  print("Running in the Termux environment on Android.")
@@ -0,0 +1,48 @@
1
+ # pyhabitat/__init__.py
2
+
3
+ from .environment import (
4
+ matplotlib_is_available_for_gui_plotting,
5
+ matplotlib_is_available_for_headless_image_export,
6
+ tkinter_is_available,
7
+ is_termux,
8
+ is_freebsd,
9
+ is_linux,
10
+ is_android,
11
+ is_windows,
12
+ is_apple,
13
+ is_ish_alpine,
14
+ pyinstaller,
15
+ is_frozen,
16
+ is_elf,
17
+ is_pyz,
18
+ is_windows_portable_executable,
19
+ is_macos_executable,
20
+ is_pipx,
21
+ is_interactive_terminal,
22
+ web_browser_is_available,
23
+ open_text_file_in_default_app,
24
+ )
25
+
26
+ # Optional: Set __all__ for explicit documentation and cleaner imports
27
+ __all__ = [
28
+ 'matplotlib_is_available_for_gui_plotting',
29
+ 'matplotlib_is_available_for_headless_image_export',
30
+ 'tkinter_is_available',
31
+ 'is_termux',
32
+ 'is_freebsd',
33
+ 'is_linux',
34
+ 'is_android',
35
+ 'is_windows',
36
+ 'is_apple',
37
+ 'is_ish_alpine',
38
+ 'pyinstaller',
39
+ 'is_frozen',
40
+ 'is_elf',
41
+ 'is_pyz',
42
+ 'is_windows_portable_executable',
43
+ 'is_macos_executable',
44
+ 'is_pipx',
45
+ 'is_interactive_terminal',
46
+ 'web_browser_is_available',
47
+ 'open_text_file_in_default_app',
48
+ ]
@@ -375,7 +375,7 @@ def is_pipx(debug=False) -> bool:
375
375
  # This is the path to the interpreter running the script (e.g., venv/bin/python)
376
376
  # In a pipx-managed execution, this is the venv python.
377
377
  interpreter_path = Path(sys.executable).resolve()
378
- pipx_bin_path, pipx_venv_base_path = get_pipx_paths()
378
+ pipx_bin_path, pipx_venv_base_path = _get_pipx_paths()
379
379
  # Normalize paths for comparison
380
380
  norm_exec_path = normalize_path(exec_path)
381
381
  norm_interp_path = normalize_path(interpreter_path)
@@ -439,7 +439,7 @@ def web_browser_is_available() -> bool:
439
439
  except webbrowser.Error:
440
440
  # Fallback needed. Check for external launchers.
441
441
  # 2. Termux specific check
442
- if shutil.which("termux-open-url"):
442
+ if is_termux() and shutil.which("termux-open-url"):
443
443
  return True
444
444
  # 3. General Linux check
445
445
  if shutil.which("xdg-open"):
@@ -463,8 +463,11 @@ def open_text_file_in_default_app(filepath):
463
463
  else:
464
464
  print("Unsupported operating system.")
465
465
 
466
- def get_pipx_paths():
467
- """Returns the configured/default pipx binary and home directories."""
466
+ def _get_pipx_paths():
467
+ """
468
+ Returns the configured/default pipx binary and home directories.
469
+ Assumes you indeed have a pipx dir.
470
+ """
468
471
  # 1. PIPX_BIN_DIR (where the symlinks live, e.g., ~/.local/bin)
469
472
  pipx_bin_dir_str = os.environ.get('PIPX_BIN_DIR')
470
473
  if pipx_bin_dir_str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhabitat
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: A lightweight library for detecting system environment, GUI, and build properties.
5
5
  Author-email: George Clayton Bennett <george.bennett@memphistn.gov>
6
6
  License-Expression: MIT
@@ -35,6 +35,10 @@ Ultimately, [City-of-Memphis-Wastewater](https://github.com/City-of-Memphis-Wast
35
35
 
36
36
  ---
37
37
 
38
+ Read the code on [github](https://github.com/City-of-Memphis-Wastewater/pyhabitat/blob/main/pyhabitat/environment.py).
39
+
40
+ ---
41
+
38
42
  ## 🚀 Features
39
43
 
40
44
  * **Definitive Environment Checks:** Rigorous checks catered to Termux and iSH (iOS Alpine). Accurate, typical modern detection for Windows, macOS (Apple), Linux, FreeBSD, Android.
@@ -49,7 +53,7 @@ pip install pyhabitat
49
53
  ```
50
54
  ---
51
55
 
52
- ## 📚 API Reference
56
+ ## 📚 Function Reference
53
57
 
54
58
  ### OS and Environment
55
59
 
@@ -107,7 +111,7 @@ elif is_frozen():
107
111
  elif is_termux():
108
112
  # Expected cases:
109
113
  #- pkg install python-numpy python-cryptography
110
- #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
114
+ #- Avoiding matplotlib unless the user explicitly confirms that termux_has_gui=False in matplotlib_is_available_for_gui_plotting(termux_has_gui=False).
111
115
  #- Auto-selection of 'termux-open-url' and 'xdg-open' in logic.
112
116
  #- Installation on the system, like orchestrating the construction of Termux Widget entries in ~/.shortcuts.
113
117
  print("Running in the Termux environment on Android.")
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "pyhabitat"
9
- version = "1.0.6"
9
+ version = "1.0.8"
10
10
  #dynamic = ["version"] #
11
11
  authors = [
12
12
  { name="George Clayton Bennett", email="george.bennett@memphistn.gov" },
@@ -1,17 +0,0 @@
1
- # pyhabitat/__init__.py
2
-
3
- from .environment import (
4
- is_termux,
5
- is_windows,
6
- is_pipx,
7
- matplotlib_is_available_for_gui_plotting,
8
- # Add all key functions here
9
- )
10
-
11
- # Optional: Set __all__ for explicit imports
12
- __all__ = [
13
- 'is_termux',
14
- 'is_windows',
15
- 'is_pipx',
16
- 'matplotlib_is_available_for_gui_plotting',
17
- ]
File without changes
File without changes