python-base-toolkit 0.0.3__tar.gz → 0.0.4__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.
Files changed (46) hide show
  1. python_base_toolkit-0.0.4/CI/Tasks/default.yml +19 -0
  2. python_base_toolkit-0.0.4/CI/Tasks/dependencies.yml +31 -0
  3. python_base_toolkit-0.0.4/CI/Tasks/deploy.yml +28 -0
  4. python_base_toolkit-0.0.4/CI/Tasks/docker.yml +64 -0
  5. python_base_toolkit-0.0.4/CI/Tasks/install.yml +48 -0
  6. python_base_toolkit-0.0.4/CI/Tasks/lint.yml +13 -0
  7. python_base_toolkit-0.0.4/CI/Tasks/main.yml +27 -0
  8. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/MANIFEST.in +2 -1
  9. {python_base_toolkit-0.0.3/python_base_toolkit.egg-info → python_base_toolkit-0.0.4}/PKG-INFO +3 -1
  10. python_base_toolkit-0.0.4/Taskfile.yml +9 -0
  11. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/pyproject.toml +3 -1
  12. python_base_toolkit-0.0.4/python_base_toolkit/scripts/remove_build_files.py +23 -0
  13. python_base_toolkit-0.0.4/python_base_toolkit/utils/__init__.py +0 -0
  14. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4/python_base_toolkit.egg-info}/PKG-INFO +3 -1
  15. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit.egg-info/SOURCES.txt +10 -0
  16. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit.egg-info/requires.txt +2 -0
  17. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/LICENSE +0 -0
  18. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/README.md +0 -0
  19. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/__init__.py +0 -0
  20. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/consts/__init__.py +0 -0
  21. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/consts/operating_system.py +0 -0
  22. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/consts/units/__init__.py +0 -0
  23. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/consts/units/binary_units.py +0 -0
  24. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/consts/units/time_units.py +0 -0
  25. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/decorators/__init__.py +0 -0
  26. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/decorators/telemetry.py +0 -0
  27. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/decorators/timer.py +0 -0
  28. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/instances/__init__.py +0 -0
  29. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/instances/instance_manager.py +0 -0
  30. {python_base_toolkit-0.0.3/python_base_toolkit/utils → python_base_toolkit-0.0.4/python_base_toolkit/scripts}/__init__.py +0 -0
  31. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/data_serialization.py +0 -0
  32. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/date_time.py +0 -0
  33. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/execute.py +0 -0
  34. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/file_utils.py +0 -0
  35. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/generate_id.py +0 -0
  36. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/logo.py +0 -0
  37. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/network.py +0 -0
  38. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/path_utils.py +0 -0
  39. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/pretty_print.py +0 -0
  40. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/pycache.py +0 -0
  41. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/random_utils.py +0 -0
  42. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/shorten_url.py +0 -0
  43. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit/utils/venv_details.py +0 -0
  44. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit.egg-info/dependency_links.txt +0 -0
  45. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/python_base_toolkit.egg-info/top_level.txt +0 -0
  46. {python_base_toolkit-0.0.3 → python_base_toolkit-0.0.4}/setup.cfg +0 -0
