python-base-toolkit 0.0.3__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.5/CI/Tasks/default.yml +14 -0
- python_base_toolkit-0.0.5/CI/Tasks/dependencies.yml +31 -0
- python_base_toolkit-0.0.5/CI/Tasks/deploy.yml +28 -0
- python_base_toolkit-0.0.5/CI/Tasks/docker.yml +64 -0
- python_base_toolkit-0.0.5/CI/Tasks/install.yml +59 -0
- python_base_toolkit-0.0.5/CI/Tasks/lint.yml +12 -0
- python_base_toolkit-0.0.5/CI/Tasks/main.yml +28 -0
- python_base_toolkit-0.0.5/CI/Tasks/vars.yml +38 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/MANIFEST.in +2 -1
- {python_base_toolkit-0.0.3/python_base_toolkit.egg-info → python_base_toolkit-0.0.5}/PKG-INFO +6 -1
- {python_base_toolkit-0.0.3 → 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.3 → python_base_toolkit-0.0.5}/pyproject.toml +3 -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/scripts/__init__.py +0 -0
- python_base_toolkit-0.0.5/python_base_toolkit/scripts/remove_build_files.py +23 -0
- python_base_toolkit-0.0.5/python_base_toolkit/utils/__init__.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5/python_base_toolkit.egg-info}/PKG-INFO +6 -1
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/SOURCES.txt +13 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/requires.txt +2 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/LICENSE +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/__init__.py +0 -0
- {python_base_toolkit-0.0.3/python_base_toolkit/consts → python_base_toolkit-0.0.5/python_base_toolkit/base_structures}/__init__.py +0 -0
- {python_base_toolkit-0.0.3/python_base_toolkit/decorators → python_base_toolkit-0.0.5/python_base_toolkit/consts}/__init__.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/operating_system.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/__init__.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/binary_units.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/consts/units/time_units.py +0 -0
- {python_base_toolkit-0.0.3/python_base_toolkit/instances → python_base_toolkit-0.0.5/python_base_toolkit/decorators}/__init__.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/telemetry.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/timer.py +0 -0
- {python_base_toolkit-0.0.3/python_base_toolkit/utils → python_base_toolkit-0.0.5/python_base_toolkit/instances}/__init__.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/instances/instance_manager.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/data_serialization.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/date_time.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/execute.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/file_utils.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/generate_id.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/logo.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/network.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/path_utils.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pretty_print.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pycache.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/random_utils.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/shorten_url.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/venv_details.py +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/dependency_links.txt +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/top_level.txt +0 -0
- {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/setup.cfg +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
tasks:
|
|
4
|
+
default:
|
|
5
|
+
cmds:
|
|
6
|
+
- echo "VENV_SITE_PACKAGES is set to - {{.VENV_SITE_PACKAGES}}"
|
|
7
|
+
- echo "Available tasks:"
|
|
8
|
+
- task --list
|
|
9
|
+
|
|
10
|
+
check_env:
|
|
11
|
+
desc: "Print environment variables"
|
|
12
|
+
cmds:
|
|
13
|
+
- echo "Environment Variables:"
|
|
14
|
+
- env | sort
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
tasks:
|
|
4
|
+
pip_update:
|
|
5
|
+
desc: "Update all Python dependencies"
|
|
6
|
+
cmds:
|
|
7
|
+
- echo "Updating Python dependencies..."
|
|
8
|
+
- pip install --upgrade -r requirements.txt
|
|
9
|
+
- echo "Dependencies updated."
|
|
10
|
+
|
|
11
|
+
update_uv:
|
|
12
|
+
desc: "Install or update UV binary"
|
|
13
|
+
cmds:
|
|
14
|
+
- |
|
|
15
|
+
if command -v uv > /dev/null 2>&1; then
|
|
16
|
+
echo "UV is already installed at $(command -v uv), updating..."
|
|
17
|
+
uv update || echo "Automatic update failed. Please update manually."
|
|
18
|
+
else
|
|
19
|
+
echo "UV not found. Pleasing install UV."
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
poetry_update:
|
|
23
|
+
desc: "Update all Python dependencies using Poetry"
|
|
24
|
+
cmds:
|
|
25
|
+
- |
|
|
26
|
+
if command -v poetry > /dev/null 2>&1; then
|
|
27
|
+
echo "Updating dependencies via Poetry..."
|
|
28
|
+
poetry update
|
|
29
|
+
else
|
|
30
|
+
echo "Poetry is not installed. Please install poetry'"
|
|
31
|
+
fi
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
tasks:
|
|
4
|
+
clean:
|
|
5
|
+
desc: "Clean build artifacts"
|
|
6
|
+
cmds:
|
|
7
|
+
- echo "cleaning..."
|
|
8
|
+
- rm -rf dist/
|
|
9
|
+
- rm -rf build/
|
|
10
|
+
- rm -rf *.egg-info
|
|
11
|
+
- echo "cleaned."
|
|
12
|
+
|
|
13
|
+
build:
|
|
14
|
+
desc: "Build the package"
|
|
15
|
+
cmds:
|
|
16
|
+
- echo "building..."
|
|
17
|
+
- task clean
|
|
18
|
+
- twine build .
|
|
19
|
+
- echo "built."
|
|
20
|
+
|
|
21
|
+
deploy:
|
|
22
|
+
desc: "Deploy the package to PyPI"
|
|
23
|
+
cmds:
|
|
24
|
+
- echo "deploying..."
|
|
25
|
+
- task build
|
|
26
|
+
- twine upload dist/*
|
|
27
|
+
- echo "deployed."
|
|
28
|
+
- task clean
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
tasks:
|
|
4
|
+
docker_build:
|
|
5
|
+
desc: "Build Docker image for the project"
|
|
6
|
+
params:
|
|
7
|
+
IMAGE_NAME:
|
|
8
|
+
default: "myproject:latest"
|
|
9
|
+
cmds:
|
|
10
|
+
- echo "Building Docker image {{.IMAGE_NAME}}..."
|
|
11
|
+
- docker build -t {{.IMAGE_NAME}} .
|
|
12
|
+
- echo "Docker image built - {{.IMAGE_NAME}}"
|
|
13
|
+
|
|
14
|
+
docker_run:
|
|
15
|
+
desc: "Run Docker container"
|
|
16
|
+
params:
|
|
17
|
+
IMAGE_NAME:
|
|
18
|
+
default: "myproject:latest"
|
|
19
|
+
CONTAINER_NAME:
|
|
20
|
+
default: "myproject_container"
|
|
21
|
+
PORT:
|
|
22
|
+
default: "8000"
|
|
23
|
+
cmds:
|
|
24
|
+
- echo "Running Docker container {{.CONTAINER_NAME}}..."
|
|
25
|
+
- docker run -d --name {{.CONTAINER_NAME}} -p {{.PORT}}:{{.PORT}} {{.IMAGE_NAME}}
|
|
26
|
+
- echo "Container {{.CONTAINER_NAME}} is running on port {{.PORT}}"
|
|
27
|
+
|
|
28
|
+
docker_clean_all:
|
|
29
|
+
desc: "Remove old Docker containers and images"
|
|
30
|
+
cmds:
|
|
31
|
+
- echo "Stopping all running containers..."
|
|
32
|
+
- docker ps -q | xargs -r docker stop
|
|
33
|
+
- echo "Removing all containers..."
|
|
34
|
+
- docker ps -aq | xargs -r docker rm
|
|
35
|
+
- echo "Removing all images..."
|
|
36
|
+
- docker images -q | xargs -r docker rmi
|
|
37
|
+
- echo "Docker cleanup completed."
|
|
38
|
+
|
|
39
|
+
docker_clean_project:
|
|
40
|
+
desc: "Clean Docker resources for a specific project"
|
|
41
|
+
params:
|
|
42
|
+
PROJECT_NAME:
|
|
43
|
+
default: "myapp"
|
|
44
|
+
cmds:
|
|
45
|
+
- echo "Stopping and removing containers for project {{.PROJECT_NAME}}..."
|
|
46
|
+
- docker ps -aq --filter "name={{.PROJECT_NAME}}" | xargs -r docker stop
|
|
47
|
+
- docker ps -aq --filter "name={{.PROJECT_NAME}}" | xargs -r docker rm
|
|
48
|
+
- echo "Removing images for project {{.PROJECT_NAME}}..."
|
|
49
|
+
- docker images {{.PROJECT_NAME}}* -q | xargs -r docker rmi
|
|
50
|
+
- echo "Removing volumes for project {{.PROJECT_NAME}}..."
|
|
51
|
+
- docker volume ls -q --filter "name={{.PROJECT_NAME}}" | xargs -r docker volume rm
|
|
52
|
+
- echo "Project cleanup completed."
|
|
53
|
+
|
|
54
|
+
docker_clean_old:
|
|
55
|
+
desc: "Clean old/inactive Docker containers and images"
|
|
56
|
+
params:
|
|
57
|
+
AGE_HOURS:
|
|
58
|
+
default: "720"
|
|
59
|
+
cmds:
|
|
60
|
+
- echo "Cleaning containers inactive for more than {{.AGE_HOURS}} hours..."
|
|
61
|
+
- docker ps -aq --filter "status=exited" --filter "until={{.AGE_HOURS}}h" | xargs -r docker rm
|
|
62
|
+
- echo "Cleaning images older than {{.AGE_HOURS}} hours..."
|
|
63
|
+
- docker images -q --filter "until={{.AGE_HOURS}}h" | xargs -r docker rmi
|
|
64
|
+
- echo "Old resources cleanup completed."
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
tasks:
|
|
4
|
+
uv_bin: # for CI ; command -v uv is the basic command to find uv if exists in PATH
|
|
5
|
+
desc: "Find the path to UV"
|
|
6
|
+
silent: true # do not print the command output unless needed
|
|
7
|
+
cmds:
|
|
8
|
+
- |
|
|
9
|
+
if command -v uv > /dev/null 2>&1; then
|
|
10
|
+
command -v uv
|
|
11
|
+
elif [ -x "$HOME/.local/bin/uv" ]; then
|
|
12
|
+
echo "$HOME/.local/bin/uv"
|
|
13
|
+
elif [ -x "/usr/local/bin/uv" ]; then
|
|
14
|
+
echo "/usr/local/bin/uv"
|
|
15
|
+
else
|
|
16
|
+
echo ""
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
check_uv:
|
|
20
|
+
desc: "Check if UV is installed"
|
|
21
|
+
cmds:
|
|
22
|
+
- |
|
|
23
|
+
UV_PATH=$(task -s main:install:uv_bin)
|
|
24
|
+
if [ -n "$UV_PATH" ]; then
|
|
25
|
+
echo "UV is installed at: $UV_PATH"
|
|
26
|
+
exit 0 # success
|
|
27
|
+
else
|
|
28
|
+
echo "UV is not installed."
|
|
29
|
+
exit 1 # failure
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
install_uv:
|
|
33
|
+
desc: "Install UV"
|
|
34
|
+
cmds:
|
|
35
|
+
- echo "Installing UV..."
|
|
36
|
+
- |
|
|
37
|
+
if [ -n "$(task -s main:install:uv_bin)" ]; then
|
|
38
|
+
curl -sSfL https://astral.sh/uv/install.sh | sh
|
|
39
|
+
else
|
|
40
|
+
echo "UV is already installed at $(command -v uv)"
|
|
41
|
+
fi
|
|
42
|
+
- echo "🎉 UV installed."
|
|
43
|
+
|
|
44
|
+
reinstall_uv:
|
|
45
|
+
desc: "Force reinstall UV"
|
|
46
|
+
cmds:
|
|
47
|
+
- echo "🔁 Reinstalling UV..."
|
|
48
|
+
- curl -sSfL https://astral.sh/uv/install.sh | sh
|
|
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,28 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
|
|
3
|
+
vars:
|
|
4
|
+
VENV_SITE_PACKAGES:
|
|
5
|
+
sh: "python -c 'import os, site; print(os.path.abspath(site.getsitepackages()[0]))'"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
includes:
|
|
9
|
+
vars: vars.yml
|
|
10
|
+
default: default.yml
|
|
11
|
+
dependencies: dependencies.yml
|
|
12
|
+
deploy: deploy.yml
|
|
13
|
+
docker: docker.yml
|
|
14
|
+
install: install.yml
|
|
15
|
+
lint: lint.yml
|
|
16
|
+
|
|
17
|
+
tasks:
|
|
18
|
+
default:
|
|
19
|
+
cmds:
|
|
20
|
+
- echo "VENV_SITE_PACKAGES is set to - {{.VENV_SITE_PACKAGES}}"
|
|
21
|
+
- echo "Available tasks:"
|
|
22
|
+
- task --list
|
|
23
|
+
|
|
24
|
+
env:
|
|
25
|
+
desc: "Print environment variables"
|
|
26
|
+
cmds:
|
|
27
|
+
- echo "Environment Variables:"
|
|
28
|
+
- env | sort
|
|
@@ -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}}
|
{python_base_toolkit-0.0.3/python_base_toolkit.egg-info → python_base_toolkit-0.0.5}/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
|
|
@@ -16,6 +16,7 @@ Classifier: Topic :: System :: Logging
|
|
|
16
16
|
Requires-Python: >=3.11
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
+
Requires-Dist: build>=1.3.0
|
|
19
20
|
Requires-Dist: colorlog>=6.10.1
|
|
20
21
|
Requires-Dist: custom-python-logger>=2.0.10
|
|
21
22
|
Requires-Dist: pandas>=2.3.3
|
|
@@ -27,6 +28,7 @@ Requires-Dist: pyyaml>=6.0.3
|
|
|
27
28
|
Requires-Dist: requests>=2.32.5
|
|
28
29
|
Requires-Dist: setuptools>=80.9.0
|
|
29
30
|
Requires-Dist: tqdm>=4.67.1
|
|
31
|
+
Requires-Dist: twine>=6.2.0
|
|
30
32
|
Requires-Dist: wheel>=0.45.1
|
|
31
33
|
Dynamic: license-file
|
|
32
34
|
|
|
@@ -70,6 +72,9 @@ pip install python-toolkit
|
|
|
70
72
|
- shorten_url
|
|
71
73
|
- venv_details
|
|
72
74
|
|
|
75
|
+
- Tasks Pack
|
|
76
|
+
- ...
|
|
77
|
+
|
|
73
78
|
---
|
|
74
79
|
|
|
75
80
|
## 🤝 Contributing
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-base-toolkit"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.5"
|
|
8
8
|
description = "A Python package for managing pytest plugins."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -21,6 +21,7 @@ classifiers = [
|
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
dependencies = [
|
|
24
|
+
"build>=1.3.0",
|
|
24
25
|
"colorlog>=6.10.1",
|
|
25
26
|
"custom-python-logger>=2.0.10",
|
|
26
27
|
"pandas>=2.3.3",
|
|
@@ -32,6 +33,7 @@ dependencies = [
|
|
|
32
33
|
"requests>=2.32.5",
|
|
33
34
|
"setuptools>=80.9.0",
|
|
34
35
|
"tqdm>=4.67.1",
|
|
36
|
+
"twine>=6.2.0",
|
|
35
37
|
"wheel>=0.45.1",
|
|
36
38
|
]
|
|
37
39
|
|
|
@@ -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
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
|
|
3
|
+
from python_base_toolkit.utils.path_utils import get_project_path_by_file
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def clean_build_artifacts() -> None:
|
|
7
|
+
ignore_dirs = {".git", ".github", ".venv", "__pycache__", ".idea", ".config"}
|
|
8
|
+
build_dirs = ["build", "dist"]
|
|
9
|
+
egg_info_suffix = ".egg-info"
|
|
10
|
+
|
|
11
|
+
root_project_path = get_project_path_by_file()
|
|
12
|
+
for p in root_project_path.iterdir():
|
|
13
|
+
if p.name in ignore_dirs:
|
|
14
|
+
continue
|
|
15
|
+
|
|
16
|
+
if p.is_dir() and p.name.endswith(egg_info_suffix):
|
|
17
|
+
shutil.rmtree(p, ignore_errors=True)
|
|
18
|
+
elif p.is_dir() and p.name in build_dirs:
|
|
19
|
+
shutil.rmtree(p, ignore_errors=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
clean_build_artifacts()
|
|
File without changes
|
{python_base_toolkit-0.0.3 → 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
|
|
@@ -16,6 +16,7 @@ Classifier: Topic :: System :: Logging
|
|
|
16
16
|
Requires-Python: >=3.11
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
+
Requires-Dist: build>=1.3.0
|
|
19
20
|
Requires-Dist: colorlog>=6.10.1
|
|
20
21
|
Requires-Dist: custom-python-logger>=2.0.10
|
|
21
22
|
Requires-Dist: pandas>=2.3.3
|
|
@@ -27,6 +28,7 @@ Requires-Dist: pyyaml>=6.0.3
|
|
|
27
28
|
Requires-Dist: requests>=2.32.5
|
|
28
29
|
Requires-Dist: setuptools>=80.9.0
|
|
29
30
|
Requires-Dist: tqdm>=4.67.1
|
|
31
|
+
Requires-Dist: twine>=6.2.0
|
|
30
32
|
Requires-Dist: wheel>=0.45.1
|
|
31
33
|
Dynamic: license-file
|
|
32
34
|
|
|
@@ -70,6 +72,9 @@ pip install python-toolkit
|
|
|
70
72
|
- shorten_url
|
|
71
73
|
- venv_details
|
|
72
74
|
|
|
75
|
+
- Tasks Pack
|
|
76
|
+
- ...
|
|
77
|
+
|
|
73
78
|
---
|
|
74
79
|
|
|
75
80
|
## 🤝 Contributing
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/SOURCES.txt
RENAMED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
|
+
Taskfile.yml
|
|
4
5
|
pyproject.toml
|
|
6
|
+
CI/Tasks/default.yml
|
|
7
|
+
CI/Tasks/dependencies.yml
|
|
8
|
+
CI/Tasks/deploy.yml
|
|
9
|
+
CI/Tasks/docker.yml
|
|
10
|
+
CI/Tasks/install.yml
|
|
11
|
+
CI/Tasks/lint.yml
|
|
12
|
+
CI/Tasks/main.yml
|
|
13
|
+
CI/Tasks/vars.yml
|
|
5
14
|
python_base_toolkit/__init__.py
|
|
6
15
|
python_base_toolkit.egg-info/PKG-INFO
|
|
7
16
|
python_base_toolkit.egg-info/SOURCES.txt
|
|
8
17
|
python_base_toolkit.egg-info/dependency_links.txt
|
|
9
18
|
python_base_toolkit.egg-info/requires.txt
|
|
10
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
|
|
11
22
|
python_base_toolkit/consts/__init__.py
|
|
12
23
|
python_base_toolkit/consts/operating_system.py
|
|
13
24
|
python_base_toolkit/consts/units/__init__.py
|
|
@@ -18,6 +29,8 @@ python_base_toolkit/decorators/telemetry.py
|
|
|
18
29
|
python_base_toolkit/decorators/timer.py
|
|
19
30
|
python_base_toolkit/instances/__init__.py
|
|
20
31
|
python_base_toolkit/instances/instance_manager.py
|
|
32
|
+
python_base_toolkit/scripts/__init__.py
|
|
33
|
+
python_base_toolkit/scripts/remove_build_files.py
|
|
21
34
|
python_base_toolkit/utils/__init__.py
|
|
22
35
|
python_base_toolkit/utils/data_serialization.py
|
|
23
36
|
python_base_toolkit/utils/date_time.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-0.0.3 → 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.3 → python_base_toolkit-0.0.5}/python_base_toolkit/decorators/telemetry.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → 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
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/date_time.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/execute.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/file_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → 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.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/network.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/path_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pretty_print.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/pycache.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/random_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → python_base_toolkit-0.0.5}/python_base_toolkit/utils/shorten_url.py
RENAMED
|
File without changes
|
{python_base_toolkit-0.0.3 → 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.3 → python_base_toolkit-0.0.5}/python_base_toolkit.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|