From 4a28a69df9daaa317b8f7a8c075618aa54ac71bb Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Tue, 10 Jan 2023 09:56:52 +0100 Subject: [PATCH] Make sure files are properly closed in `setup.py`. Even though I am unsure this can actually lead to issues, this was flagged by CodeQL. Implementing a proper workaround instead of continously whitelisting these instances. --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e234dbf6..066db7c4 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,22 @@ +import pathlib from setuptools import setup install_requires = ["gitpython", "semantic_version", "btest"] + +def version(): + return pathlib.Path("VERSION").read_text().replace("-", ".dev", 1).strip() + + +def long_description(): + return pathlib.Path("README").read_text() + + setup( name="zkg", - version=open("VERSION").read().replace("-", ".dev", 1).strip(), + version=version(), description="The Zeek Package Manager", - long_description=open("README").read(), + long_description=long_description(), license="University of Illinois/NCSA Open Source License", keywords="zeek zeekctl zeekcontrol package manager scripts plugins security", maintainer="The Zeek Project",