From a8be4ea814a8a2c8112ed6dea59b47587aa46e54 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sun, 13 Mar 2022 16:42:41 +0100 Subject: [PATCH] Readability counts, code must be self-explanatory --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c6892cc..2f35e30 100644 --- a/setup.py +++ b/setup.py @@ -9,10 +9,11 @@ from setuptools import setup import analytical as package -def read_file(fname): - """Read content of a file in project folder.""" - with (Path(__file__).resolve().parent / fname).open() as file: - return file.read() +def read_file(filename): + """Read a text file and return its contents.""" + project_home = Path(__file__).parent.resolve() + file_path = project_home / filename + return file_path.read_text(encoding="utf-8") setup(