|
1 | 1 | import os
|
2 | 2 | import shutil
|
| 3 | +import subprocess |
3 | 4 |
|
4 | 5 | import setuptools
|
5 | 6 |
|
| 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 | + |
6 | 26 | if os.path.exists("build"):
|
7 | 27 | print("Removing stale \"build\" directory before packaging...")
|
8 | 28 | shutil.rmtree("build")
|
|
23 | 43 |
|
24 | 44 | setuptools.setup(
|
25 | 45 | name="yfpy",
|
26 |
| - version="3.3.0", |
| 46 | + version=pypi_version, |
27 | 47 | author="Wren J. R.",
|
28 | 48 | author_email="wrenjr@yahoo.com",
|
29 | 49 | description="Python API wrapper for the Yahoo Fantasy Sports public API.",
|
30 | 50 | long_description=long_description,
|
31 | 51 | long_description_content_type="text/markdown",
|
32 | 52 | keywords="yahoo fantasy sports api wrapper nfl football nhl hockey mlb baseball nba basketball",
|
33 | 53 | url="https://github.com/uberfastman/yfpy",
|
| 54 | + download_url="https://github.com/uberfastman/yfpy/archive/{}.tar.gz".format(git_version), |
34 | 55 | packages=setuptools.find_packages(),
|
35 | 56 | classifiers=[
|
36 | 57 | "Programming Language :: Python :: 3",
|
| 58 | + "Programming Language :: Python :: 3.5", |
| 59 | + "Programming Language :: Python :: 3.6", |
37 | 60 | "Programming Language :: Python :: 3.7",
|
| 61 | + "Programming Language :: Python :: 3.8", |
38 | 62 | "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
39 | 63 | "Operating System :: OS Independent",
|
40 |
| - "Development Status :: 4 - Beta", |
| 64 | + "Development Status :: 5 - Production/Stable", |
41 | 65 | "Topic :: Software Development :: Libraries :: Python Modules",
|
42 | 66 | "Environment :: Console",
|
43 | 67 | "Intended Audience :: Developers"
|
|
0 commit comments