Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ repos:
args: [--fix]

- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class Employee(BaseModel):
# Use model_validate for string inputs to avoid static type errors and to
# keep intentional parsing tests.
vignesh_gawali = Employee.model_validate(
{"emp_name": "Vignesh Gawali", "joining_date": "2024-12-12", "created_at": "2024-12-12 12:12"}
{
"emp_name": "Vignesh Gawali",
"joining_date": "2024-12-12",
"created_at": "2024-12-12 12:12",
}
)

print(f"Python Representaion of Employee Object: {vignesh_gawali.model_dump()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def format_emp() -> None:

# Use model_validate to pass string inputs (so static checkers don't flag arg-type).
another_emp = Employee.model_validate(
{"emp_name": "Tejas Dixit", "joining_date": "2024-12-29", "created_at": "2024-12-28 12:12"}
{
"emp_name": "Tejas Dixit",
"joining_date": "2024-12-29",
"created_at": "2024-12-28 12:12",
}
)

print(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class EventLog(BaseModel):
# Use model_validate when passing extra fields via a mapping so static type
# checkers don't complain about unexpected keyword arguments.
event = EventLog.model_validate(
{"event_id": 0, "event_type": "Error", "event_description": "ValidationError"}
{
"event_id": 0,
"event_type": "Error",
"event_description": "ValidationError",
}
)

print(event.model_dump())
Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ dev = [

[tool.pytest.ini_options]
addopts = "--import-mode=importlib -v"
testpaths = [
"python_fundamentals/tests",
]
python_files = [
"test_*.py",
]
testpaths = ["tests"]
python_files = ["test_*.py"]

# -----------------------------------------------------------------------------
# Ruff
Expand Down Expand Up @@ -63,6 +59,9 @@ target-version = ["py312"]
[tool.mypy]
python_version = "3.12"

pretty = true
show_error_codes = true

warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
Expand All @@ -73,5 +72,5 @@ disallow_incomplete_defs = true
check_untyped_defs = true

no_implicit_optional = true
pretty = true
show_error_codes = true

explicit_package_bases = true
Empty file.
Empty file.
137 changes: 0 additions & 137 deletions python_fundamentals/exercises/employee_salary_module/test_employee.py

This file was deleted.

52 changes: 0 additions & 52 deletions python_fundamentals/notes/day01-functions-and-validation.md

This file was deleted.

61 changes: 0 additions & 61 deletions python_fundamentals/notes/day02-args-and-kwargs.md

This file was deleted.

Loading
Loading