Skip to content
Open
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
23 changes: 20 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
from setuptools import setup
from ssllabs import vars

# Read the value of the 'version' variable from ssllabs/vars.py without importing it.
# Importing vars.py would cause the installation to fail if dependencies of ssllabs/__init__.py are not met.

import pathlib
import re

version = None

with open(pathlib.Path(__file__).parent / 'ssllabs' / 'vars.py') as f:
for line in f:
match = re.match(r'version = \'(.*)\'', line)
if match:
version = match.group(1)
break

if not version:
raise RuntimeError('Could not determine version from ssllabs/vars.py')

setup(name='python-ssllabs',
version=vars.version,
version=version,
packages=['ssllabs'],
scripts=['ssllabs-cli.py'],
install_requires=['requests'],
url='https://github.com/takeshixx/python-ssllabs',
license=vars.license,
license='Apache 2.0',
author='takeshix',
author_email='takeshix@adversec.com')
3 changes: 1 addition & 2 deletions ssllabs/vars.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = '1.4'
license = 'Apache 2.0'
version = '1.4'