Skip to content

Commit ed63be1

Browse files
author
Carme, Pamy
committed
build: get and set correct version for the download_url property
Signed-off-by: Carme, Pamy <pamy.carme@sciencelogic.com>
1 parent 0a20a31 commit ed63be1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from setuptools import setup, find_packages, __version__
1+
from setuptools import setup, find_packages
22
from os import path
3+
import configparser
34

45
desc_file = "README.md"
56

@@ -18,6 +19,12 @@
1819
x.strip().replace("git+", "") for x in all_reqs if x.startswith("git+")
1920
]
2021

22+
# get current version for download_url
23+
config = configparser.RawConfigParser()
24+
config.read('setup.cfg')
25+
download_v = dict(config.items('metadata')).get("version")
26+
27+
2128
setup(
2229
name="flask-authz",
2330
description="An authorization middleware for Flask that supports ACL, RBAC, ABAC, based on Casbin",
@@ -26,7 +33,7 @@
2633
author=["Yang Luo", "Sciencelogic"],
2734
author_email="hsluoyz@gmail.com",
2835
url="https://github.com/pycasbin/flask-authz",
29-
download_url="https://github.com/pycasbin/flask-authz/tarball/" + __version__,
36+
download_url="https://github.com/pycasbin/flask-authz/tarball/v" + download_v,
3037
license="Apache 2.0",
3138
python_requires=">=3.5",
3239
classifiers=[

0 commit comments

Comments
 (0)