@@ -0,0 +1,19 @@
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
+ tasks:
9
+ default:
10
+ cmds:
11
+ - echo "VENV_SITE_PACKAGES is set to - {{.VENV_SITE_PACKAGES}}"
12
+ - echo "Available tasks:"
13
+ - task --list
14
+
15
+ check_env:
16
+ desc: "Print environment variables"
17
+ cmds:
18
+ - echo "Environment Variables:"
19
+ - 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,48 @@
1
+ version: "3"
2
+
3
+
4
+ tasks:
5
+ uv_bin: # for CI ; command -v uv is the basic command to find uv if exists in PATH
6
+ desc: "Find the path to UV"
7
+ silent: true # do not print the command output unless needed
8
+ cmds:
9
+ - |
10
+ if command -v uv > /dev/null 2>&1; then
11
+ command -v uv
12
+ elif [ -x "$HOME/.local/bin/uv" ]; then
13
+ echo "$HOME/.local/bin/uv"
14
+ elif [ -x "/usr/local/bin/uv" ]; then
15
+ echo "/usr/local/bin/uv"
16
+ else
17
+ echo ""
18
+ fi
19
+
20
+ check_uv:
21
+ desc: "Check if UV is installed"
22
+ cmds:
23
+ - |
24
+ UV_PATH=$(task -s uv_bin)
25
+ if [ -n "$UV_PATH" ]; then
26
+ echo "UV is installed at: $UV_PATH"
27
+ else
28
+ echo "UV is not installed."
29
+ fi
30
+
31
+ install_uv:
32
+ desc: "Install UV"
33
+ cmds:
34
+ - echo "Installing UV..."
35
+ - |
36
+ if ! command -v uv > /dev/null 2>&1; then
37
+ curl -sSfL https://astral.sh/uv/install.sh | sh
38
+ else
39
+ echo "UV is already installed at $(command -v uv)"
40
+ fi
41
+ - echo "🎉 UV installed."
42
+
43
+ reinstall_uv:
44
+ desc: "Force reinstall UV"
45
+ cmds:
46
+ - echo "🔁 Reinstalling UV..."
47
+ - curl -sSfL https://astral.sh/uv/install.sh | sh
48
+ - echo "🎉 UV reinstalled!"
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,27 @@
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
+ default: default.yml
10
+ dependencies: dependencies.yml
11
+ deploy: deploy.yml
12
+ docker: docker.yml
13
+ install: install.yml
14
+ lint: lint.yml
15
+
16
+ tasks:
17
+ default:
18
+ cmds:
19
+ - echo "VENV_SITE_PACKAGES is set to - {{.VENV_SITE_PACKAGES}}"
20
+ - echo "Available tasks:"
21
+ - task --list
22
+
23
+ env:
24
+ desc: "Print environment variables"
25
+ cmds:
26
+ - echo "Environment Variables:"
27
+ - env | sort
@@ -1,4 +1,5 @@
1
1
  include requirements.txt
2
2
  include README.md
3
3
  include LICENSE
4
- include scripts
4
+ include CI/Tasks/*
5
+ include Taskfile.yml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-base-toolkit
3
- Version: 0.0.3
3
+ Version: 0.0.4
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
 
@@ -0,0 +1,9 @@
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
+ main: CI/Tasks/main.yml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-base-toolkit"
7
- version = "0.0.3"
7
+ version = "0.0.4"
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,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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-base-toolkit
3
- Version: 0.0.3
3
+ Version: 0.0.4
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
 
@@ -1,7 +1,15 @@
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
5
13
  python_base_toolkit/__init__.py
6
14
  python_base_toolkit.egg-info/PKG-INFO
7
15
  python_base_toolkit.egg-info/SOURCES.txt
@@ -18,6 +26,8 @@ python_base_toolkit/decorators/telemetry.py
18
26
  python_base_toolkit/decorators/timer.py
19
27
  python_base_toolkit/instances/__init__.py
20
28
  python_base_toolkit/instances/instance_manager.py
29
+ python_base_toolkit/scripts/__init__.py
30
+ python_base_toolkit/scripts/remove_build_files.py
21
31
  python_base_toolkit/utils/__init__.py
22
32
  python_base_toolkit/utils/data_serialization.py
23
33
  python_base_toolkit/utils/date_time.py
@@ -1,3 +1,4 @@
1
+ build>=1.3.0
1
2
  colorlog>=6.10.1
2
3
  custom-python-logger>=2.0.10
3
4
  pandas>=2.3.3
@@ -9,4 +10,5 @@ pyyaml>=6.0.3
9
10
  requests>=2.32.5
10
11
  setuptools>=80.9.0
11
12
  tqdm>=4.67.1
13
+ twine>=6.2.0
12
14
  wheel>=0.45.1