File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11from setuptools import setup , find_packages
22from setuptools .command .test import test as TestCommand
33import os
4+ import re
45import sys
56
67
@@ -38,10 +39,20 @@ def read(fname):
3839README = read ('README.rst' )
3940CHANGES = read ('CHANGES.rst' )
4041
42+
43+ version = ""
44+
45+ with open ("static_precompiler/__init__.py" ) as fd :
46+ version = re .search (r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]' , fd .read (), re .MULTILINE ).group (1 )
47+
48+ if not version :
49+ raise RuntimeError ('Cannot find version information' )
50+
51+
4152setup (
4253 name = "django-static-precompiler" ,
4354 packages = find_packages (),
44- version = "1.1" ,
55+ version = version ,
4556 author = "Andrey Fedoseev" ,
4657 author_email = "andrey.fedoseev@gmail.com" ,
4758 url = "https://github.com/andreyfedoseev/django-static-precompiler" ,
Original file line number Diff line number Diff line change 1+ __version__ = "1.1"
You can’t perform that action at this time.
0 commit comments