How to use the pyreadstat.__version__ function in pyreadstat

To help you get started, we’ve selected a few pyreadstat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Roche / pyreadstat / tests / test_version.py View on Github external
"""
Test if the version in pyreadstat __init__ matches the version in setup.py
"""

import os
import sys
import re

script_folder = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
sys.path.insert(0, script_folder)
import pyreadstat

pyreadstat_version = pyreadstat.__version__

with open(os.path.join(script_folder, "setup.py")) as h:
    content = h.read()

raw = re.findall("version=\'.*?\'", content)
setup_version = raw[0].replace("version=", "")
setup_version = setup_version.replace("'", "")
print("testing if versions match")
assert(pyreadstat_version == setup_version)
print("versions match!")

pyreadstat

Reads and Writes SAS, SPSS and Stata files into/from pandas data frames.

Apache-2.0
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Similar packages