diff --git a/pybaseball/__init__.py b/pybaseball/__init__.py index db80a67c..45d2dd1d 100644 --- a/pybaseball/__init__.py +++ b/pybaseball/__init__.py @@ -97,3 +97,4 @@ from .datasources.fangraphs import (fg_batting_data, fg_pitching_data, fg_team_batting_data, fg_team_fielding_data, fg_team_pitching_data) from .split_stats import get_splits +from .version import __version__ diff --git a/pybaseball/version.py b/pybaseball/version.py new file mode 100644 index 00000000..012423e2 --- /dev/null +++ b/pybaseball/version.py @@ -0,0 +1 @@ +__version__ = "2.2.5" \ No newline at end of file diff --git a/setup.py b/setup.py index 5022ca39..96c5148a 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,11 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() +# Get Version +version_file = path.join(here, "pybaseball", "version.py") +with open(version_file, encoding="utf-8") as f: + version = f.read().split(" = ")[-1].strip('"') + setup( name='pybaseball', @@ -19,7 +24,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='2.2.4', + version=version, description='Retrieve baseball data in Python', long_description=long_description,