Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: toddrob99/MLB-StatsAPI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.7
Choose a base ref
...
head repository: toddrob99/MLB-StatsAPI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 344 additions and 105 deletions.
  1. +20 −0 .github/workflows/release.yml
  2. +1 −0 .gitignore
  3. +1 −0 requirements-dev.txt
  4. +8 −3 setup.py
  5. +229 −82 statsapi/__init__.py
  6. +69 −5 statsapi/endpoints.py
  7. +1 −1 statsapi/version.py
  8. +15 −14 tests/test_get.py
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build & Deploy to PyPI on Release

on:
release:
types: [released]

jobs:
deploy:
name: PyPI Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
requirements: twine setuptools wheel
build: true
password: ${{ secrets.PYPI_TOKEN }}
upload: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/logs
.vscode
*.ipynb

# Byte-compiled / optimized / DLL files
__pycache__/
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
pytest-mock
responses
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import setuptools
from statsapi import version
from distutils.util import convert_path

# https://stackoverflow.com/questions/2058802/how-can-i-get-the-version-defined-in-setup-py-setuptools-in-my-package
main_ns = {}
ver_path = convert_path("statsapi/version.py")
with open(ver_path) as ver_file:
exec(ver_file.read(), main_ns)

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="MLB-StatsAPI",
version=version.VERSION,
version=main_ns["VERSION"],
author="Todd Roberts",
author_email="todd@toddrob.com",
description="MLB Stats API Wrapper for Python",
@@ -17,7 +23,6 @@
install_requires=["requests"],
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
Loading