Skip to content

Commit

Permalink
🚀 chore: Update project dependencies and configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Dec 10, 2023
1 parent e90d7ab commit bd09526
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ cython_debug/

# Ignore dynaconf secret files
/conf_dir/.*.toml
/conf_dir/.*.yaml
/conf_dir/.*.yaml
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ def parse_command(command):

def generate_uuid():
import shortuuid

return str(shortuuid.uuid())
4 changes: 2 additions & 2 deletions app_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion conf_dir/settings.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[app]
debug = false
debug = false
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = ""
version = ""
description = ""
authors = [
{ name = "sudoskys", email = "[email protected]" },
{ name = "github", email = "[email protected]" },
]
dependencies = [
"pydantic<3.0.0,>=2.0.0",
Expand All @@ -19,6 +19,9 @@ dependencies = [
"dynaconf>=3.2.4",
"pre-commit>=3.5.0",
]



requires-python = ">=3.8"
readme = "README.md"
license = { text = "MIT" }
Expand Down

0 comments on commit bd09526

Please sign in to comment.