diff --git a/.gitignore b/.gitignore index db95aed..f6c8cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -162,4 +162,4 @@ cython_debug/ # Ignore dynaconf secret files /conf_dir/.*.toml -/conf_dir/.*.yaml \ No newline at end of file +/conf_dir/.*.yaml diff --git a/README.md b/README.md index aa786b0..8d30eab 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ ![Ruff](https://github.com/sudoskys/TelegramBotTemplate/actions/workflows/ruff.yml/badge.svg) - ## Project Description This project is a template for creating Telegram bots using Python. @@ -16,6 +15,13 @@ pip install pdm ``` +### Change Configuration + +```shell +nano pyproject.toml # Fix the name and email + +``` + ### Pydantic V2 Pydantic is a library for data validation and settings management based on Python type annotations. @@ -42,6 +48,16 @@ dynaconf is a Python library that provides a flexible and dynamic configuration applications. It allows you to easily manage and access configuration settings from various sources such as environment variables, YAML files, JSON files, INI files, and more. +### Pre-commit + +pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. + +```shell +pre-commit install +pre-commit run --all-files + +``` + ### PDM pdm is a modern Python package manager with PEP 582 support. diff --git a/app/utils.py b/app/utils.py index 3213b92..ecd4c94 100644 --- a/app/utils.py +++ b/app/utils.py @@ -17,4 +17,5 @@ def parse_command(command): def generate_uuid(): import shortuuid + return str(shortuuid.uuid()) diff --git a/app_conf.py b/app_conf.py index c0fc851..05283f5 100644 --- a/app_conf.py +++ b/app_conf.py @@ -4,13 +4,13 @@ settings = Dynaconf( envvar_prefix="DYNACONF", - settings_files=['conf_dir/settings.toml', 'conf_dir/.secrets.toml'], + settings_files=["conf_dir/settings.toml", "conf_dir/.secrets.toml"], validators=[ # Ensure some parameter meets a condition # Validator('AGE', lte=30, gte=10), # validate a value is eq in specific env # Validator('PROJECT', eq='hello_world', env='production'), - ] + ], ) settings.validators.register( Validator("app.debug", condition=lambda v: isinstance(v, bool), env="DEBUG"), diff --git a/conf_dir/settings.toml b/conf_dir/settings.toml index 510f8e7..a7cea4e 100644 --- a/conf_dir/settings.toml +++ b/conf_dir/settings.toml @@ -1,2 +1,2 @@ [app] -debug = false \ No newline at end of file +debug = false diff --git a/pyproject.toml b/pyproject.toml index d0c3939..d26c870 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "" version = "" description = "" authors = [ - { name = "sudoskys", email = "coldlando@hotmail.com" }, + { name = "github", email = "none@none.none" }, ] dependencies = [ "pydantic<3.0.0,>=2.0.0", @@ -19,6 +19,9 @@ dependencies = [ "dynaconf>=3.2.4", "pre-commit>=3.5.0", ] + + + requires-python = ">=3.8" readme = "README.md" license = { text = "MIT" }