python-base-toolkit 0.0.4__tar.gz → 0.0.5__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.
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/default.yml +0 -5
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/install.yml +16 -5
- python_base_toolkit-0.0.5/CI/Tasks/lint.yml +12 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/main.yml +1 -0
- python_base_toolkit-0.0.5/CI/Tasks/vars.yml +38 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/PKG-INFO +4 -1
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/README.md +3 -0
- python_base_toolkit-0.0.5/Taskfile.yml +4 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/pyproject.toml +1 -1
- python_base_toolkit-0.0.5/python_base_toolkit/base_structures/base_enum.py +54 -0
- python_base_toolkit-0.0.5/python_base_toolkit/utils/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/PKG-INFO +4 -1
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/SOURCES.txt +3 -0
- python_base_toolkit-0.0.4/CI/Tasks/lint.yml +0 -13
- python_base_toolkit-0.0.4/Taskfile.yml +0 -9
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/dependencies.yml +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/deploy.yml +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/CI/Tasks/docker.yml +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/LICENSE +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/MANIFEST.in +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/__init__.py +0 -0
- {python_base_toolkit-0.0.4/python_base_toolkit/consts → python_base_toolkit-0.0.5/python_base_toolkit/base_structures}/__init__.py +0 -0
- {python_base_toolkit-0.0.4/python_base_toolkit/decorators → python_base_toolkit-0.0.5/python_base_toolkit/consts}/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/operating_system.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/binary_units.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/time_units.py +0 -0
- {python_base_toolkit-0.0.4/python_base_toolkit/instances → python_base_toolkit-0.0.5/python_base_toolkit/decorators}/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/telemetry.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/timer.py +0 -0
- {python_base_toolkit-0.0.4/python_base_toolkit/scripts → python_base_toolkit-0.0.5/python_base_toolkit/instances}/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/instances/instance_manager.py +0 -0
- {python_base_toolkit-0.0.4/python_base_toolkit/utils → python_base_toolkit-0.0.5/python_base_toolkit/scripts}/__init__.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/scripts/remove_build_files.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/data_serialization.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/date_time.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/execute.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/file_utils.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/generate_id.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/logo.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/network.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/path_utils.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pretty_print.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pycache.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/random_utils.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/shorten_url.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/venv_details.py +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/dependency_links.txt +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/requires.txt +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/top_level.txt +0 -0
- {python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/setup.cfg +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
version: "3"
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
tasks:
|
|
5
4
|
uv_bin: # for CI ; command -v uv is the basic command to find uv if exists in PATH
|
|
6
5
|
desc: "Find the path to UV"
|
|
@@ -21,11 +20,13 @@ tasks:
|
|
|
21
20
|
desc: "Check if UV is installed"
|
|
22
21
|
cmds:
|
|
23
22
|
- |
|
|
24
|
-
UV_PATH=$(task -s uv_bin)
|
|
23
|
+
UV_PATH=$(task -s main:install:uv_bin)
|
|
25
24
|
if [ -n "$UV_PATH" ]; then
|
|
26
|
-
|
|
25
|
+
echo "UV is installed at: $UV_PATH"
|
|
26
|
+
exit 0 # success
|
|
27
27
|
else
|
|
28
|
-
|
|
28
|
+
echo "UV is not installed."
|
|
29
|
+
exit 1 # failure
|
|
29
30
|
fi
|
|
30
31
|
|
|
31
32
|
install_uv:
|
|
@@ -33,7 +34,7 @@ tasks:
|
|
|
33
34
|
cmds:
|
|
34
35
|
- echo "Installing UV..."
|
|
35
36
|
- |
|
|
36
|
-
if
|
|
37
|
+
if [ -n "$(task -s main:install:uv_bin)" ]; then
|
|
37
38
|
curl -sSfL https://astral.sh/uv/install.sh | sh
|
|
38
39
|
else
|
|
39
40
|
echo "UV is already installed at $(command -v uv)"
|
|
@@ -46,3 +47,13 @@ tasks:
|
|
|
46
47
|
- echo "🔁 Reinstalling UV..."
|
|
47
48
|
- curl -sSfL https://astral.sh/uv/install.sh | sh
|
|
48
49
|
- echo "🎉 UV reinstalled!"
|
|
50
|
+
|
|
51
|
+
install_dependencies:
|
|
52
|
+
desc: Install all dependencies.
|
|
53
|
+
deps:
|
|
54
|
+
- install-uv
|
|
55
|
+
cmds:
|
|
56
|
+
- task: clean
|
|
57
|
+
- pwd
|
|
58
|
+
- rm uv.lock || true
|
|
59
|
+
- "{{.UV_BIN}} sync"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
vars:
|
|
4
|
+
OS:
|
|
5
|
+
sh: echo {{OS}}
|
|
6
|
+
|
|
7
|
+
UV_BIN: # Dynamically detect uv binary location
|
|
8
|
+
sh: |
|
|
9
|
+
if command -v uv >/dev/null 2>&1; then
|
|
10
|
+
command -v uv
|
|
11
|
+
elif [ -x "/root/.local/bin/uv" ]; then
|
|
12
|
+
echo "/root/.local/bin/uv"
|
|
13
|
+
elif [ -x "$HOME/.local/bin/uv" ]; then
|
|
14
|
+
echo "$HOME/.local/bin/uv"
|
|
15
|
+
else
|
|
16
|
+
echo "/root/.local/bin/uv"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
VENV_PYTHON_PATH:
|
|
20
|
+
sh: |
|
|
21
|
+
find "$VIRTUAL_ENV/lib" -maxdepth 1 -type d -name "python*" | head -n1
|
|
22
|
+
DOT_VENV_PYTHON_PATH:
|
|
23
|
+
sh: |
|
|
24
|
+
find "$VIRTUAL_ENV/lib" -maxdepth 1 -type d -name "python*" | head -n1 | sed 's|^.*/\.venv/|.venv/|'
|
|
25
|
+
VENV_SITE_PACKAGES:
|
|
26
|
+
sh: "python -c 'import os, site; print(os.path.abspath(site.getsitepackages()[0]))'"
|
|
27
|
+
|
|
28
|
+
GIT_BRANCH:
|
|
29
|
+
sh: git branch --show-current
|
|
30
|
+
GIT_COMMIT_HASH:
|
|
31
|
+
sh: git rev-parse --short HEAD
|
|
32
|
+
|
|
33
|
+
tasks:
|
|
34
|
+
print-vars:
|
|
35
|
+
desc: "Print all task variables - command: task print-vars --verbose"
|
|
36
|
+
cmds:
|
|
37
|
+
- |
|
|
38
|
+
echo {{.OS}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-base-toolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: A Python package for managing pytest plugins.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -72,6 +72,9 @@ pip install python-toolkit
|
|
|
72
72
|
- shorten_url
|
|
73
73
|
- venv_details
|
|
74
74
|
|
|
75
|
+
- Tasks Pack
|
|
76
|
+
- ...
|
|
77
|
+
|
|
75
78
|
---
|
|
76
79
|
|
|
77
80
|
## 🤝 Contributing
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from enum import Enum, StrEnum
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
E = TypeVar("E", bound=Enum)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EnumMixin:
|
|
9
|
+
def __str__(self: E) -> str:
|
|
10
|
+
return str(self.value)
|
|
11
|
+
|
|
12
|
+
def __repr__(self: E) -> str:
|
|
13
|
+
return str(self.value)
|
|
14
|
+
# return f"<{self.__class__.__name__}.{self.name}: {self.value}>"
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def to_list(cls: type[E]) -> list[Any]:
|
|
18
|
+
return [c.value for c in cls]
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def to_dict(cls: type[E]) -> dict:
|
|
22
|
+
return {member.name: member.value for member in cls}
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def names(cls: type[E]) -> list[str]:
|
|
26
|
+
return [c.name for c in cls]
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def values(cls: type[E]) -> list[Any]:
|
|
30
|
+
return [c.value for c in cls]
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_value(cls: type[E], value: Any) -> list[E]:
|
|
34
|
+
return [member for member in cls if value in member.value]
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def has_name(cls: type[E], name: str) -> bool:
|
|
38
|
+
return any(member.name == name for member in cls)
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def has_value(cls: type[E], value: Any) -> bool:
|
|
42
|
+
return any(member.value == value for member in cls)
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def to_json(cls) -> str:
|
|
46
|
+
return json.dumps(cls.to_dict())
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class BaseEnum(EnumMixin, Enum):
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class BaseStrEnum(EnumMixin, StrEnum):
|
|
54
|
+
pass
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-base-toolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: A Python package for managing pytest plugins.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -72,6 +72,9 @@ pip install python-toolkit
|
|
|
72
72
|
- shorten_url
|
|
73
73
|
- venv_details
|
|
74
74
|
|
|
75
|
+
- Tasks Pack
|
|
76
|
+
- ...
|
|
77
|
+
|
|
75
78
|
---
|
|
76
79
|
|
|
77
80
|
## 🤝 Contributing
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/SOURCES.txt
RENAMED
|
@@ -10,12 +10,15 @@ CI/Tasks/docker.yml
|
|
|
10
10
|
CI/Tasks/install.yml
|
|
11
11
|
CI/Tasks/lint.yml
|
|
12
12
|
CI/Tasks/main.yml
|
|
13
|
+
CI/Tasks/vars.yml
|
|
13
14
|
python_base_toolkit/__init__.py
|
|
14
15
|
python_base_toolkit.egg-info/PKG-INFO
|
|
15
16
|
python_base_toolkit.egg-info/SOURCES.txt
|
|
16
17
|
python_base_toolkit.egg-info/dependency_links.txt
|
|
17
18
|
python_base_toolkit.egg-info/requires.txt
|
|
18
19
|
python_base_toolkit.egg-info/top_level.txt
|
|
20
|
+
python_base_toolkit/base_structures/__init__.py
|
|
21
|
+
python_base_toolkit/base_structures/base_enum.py
|
|
19
22
|
python_base_toolkit/consts/__init__.py
|
|
20
23
|
python_base_toolkit/consts/operating_system.py
|
|
21
24
|
python_base_toolkit/consts/units/__init__.py
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
version: "3"
|
|
2
|
-
|
|
3
|
-
tasks:
|
|
4
|
-
lint:
|
|
5
|
-
desc: "Run pre-commit hooks (linting & formatting)"
|
|
6
|
-
cmds:
|
|
7
|
-
- |
|
|
8
|
-
if command -v pre-commit > /dev/null 2>&1; then
|
|
9
|
-
echo "Running pre-commit hooks..."
|
|
10
|
-
pre-commit run --all-files
|
|
11
|
-
else
|
|
12
|
-
echo "pre-commit is not installed. Please run 'pip install pre-commit'"
|
|
13
|
-
fi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/telemetry.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/timer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/date_time.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/execute.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/file_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/generate_id.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/network.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/path_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pretty_print.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pycache.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/random_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/shorten_url.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/venv_details.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.4 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|