Skip to content

Commit d8f0929

Browse files
authored
Merge pull request #9 from uberfastman/docs/versioning
Update docs and add automatic versioning
2 parents 3770eff + cce1402 commit d8f0929

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- "3.5"
55
- "3.6"
66
- "3.7"
7+
- "3.8"
78

89
install:
910
- pip install -r requirements.txt

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212

1313
[![latest-release.png](https://github.com/uberfastman/yfpy/raw/develop/resources/images/latest-release.png)](https://github.com/uberfastman/yfpy/releases/latest)
1414

15-
###### Latest Version: [v3.3.0](https://github.com/uberfastman/yfpy/releases/tag/v3.3.0)
16-
1715
[![Build Status](https://travis-ci.com/uberfastman/yfpy.svg?branch=develop)](https://travis-ci.com/uberfastman/yfpy)
16+
[![PyPI](https://img.shields.io/pypi/v/yfpy.svg?style=flat)](https://pypi.python.org/pypi/yfpy)
17+
[![PyPI](https://img.shields.io/pypi/dm/yfpy.svg?style=flat)](https://pypi.python.org/pypi/yfpy)
18+
[![PyPI](https://img.shields.io/pypi/pyversions/yfpy.svg?style=flat)](https://pypi.python.org/pypi/yfpy)
19+
[![PyPI](https://img.shields.io/pypi/l/yfpy.svg?style=flat)](https://pypi.python.org/pypi/yfpy)
1820

1921
---
2022

VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT EDIT - VERSIONING CONTROLLED BY GIT TAGS
2+
__version__ = "v3.3.1"

setup.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
import os
22
import shutil
3+
import subprocess
34

45
import setuptools
56

7+
version_file = os.path.join(os.path.dirname(__file__), "VERSION")
8+
9+
# noinspection PyBroadException
10+
try:
11+
git_version = subprocess.check_output(["git", "describe"]).decode("utf-8").strip()
12+
pypi_version = git_version[1:]
13+
except Exception:
14+
with open(version_file, "r") as vf:
15+
git_version = vf.read().strip().split("=")[-1].strip().replace('"', '')
16+
pypi_version = git_version[1:]
17+
18+
with open(version_file, "w") as vf:
19+
vf.write("{}{}__version__ = \"{}\"{}".format(
20+
"# DO NOT EDIT - VERSIONING CONTROLLED BY GIT TAGS",
21+
os.linesep,
22+
git_version,
23+
os.linesep
24+
))
25+
626
if os.path.exists("build"):
727
print("Removing stale \"build\" directory before packaging...")
828
shutil.rmtree("build")
@@ -23,21 +43,25 @@
2343

2444
setuptools.setup(
2545
name="yfpy",
26-
version="3.3.0",
46+
version=pypi_version,
2747
author="Wren J. R.",
2848
author_email="wrenjr@yahoo.com",
2949
description="Python API wrapper for the Yahoo Fantasy Sports public API.",
3050
long_description=long_description,
3151
long_description_content_type="text/markdown",
3252
keywords="yahoo fantasy sports api wrapper nfl football nhl hockey mlb baseball nba basketball",
3353
url="https://github.com/uberfastman/yfpy",
54+
download_url="https://github.com/uberfastman/yfpy/archive/{}.tar.gz".format(git_version),
3455
packages=setuptools.find_packages(),
3556
classifiers=[
3657
"Programming Language :: Python :: 3",
58+
"Programming Language :: Python :: 3.5",
59+
"Programming Language :: Python :: 3.6",
3760
"Programming Language :: Python :: 3.7",
61+
"Programming Language :: Python :: 3.8",
3862
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
3963
"Operating System :: OS Independent",
40-
"Development Status :: 4 - Beta",
64+
"Development Status :: 5 - Production/Stable",
4165
"Topic :: Software Development :: Libraries :: Python Modules",
4266
"Environment :: Console",
4367
"Intended Audience :: Developers"

0 commit comments

Comments
 (0)