Read version from file instead of import in setup.py (#1155)

This commit is contained in:
JonnyWong16 2023-05-22 10:50:11 -07:00 committed by GitHub
parent 405d21b6bc
commit 7ae5ec7da0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,10 +9,14 @@ try:
except ImportError:
from distutils.core import setup
from plexapi import const
# Get version
version = {}
with open('plexapi/const.py') as handle:
exec(handle.read(), version)
# Get README.rst contents
readme = open('README.rst', 'r').read()
with open('README.rst') as handle:
readme = handle.read()
# Get requirements
with open('requirements.txt') as handle:
@ -20,7 +24,7 @@ with open('requirements.txt') as handle:
setup(
name='PlexAPI',
version=const.__version__,
version=version['__version__'],
description='Python bindings for the Plex API.',
author='Michael Shepanski',
author_email='michael.shepanski@gmail.com',