Skip to content

Commit

Permalink
chore(deps): remove pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Dec 17, 2024
1 parent 1d16364 commit ad677c7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 83 deletions.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ jobs:
python-version: '3.8'
architecture: ${{ matrix.architecture }}

- name: Init .env
run: cp .env.example .env

- name: Install python dependencies
run: pip install poetry && poetry install -E win

Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

SportOrg runs on Python 3.8 for compatibility with Windows 7. Latest Python 3.8 release with binary installers is [Python 3.8.10](https://www.python.org/downloads/release/python-3810/).

During development, the [poetry](https://python-poetry.org/) and [poe](https://poethepoet.natn.io/) tools are used. The preferred method for installing these utilities is [pipx](https://pipx.pypa.io/).
During development, the [poetry](https://python-poetry.org/) and [poe](https://poethepoet.natn.io/) tools are used. The preferred method for installing these utilities is [pipx](https://pipx.pypa.io/).

It may be necessary to restart the terminal window during the installation process to update the `PATH` environment variable.

Expand Down Expand Up @@ -39,8 +39,6 @@ poetry install
poetry install -E win # for Windows
```

Add `DEBUG=True` to `.env` file or `cp .env.example .env`

### Run SportOrg

```
Expand Down
61 changes: 1 addition & 60 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ markupsafe = "2.0.1"
orjson = "^3.9.5"
polib = "^1"
psutil = "^5.9.5"
pydantic = "^1"
PySide6 = "^6"
python-dateutil = "^2"
python-dotenv = '>=0.14,<1.1'
Expand Down Expand Up @@ -51,6 +50,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poe.env]
CODE = "tests sportorg builder.py"
SPORTORG_DEBUG = "true"

[tool.poe.tasks.all]
help = "Run format lint test"
Expand Down
20 changes: 5 additions & 15 deletions sportorg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
import os
import sys
from pathlib import Path
from typing import Optional

from pydantic import BaseSettings


class Env(BaseSettings):
DEBUG: bool = False
TEMPLATES_PATH: Optional[str]

class Config:
env_file = ".env"


NAME = "SportOrg"
VERSION = "v1.7.1"

ENV_PREFIX = "SPORTORG_"
DEBUG = os.getenv(f"{ENV_PREFIX}DEBUG", "false").lower() in ["1", "yes", "true"]
TEMPLATES_PATH = os.getenv(f"{ENV_PREFIX}TEMPLATES_PATH", "")


def is_executable() -> bool:
return hasattr(sys, "frozen")
Expand All @@ -37,8 +29,6 @@ def base_dir(*paths) -> str:
return os.path.join(BASE_DIR, *paths)


env = Env(_env_file=base_dir(".env")) # type:ignore
DEBUG = env.DEBUG
IMG_DIR = base_dir("img")


Expand Down Expand Up @@ -67,7 +57,7 @@ def data_dir(*paths) -> str:
return os.path.join(DATA_DIR, *paths)


TEMPLATE_DIR = env.TEMPLATES_PATH or base_dir("templates")
TEMPLATE_DIR = TEMPLATES_PATH or base_dir("templates")


def set_template_dir(dirpath: str) -> None:
Expand Down

0 comments on commit ad677c7

Please sign in to comment.