Skip to content

Commit

Permalink
Dev (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
redjax authored Jan 26, 2024
2 parents 6b9dc1e + 5667558 commit 435149c
Show file tree
Hide file tree
Showing 59 changed files with 243 additions and 177 deletions.
20 changes: 10 additions & 10 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# Please do not edit it manually.

annotated-types==0.6.0
argcomplete==3.2.1
argcomplete==3.2.2
babel==2.14.0
black==23.12.1
black==24.1.0
blinker==1.7.0
cachecontrol==0.13.1
certifi==2023.11.17
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
colorlog==6.8.0
colorlog==6.8.2
dep-logic==0.0.4
distlib==0.3.8
execnet==2.0.2
filelock==3.13.1
findpython==0.4.1
ghp-import==2.1.0
griffe==0.38.1
griffe==0.39.1
identify==2.5.33
idna==3.6
iniconfig==2.0.0
Expand All @@ -28,14 +28,14 @@ jinja2==3.1.3
markdown==3.5.2
markdown-include==0.8.1
markdown-it-py==3.0.0
markupsafe==2.1.3
markupsafe==2.1.4
mdurl==0.1.2
mergedeep==1.3.4
mkdocs==1.5.3
mkdocs-autorefs==0.5.0
mkdocs-gen-files==0.5.0
mkdocs-literate-nav==0.6.1
mkdocs-material==9.5.4
mkdocs-material==9.5.5
mkdocs-material-extensions==1.3.1
mkdocs-section-index==0.3.8
mkdocstrings==0.24.0
Expand All @@ -47,10 +47,10 @@ nox==2023.4.22
packaging==23.2
paginate==0.5.6
pathspec==0.12.1
pdm==2.11.2
pdm==2.12.2
pdm-bump==0.7.3
platformdirs==4.1.0
pluggy==1.3.0
pluggy==1.4.0
pre-commit==3.6.0
pygments==2.17.2
pymdown-extensions==10.7
Expand All @@ -59,15 +59,15 @@ pyproject-metadata==0.7.1
pytest==7.4.4
pytest-xdist==3.5.0
python-dateutil==2.8.2
python-dotenv==1.0.0
python-dotenv==1.0.1
pyyaml==6.0.1
pyyaml-env-tag==0.1
regex==2023.12.25
requests==2.31.0
requests-toolbelt==1.0.0
resolvelib==1.0.1
rich==13.7.0
ruff==0.1.13
ruff==0.1.14
setuptools==69.0.3
shellingham==1.5.4
six==1.16.0
Expand Down
287 changes: 145 additions & 142 deletions pdm.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "red_utils"
version = "0.2.16"
version = "0.2.17"
description = "Collection of utility scripts/functions that I use frequently."
authors = [
{ name = "redjax", email = "[email protected]" },
Expand Down
20 changes: 10 additions & 10 deletions requirements/requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# Please do not edit it manually.

annotated-types==0.6.0
argcomplete==3.2.1
argcomplete==3.2.2
babel==2.14.0
black==23.12.1
black==24.1.0
blinker==1.7.0
cachecontrol==0.13.1
certifi==2023.11.17
cfgv==3.4.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
colorlog==6.8.0
colorlog==6.8.2
dep-logic==0.0.4
distlib==0.3.8
execnet==2.0.2
filelock==3.13.1
findpython==0.4.1
ghp-import==2.1.0
griffe==0.38.1
griffe==0.39.1
identify==2.5.33
idna==3.6
iniconfig==2.0.0
Expand All @@ -28,14 +28,14 @@ jinja2==3.1.3
markdown==3.5.2
markdown-include==0.8.1
markdown-it-py==3.0.0
markupsafe==2.1.3
markupsafe==2.1.4
mdurl==0.1.2
mergedeep==1.3.4
mkdocs==1.5.3
mkdocs-autorefs==0.5.0
mkdocs-gen-files==0.5.0
mkdocs-literate-nav==0.6.1
mkdocs-material==9.5.4
mkdocs-material==9.5.5
mkdocs-material-extensions==1.3.1
mkdocs-section-index==0.3.8
mkdocstrings==0.24.0
Expand All @@ -47,10 +47,10 @@ nox==2023.4.22
packaging==23.2
paginate==0.5.6
pathspec==0.12.1
pdm==2.11.2
pdm==2.12.2
pdm-bump==0.7.3
platformdirs==4.1.0
pluggy==1.3.0
pluggy==1.4.0
pre-commit==3.6.0
pygments==2.17.2
pymdown-extensions==10.7
Expand All @@ -59,15 +59,15 @@ pyproject-metadata==0.7.1
pytest==7.4.4
pytest-xdist==3.5.0
python-dateutil==2.8.2
python-dotenv==1.0.0
python-dotenv==1.0.1
pyyaml==6.0.1
pyyaml-env-tag==0.1
regex==2023.12.25
requests==2.31.0
requests-toolbelt==1.0.0
resolvelib==1.0.1
rich==13.7.0
ruff==0.1.13
ruff==0.1.14
setuptools==69.0.3
shellingham==1.5.4
six==1.16.0
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The `core` module contains constants & utility functions meant for internal use. Other modules in `red_utils` can access the `red_utils.core`
package to call constants like `DATA_DIR` (defaults to `.data`) when setting default params for a function.
"""

from __future__ import annotations

from . import constants, dataclass_utils
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Other modules import from `red_utils.core` to set values like the
default `DATA_DIR` (.data).
"""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/core/dataclass_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Mostly used in `red_utils.std`, but can be imported into
any Python script that declares `dataclasses.dataclass` classes.
"""

from __future__ import annotations

from . import mixins
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/core/dataclass_utils/mixins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ExampleClass(DictMixin):
classobj.as_dict() # classobj now has access to the `.as_dict()` method of `DictMixin`.
```
"""

from __future__ import annotations

from .mixin_classes import DictMixin
1 change: 1 addition & 0 deletions src/red_utils/exc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class MyException(CustomException):
level: int = 0
```
"""

from __future__ import annotations

from .generic import CustomException
1 change: 1 addition & 0 deletions src/red_utils/ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
`pkutil.find_loader()` will be deprecated in a future Python 3.12 release. I will start updating the code in `red_utils` to be
compatible with the new `importlib.util.find_spec()` method.
"""

from __future__ import annotations

import pkgutil
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/context_managers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
```
"""

from __future__ import annotations

import pkgutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
```
"""

from __future__ import annotations

from . import handlers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Handlers defined in this file can be imported and used as `with` context managers.
"""

from __future__ import annotations

from contextlib import contextmanager
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/dataframe_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Utilities for DataFrame libraries like `pandas` and `polars`.
"""

from __future__ import annotations

import pkgutil
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/dataframe_utils/pandas_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for the `pandas` DataFrame library."""

from __future__ import annotations

from .constants import PANDAS_DATE_FORMAT, PANDAS_DATETIME_FORMAT, PANDAS_TIME_FORMAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `PANDAS_TIME_FORMAT` (str): "%H:%M:%S"
"""

from __future__ import annotations

PANDAS_DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%SZ"
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/dataframe_utils/validators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Validators for Pandas and Polars `DataFrame`s
"""

from __future__ import annotations

from . import pandas_validators
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Validators for the Pandas `DataFrame` library"""

from __future__ import annotations

from .validators import VALID_COL_TYPES, validate_df_col_type
1 change: 1 addition & 0 deletions src/red_utils/ext/diskcache_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities & methods for interacting with the `DiskCache` library."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/diskcache_utils/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Separates some functions/classes from the main diskcache_utils to shorten
length of individual scripts.
"""

from __future__ import annotations

from pathlib import Path
Expand Down
4 changes: 3 additions & 1 deletion src/red_utils/ext/fastapi_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
_level: str = "[{level}]"
_name_line: str = "[{name}:{line}]"
_msg: str = "{message}"
default_color_fmt: str = f"<green>{_ts}</green> <level>{_level}</level> > <level>{_name_line}</level>: {_msg}"
default_color_fmt: str = (
f"<green>{_ts}</green> <level>{_level}</level> > <level>{_name_line}</level>: {_msg}"
)
1 change: 1 addition & 0 deletions src/red_utils/ext/fastapi_utils/healthcheck.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Add a health check."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/loguru_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
...
```
"""

## Import default constants
from __future__ import annotations

Expand Down
5 changes: 4 additions & 1 deletion src/red_utils/ext/loguru_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
]
```
"""

from __future__ import annotations

from dataclasses import dataclass, field
Expand All @@ -49,7 +50,9 @@
_msg: str = "{message}"

default_fmt: str = f"{_ts} {_level} > {_name_line}: {_msg}"
default_color_fmt: str = f"<green>{_ts}</green> <level>{_level}</level> > <level>{_name_line}</level>: {_msg}"
default_color_fmt: str = (
f"<green>{_ts}</green> <level>{_level}</level> > <level>{_name_line}</level>: {_msg}"
)
# default_fmt: str = "[{time:YYYY-MM-DD_HH:mm:ss}] [{level}] | [{name}:{line}]: {message}"
# default_color_fmt: str = "<green>[{time:YYYY-MM-DD_HH:mm:ss}]</green> <level>[{level}]</level> | [{name}:{line}]: {message}"
# default_log_dir: str = "logs"
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/loguru_utils/operations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions that can be imported and used to manage `loguru`."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/loguru_utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Each validator checks for existence (unless `none_ok=True`),
then type, then value (if a list of allowed values is passed).
"""

from __future__ import annotations

from .constants import (
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/msgpack_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for the `msgpack` serialization library."""

from __future__ import annotations

from . import classes, constants, operations, validators
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/msgpack_utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
]
```
"""

from __future__ import annotations

valid_operations: list[str] = [
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/pydantic_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for `pydantic`"""

from __future__ import annotations

from . import parsers
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/pydantic_utils/parsers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parse a Pydantic model so it is usable by SQLAlchemy."""

from __future__ import annotations

def is_pydantic(obj: object) -> bool:
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/sqlalchemy_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
as early as possible. For example, import the `Base` object from this script into a `main.py` or equivalent entrypoint,
create/import an `Engine`, and immediately run the metadata create function.
"""

from __future__ import annotations

from . import base, connection_models, constants, utils
Expand Down
1 change: 1 addition & 0 deletions src/red_utils/ext/sqlalchemy_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Supported: `["sqlite", "postgres", "mssql"]`
"""

## List of valid/supported databases
from __future__ import annotations

Expand Down
Loading

0 comments on commit 435149c

Please sign in to comment.