Skip to content

Commit

Permalink
Add version method (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjburch committed Feb 25, 2023
1 parent e8ff4c2 commit 0cdbe5d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions pybaseball/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
1 change: 1 addition & 0 deletions pybaseball/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.2.5"
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand All @@ -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,
Expand Down

0 comments on commit 0cdbe5d

Please sign in to comment.