Skip to content

Commit 932ce69

Browse files
authored
Merge release v1.9.2 into main
Merge version 1.9.2 of 'xulbux' into the main branch. For more info on this update, see the change log: https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md#v1-9-2
2 parents 84dad0d + 7a8f6c7 commit 932ce69

33 files changed

Lines changed: 779 additions & 1044 deletions

.github/workflows/python-package.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: ["3.10", "3.11", "3.12", "3.13"]
20+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2121

2222
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v3
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
30-
- name: Cache pip packages
31-
uses: actions/cache@v3
32-
with:
33-
path: ~/.cache/pip
34-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
35-
restore-keys: |
36-
${{ runner.os }}-pip-
37-
38-
- name: Install project and dependencies
39-
run: |
40-
python -m pip install --upgrade pip
41-
pip install -e .[dev]
42-
pip install flake8 flake8-pyproject pytest
43-
44-
- name: Lint with flake8
45-
run: |
46-
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
47-
python -m flake8 . --exit-zero --max-complexity=12 --statistics
48-
49-
- name: Test with pytest
50-
run: |
51-
python -m pytest --verbose
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Cache pip packages
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/.cache/pip
34+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-
37+
38+
- name: Install project and dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -e .[dev]
42+
pip install flake8 flake8-pyproject pytest
43+
44+
- name: Lint with flake8
45+
run: |
46+
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
47+
python -m flake8 . --exit-zero --max-complexity=12 --statistics
48+
49+
- name: Test with pytest
50+
run: |
51+
python -m pytest --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ cython_debug/
2525
__pypackages__/
2626

2727
# TESTING
28+
.venv/
2829
.pytest_cache/
2930

3031
# MISCELLANEOUS

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div style="
44
font-size: 2em;
55
font-weight: bold;
6-
background: #88889845;
6+
background: #86878A45;
77
border-radius: 0.2em;
88
text-align: center;
99
justify-content: center;
@@ -15,6 +15,28 @@
1515
# <br><b>Changelog</b><br>
1616

1717

18+
<span id="v1-9-2" />
19+
20+
## 16.12.2025 `v1.9.2`
21+
* Added a new class `LazyRegex` to the `regex` module, which is used to define regex patterns that are only compiled when they are used for the first time.
22+
* Removed unnecessary character escaping in the precompiled regex patterns in the `console` module.
23+
* Removed all the runtime type-checks that can also be checked using static type-checking tools, since you're supposed to use type checkers in modern python anyway, and to improve performance.
24+
* Renamed the internal class method `FormatCodes.__config_console()` to `FormatCodes._config_console()` to make it callable, but still indicate that it's internal.
25+
* Fixed a small bug where `Console.log_box_…()` would crash, when calling it without providing any `*values` (*content for inside the box*).
26+
27+
**BREAKING CHANGES:**
28+
* The arguments when calling `Console.get_args()` are no longer specified in a single dictionary, but now each argument is passed as a separate keyword argument.<br>
29+
You can still use a dictionary just fine by simply unpacking it with `**`, like this:
30+
```python
31+
Console.get_args(**{"arg": {"-a", "--arg"}})
32+
```
33+
* Replaced the internal `_COMPILED` regex pattern dictionaries with `LazyRegex` objects so it won't compile all regex patterns on library import, but only when they are used for the first time, which improves the library's import time.
34+
* Renamed the internal `_COMPILED` regex pattern dictionaries to `_PATTERNS` for better clarity.
35+
* Removed the import of the `ProgressBar` class from the `__init__.py` file, since it's not an important main class that should be imported directly.
36+
* Renamed the constant `CLR` to `CLI_COLORS` and the constant `HELP` to `CLI_HELP` in the `cli.help` module.
37+
* Changed the default value of the `strip_spaces` param in `Regex.brackets()` from `True` to `False`, since this is more intuitive behavior.
38+
39+
1840
<span id="v1-9-1" />
1941

