File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1- try :
2- __version__ = __import__ ('pkg_resources' ).get_distribution ('django-xml' ).version
3- except Exception :
4- __version__ = 'unknown'
1+ __version__ = "3.0.1"
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+ import re
3+ import os .path
24from setuptools import setup , find_packages
35
46
1012 # Use the create_readme_rst command to convert README to reStructuredText
1113 pass
1214
15+ with open (os .path .join (os .path .dirname (__file__ ), "djxml" , "__init__.py" )) as f :
16+ for line in f :
17+ if m := re .search (r"""^__version__ = (['"])(.+?)\1$""" , line ):
18+ version = m .group (2 )
19+ break
20+ else :
21+ raise LookupError ("Unable to find __version__ in djxml/__init__.py" )
1322
1423setup (
1524 name = 'django-xml' ,
16- version = "3.0.0" ,
25+ version = version ,
1726 install_requires = [
1827 'lxml' ,
1928 'pytz' ,
You can’t perform that action at this time.
0 commit comments