setup.py: import version

This commit is contained in:
milahu 2023-12-03 07:15:50 +01:00 committed by GitHub
parent 783b839315
commit af3e11d86f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -17,19 +17,10 @@ import re
from setuptools import setup from setuptools import setup
from undetected_chromedriver import __version__ as version
dirname = os.path.abspath(os.path.dirname(__file__)) dirname = os.path.abspath(os.path.dirname(__file__))
with codecs.open(
os.path.join(dirname, "undetected_chromedriver", "__init__.py"),
mode="r",
encoding="utf-8",
) as fp:
try:
version = re.findall(r"^__version__ = ['\"]([^'\"]*)['\"]", fp.read(), re.M)[0]
except Exception:
raise RuntimeError("unable to determine version")
description = ( description = (
"Selenium.webdriver.Chrome replacement with compatiblity for Brave, and other Chromium based browsers.", "Selenium.webdriver.Chrome replacement with compatiblity for Brave, and other Chromium based browsers.",
"Not triggered by CloudFlare/Imperva/hCaptcha and such.", "Not triggered by CloudFlare/Imperva/hCaptcha and such.",