2042
## 26.11.2025 `v1.9.1`
@@ -810,7 +832,7 @@ from XulbuX import rgb, hsl, hexa
810832
<div style="
811833
font-size: 2em;
812834
font-weight: bold;
813-
background: #88889845;
835+
background: #86878A45;
814836
border-radius: 0.2em;
815837
text-align: center;
816838
justify-content: center;

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!IMPORTANT]
2+
> This library is compatible with Python 3.14, but **certain dependencies might not yet support this version**.
3+
14
# **xulbux**
25

36
[![](https://img.shields.io/pypi/v/xulbux?style=flat&labelColor=404560&color=7075FF)](https://pypi.org/project/xulbux) [![](https://img.shields.io/pepy/dt/xulbux?style=flat&labelColor=404560&color=7075FF)](https://clickpy.clickhouse.com/dashboard/xulbux) [![](https://img.shields.io/github/license/XulbuX/PythonLibraryXulbuX?style=flat&labelColor=405555&color=70FFEE)](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE) [![](https://img.shields.io/github/last-commit/XulbuX/PythonLibraryXulbuX?style=flat&labelColor=554045&color=FF6065)](https://github.com/XulbuX/PythonLibraryXulbuX/commits) [![](https://img.shields.io/github/issues/XulbuX/PythonLibraryXulbuX?style=flat&labelColor=554045&color=FF6065)](https://github.com/XulbuX/PythonLibraryXulbuX/issues) [![](https://img.shields.io/github/stars/XulbuX/PythonLibraryXulbuX?label=★&style=flat&labelColor=604A40&color=FF9673)](https://github.com/XulbuX/PythonLibraryXulbuX/stargazers)
@@ -51,9 +54,9 @@ So you don't have to import the full library under an alias, you can also import
5154
```python
5255
# LIBRARY SUB MODULES
5356
from xulbux.base.consts import COLOR, CHARS, ANSI
54-
# Main Classes
57+
# MODULE MAIN CLASSES
5558
from xulbux import Code, Color, Console, ...
56-
# module specific imports
59+
# MODULE SPECIFIC IMPORTS
5760
from xulbux.color import rgba, hsla, hexa
5861
```
5962

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "xulbux"
7-
version = "1.9.1"
7+
version = "1.9.2"
88
authors = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
99
maintainers = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
10-
description = "A Python library which includes lots of helpful classes, types, and functions aiming to make common programming tasks simpler."
10+
description = "A Python library to simplify common programming tasks."
1111
readme = "README.md"
1212
license = "MIT"
1313
license-files = ["LICEN[CS]E.*"]
@@ -26,6 +26,7 @@ optional-dependencies = { dev = [
2626
] }
2727
classifiers = [
2828
"Development Status :: 5 - Production/Stable",
29+
"Programming Language :: Python :: 3.14",
2930
"Programming Language :: Python :: 3.13",
3031
"Programming Language :: Python :: 3.12",
3132
"Programming Language :: Python :: 3.11",
@@ -109,7 +110,7 @@ xulbux-help = "xulbux.cli.help:show_help"
109110

110111
[tool.black]
111112
line-length = 127
112-
target-version = ['py310', 'py311', 'py312', 'py313']
113+
target-version = ['py310', 'py311', 'py312', 'py313', 'py314']
113114
include = '\.pyi?$'
114115
extend-exclude = '''
115116
/(
@@ -165,4 +166,5 @@ testpaths = [
165166
"tests/test_regex.py",
166167
"tests/test_string.py",
167168
"tests/test_system.py",
169+
"tests/test_version_consistency.py",
168170
]

src/xulbux/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
__version__ = "1.9.1"
1+
__version__ = "1.9.2"
22

33
__author__ = "XulbuX"
44
__email__ = "xulbux.real@gmail.com"
55
__license__ = "MIT"
66
__copyright__ = "Copyright (c) 2024 XulbuX"
77
__url__ = "https://github.com/XulbuX/PythonLibraryXulbuX"
8-
__description__ = "A Python library which includes lots of helpful classes, types, and functions aiming to make common programming tasks simpler."
8+
__description__ = "A Python library to simplify common programming tasks."
99

1010
__all__ = [
1111
"Code",
@@ -17,7 +17,6 @@
1717
"FormatCodes",
1818
"Json",
1919
"Path",
20-
"ProgressBar",
2120
"Regex",
2221
"String",
2322
"System",
@@ -26,7 +25,6 @@
2625
from .code import Code
2726
from .color import Color
2827
from .console import Console
29-
from .console import ProgressBar
3028
from .data import Data
3129
from .env_path import EnvPath
3230
from .file import File

src/xulbux/cli/help.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ def is_latest_version() -> Optional[bool]:
2121
try:
2222
if (latest := get_latest_version()) in {"", None}:
2323
return None
24-
latest_v_parts = tuple(int(part) for part in (latest or "").lower().lstrip("v").split('.'))
25-
installed_v_parts = tuple(int(part) for part in __version__.lower().lstrip("v").split('.'))
24+
latest_v_parts = tuple(int(part) for part in (latest or "").lower().lstrip("v").split("."))
25+
installed_v_parts = tuple(int(part) for part in __version__.lower().lstrip("v").split("."))
2626
return latest_v_parts <= installed_v_parts
2727
except Exception:
2828
return None
2929

3030

3131
URL = "https://pypi.org/pypi/xulbux/json"
3232
IS_LATEST_VERSION = is_latest_version()
33-
CLR = {
33+
34+
CLI_COLORS = {
3435
"border": "dim|br:black",
3536
"class": "br:cyan",
3637
"const": "br:blue",
@@ -43,33 +44,34 @@ def is_latest_version() -> Optional[bool]:
4344
"punctuator": "br:black",
4445
"text": "white",
4546
}
46-
HELP = FormatCodes.to_ansi(
47+
CLI_HELP = FormatCodes.to_ansi(
4748
rf""" [_|b|#7075FF] __ __
4849
[b|#7075FF] _ __ __ __/ / / /_ __ ___ __
4950
[b|#7075FF] | |/ // / / / / / __ \/ / / | |/ /
5051
[b|#7075FF] > , </ /_/ / /_/ /_/ / /_/ /> , <
51-
[b|#7075FF]/_/|_|\____/\__/\____/\____//_/|_| [*|#000|BG:#8085FF] v[b]{__version__} [*|dim|{CLR['notice']}]({'' if IS_LATEST_VERSION else ' (newer available)'})[*]
52+
[b|#7075FF]/_/|_|\____/\__/\____/\____//_/|_| [*|#000|BG:#8085FF] v[b]{__version__} [*|dim|{CLI_COLORS["notice"]}]({"" if IS_LATEST_VERSION else " (newer available)"})[*]
5253
5354
[i|#9095FF]A TON OF COOL FUNCTIONS, YOU NEED![*]
5455
55-
[b|{CLR['heading']}](Usage:)[*]
56-
[{CLR['border']}](╭────────────────────────────────────────────────────╮)[*]
57-
[{CLR['border']}](│) [i|{CLR['punctuator']}](# LIBRARY CONSTANTS)[*] [{CLR['border']}](│)[*]
58-
[{CLR['border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux[{CLR['punctuator']}].[{CLR['lib']}]base[{CLR['punctuator']}].[{CLR['lib']}]consts [{CLR['import']}]import [{CLR['const']}]COLOR[{CLR['punctuator']}], [{CLR['const']}]CHARS[{CLR['punctuator']}], [{CLR['const']}]ANSI[*] [{CLR['border']}](│)[*]
59-
[{CLR['border']}](│) [i|{CLR['punctuator']}](# Main Classes)[*] [{CLR['border']}](│)[*]
60-
[{CLR['border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux [{CLR['import']}]import [{CLR['class']}]Code[{CLR['punctuator']}], [{CLR['class']}]Color[{CLR['punctuator']}], [{CLR['class']}]Console[{CLR['punctuator']}], ...[*] [{CLR['border']}](│)[*]
61-
[{CLR['border']}](│) [i|{CLR['punctuator']}](# module specific imports)[*] [{CLR['border']}](│)[*]
62-
[{CLR['border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux[{CLR['punctuator']}].[{CLR['lib']}]color [{CLR['import']}]import [{CLR['func']}]rgba[{CLR['punctuator']}], [{CLR['func']}]hsla[{CLR['punctuator']}], [{CLR['func']}]hexa[*] [{CLR['border']}](│)
63-
[{CLR['border']}](╰────────────────────────────────────────────────────╯)[*]
64-
[b|{CLR['heading']}](Documentation:)[*]
65-
[{CLR['border']}](╭────────────────────────────────────────────────────╮)[*]
66-
[{CLR['border']}](│) [{CLR['text']}]For more information see the GitHub page. [{CLR['border']}](│)[*]
67-
[{CLR['border']}](│) [{CLR['link']}](https://github.com/XulbuX/PythonLibraryXulbuX/wiki) [{CLR['border']}](│)[*]
68-
[{CLR['border']}](╰────────────────────────────────────────────────────╯)[*]
56+
[b|{CLI_COLORS["heading"]}](Usage:)[*]
57+
[{CLI_COLORS["border"]}](╭────────────────────────────────────────────────────╮)[*]
58+
[{CLI_COLORS["border"]}](│) [i|{CLI_COLORS["punctuator"]}](# LIBRARY CONSTANTS)[*] [{CLI_COLORS["border"]}](│)[*]
59+
[{CLI_COLORS["border"]}](│) [{CLI_COLORS["import"]}]from [{CLI_COLORS["lib"]}]xulbux[{CLI_COLORS["punctuator"]}].[{CLI_COLORS["lib"]}]base[{CLI_COLORS["punctuator"]}].[{CLI_COLORS["lib"]}]consts [{CLI_COLORS["import"]}]import [{CLI_COLORS["const"]}]COLOR[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["const"]}]CHARS[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["const"]}]ANSI[*] [{CLI_COLORS["border"]}](│)[*]
60+
[{CLI_COLORS["border"]}](│) [i|{CLI_COLORS["punctuator"]}](# Main Classes)[*] [{CLI_COLORS["border"]}](│)[*]
61+
[{CLI_COLORS["border"]}](│) [{CLI_COLORS["import"]}]from [{CLI_COLORS["lib"]}]xulbux [{CLI_COLORS["import"]}]import [{CLI_COLORS["class"]}]Code[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["class"]}]Color[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["class"]}]Console[{CLI_COLORS["punctuator"]}], ...[*] [{CLI_COLORS["border"]}](│)[*]
62+
[{CLI_COLORS["border"]}](│) [i|{CLI_COLORS["punctuator"]}](# module specific imports)[*] [{CLI_COLORS["border"]}](│)[*]
63+
[{CLI_COLORS["border"]}](│) [{CLI_COLORS["import"]}]from [{CLI_COLORS["lib"]}]xulbux[{CLI_COLORS["punctuator"]}].[{CLI_COLORS["lib"]}]color [{CLI_COLORS["import"]}]import [{CLI_COLORS["func"]}]rgba[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["func"]}]hsla[{CLI_COLORS["punctuator"]}], [{CLI_COLORS["func"]}]hexa[*] [{CLI_COLORS["border"]}](│)
64+
[{CLI_COLORS["border"]}](╰────────────────────────────────────────────────────╯)[*]
65+
[b|{CLI_COLORS["heading"]}](Documentation:)[*]
66+
[{CLI_COLORS["border"]}](╭────────────────────────────────────────────────────╮)[*]
67+
[{CLI_COLORS["border"]}](│) [{CLI_COLORS["text"]}]For more information see the GitHub page. [{CLI_COLORS["border"]}](│)[*]
68+
[{CLI_COLORS["border"]}](│) [{CLI_COLORS["link"]}](https://github.com/XulbuX/PythonLibraryXulbuX/wiki) [{CLI_COLORS["border"]}](│)[*]
69+
[{CLI_COLORS["border"]}](╰────────────────────────────────────────────────────╯)[*]
6970
[_]"""
7071
)
7172

7273

7374
def show_help() -> None:
74-
print(HELP)
75+
FormatCodes._config_console()
76+
print(CLI_HELP)
7577
Console.pause_exit(pause=True, prompt=" [dim](Press any key to exit...)\n\n")

0 commit comments

Comments
 (0)