Compare commits
6 Commits
be1ed37f65
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 35dd01f7fe | |||
| 85a52f2ae4 | |||
| bd18a69862 | |||
| 122f1ef235 | |||
| ca5d0a1b6e | |||
| 2286b76664 |
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.0.4
|
||||||
|
- Modified if modules are not install, pass
|
||||||
|
- Moved `my_image/my_crawling.py`
|
||||||
|
- Added `__init__.py`
|
||||||
|
- Added `pyproject.toml` and `CHANGELOG/README.md`
|
||||||
|
- Modified `.gitignore`
|
||||||
|
|
||||||
## v1.0.3
|
## v1.0.3
|
||||||
- Added `my_crawling.py`
|
- Added `my_crawling.py`
|
||||||
- Deleted `__pycache__`
|
- Deleted `__pycache__`
|
||||||
|
|||||||
+32
-11
@@ -1,30 +1,51 @@
|
|||||||
__version__ = "1.0.3"
|
__version__ = "1.0.4"
|
||||||
|
|
||||||
# --- custom ---
|
# --- required modules ---
|
||||||
from custom_lib import my_file_config
|
from custom_lib import my_file_config
|
||||||
from custom_lib import my_logger
|
from custom_lib import my_logger
|
||||||
from custom_lib import my_uuid
|
from custom_lib import my_uuid
|
||||||
# 20260507 tak add my_image
|
|
||||||
from custom_lib import my_image
|
|
||||||
# 20260508 tak add my_crawling
|
|
||||||
from custom_lib import my_crawling
|
|
||||||
|
|
||||||
MODULES = [
|
MODULES = [
|
||||||
my_file_config,
|
my_file_config,
|
||||||
my_logger,
|
my_logger,
|
||||||
my_uuid,
|
my_uuid,
|
||||||
my_image,
|
|
||||||
my_crawling
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def print_versions():
|
# --- optional modules ---
|
||||||
for module in MODULES:
|
OPTIONAL_MODULES = []
|
||||||
|
MISSING_MODULES = []
|
||||||
|
|
||||||
|
def _try_import_optional(module_path):
|
||||||
|
try:
|
||||||
|
module = __import__(f"custom_lib.{module_path}", fromlist=["*"])
|
||||||
|
OPTIONAL_MODULES.append(module)
|
||||||
|
return True
|
||||||
|
except ImportError:
|
||||||
|
MISSING_MODULES.append(module_path.split(".")[1])
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
# 20260507 tak add my_image
|
||||||
|
_try_import_optional("image.my_image")
|
||||||
|
|
||||||
|
# 20260508 tak add my_crawling
|
||||||
|
_try_import_optional("crawling.my_crawling")
|
||||||
|
|
||||||
|
def print_modules():
|
||||||
|
for module in MODULES + OPTIONAL_MODULES:
|
||||||
version = getattr(module, "__version__", "unknown")
|
version = getattr(module, "__version__", "unknown")
|
||||||
print(f"# [MODULE] {module.__name__} v{version}")
|
print(f"# [MODULE] {module.__name__} v{version}")
|
||||||
|
|
||||||
|
def print_missing_modules():
|
||||||
|
for module in MISSING_MODULES:
|
||||||
|
print(f"# [MISSING] {module}")
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
print("\n" + "#" * 60)
|
print("\n" + "#" * 60)
|
||||||
print(f"# Custom_Lib v{__version__}")
|
print(f"# Custom_Lib v{__version__}")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
print_versions()
|
|
||||||
|
print_modules()
|
||||||
|
print_missing_modules()
|
||||||
|
|
||||||
print("#" * 60)
|
print("#" * 60)
|
||||||
@@ -109,4 +109,4 @@ custom_lib/
|
|||||||
|
|
||||||
## Version
|
## Version
|
||||||
|
|
||||||
### v1.0.3
|
### v1.0.4
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "custom_lib"
|
name = "custom_lib"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
description = "My Custom Python Library"
|
description = "My Custom Python Library"
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user