pyhabitat 1.0.5__tar.gz → 1.0.7__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.
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/PKG-INFO +8 -4
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/README.md +6 -2
- pyhabitat-1.0.7/pyhabitat/__init__.py +48 -0
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyhabitat/environment.py +7 -4
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyhabitat.egg-info/PKG-INFO +8 -4
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyproject.toml +2 -2
- pyhabitat-1.0.5/pyhabitat/__init__.py +0 -17
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/LICENSE +0 -0
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyhabitat.egg-info/SOURCES.txt +0 -0
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyhabitat.egg-info/dependency_links.txt +0 -0
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/pyhabitat.egg-info/top_level.txt +0 -0
- {pyhabitat-1.0.5 → pyhabitat-1.0.7}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhabitat
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 1.0.7
|
|
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
|
|
7
7
|
Keywords: environment,os-detection,gui,build-system
|
|
@@ -15,9 +15,9 @@ Dynamic: license-file
|
|
|
15
15
|
|
|
16
16
|
# pyhabitat 🧭
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## An Introspection Library for Python Environments and Builds
|
|
19
19
|
|
|
20
|
-
**`pyhabitat`** is a **
|
|
20
|
+
**`pyhabitat`** is a **lightweight library for Python build and environment introspection**. It accurately and securely determines the execution context of a running script by providing definitive checks for:
|
|
21
21
|
|
|
22
22
|
* **OS and Environments:** Operating Systems and common container/emulation environments (e.g., Termux, iSH).
|
|
23
23
|
* **Build States:** Application build systems (e.g., PyInstaller, pipx).
|
|
@@ -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.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# pyhabitat 🧭
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## An Introspection Library for Python Environments and Builds
|
|
4
4
|
|
|
5
|
-
**`pyhabitat`** is a **
|
|
5
|
+
**`pyhabitat`** is a **lightweight library for Python build and environment introspection**. It accurately and securely determines the execution context of a running script by providing definitive checks for:
|
|
6
6
|
|
|
7
7
|
* **OS and Environments:** Operating Systems and common container/emulation environments (e.g., Termux, iSH).
|
|
8
8
|
* **Build States:** Application build systems (e.g., PyInstaller, pipx).
|
|
@@ -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.
|
|
@@ -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 =
|
|
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
|
|
467
|
-
"""
|
|
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,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhabitat
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 1.0.7
|
|
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
|
|
7
7
|
Keywords: environment,os-detection,gui,build-system
|
|
@@ -15,9 +15,9 @@ Dynamic: license-file
|
|
|
15
15
|
|
|
16
16
|
# pyhabitat 🧭
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## An Introspection Library for Python Environments and Builds
|
|
19
19
|
|
|
20
|
-
**`pyhabitat`** is a **
|
|
20
|
+
**`pyhabitat`** is a **lightweight library for Python build and environment introspection**. It accurately and securely determines the execution context of a running script by providing definitive checks for:
|
|
21
21
|
|
|
22
22
|
* **OS and Environments:** Operating Systems and common container/emulation environments (e.g., Termux, iSH).
|
|
23
23
|
* **Build States:** Application build systems (e.g., PyInstaller, pipx).
|
|
@@ -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.
|
|
@@ -6,12 +6,12 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "pyhabitat"
|
|
9
|
-
version = "1.0.
|
|
9
|
+
version = "1.0.7"
|
|
10
10
|
#dynamic = ["version"] #
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="George Clayton Bennett", email="george.bennett@memphistn.gov" },
|
|
13
13
|
]
|
|
14
|
-
description = "A
|
|
14
|
+
description = "A lightweight library for detecting system environment, GUI, and build properties."
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.8"
|
|
17
17
|
license = "MIT"
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|