Skip to content

Commit 293bd1e

Browse files
committed
v3.0.1
1 parent bbf7d00 commit 293bd1e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

djxml/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
try:
2-
__version__ = __import__('pkg_resources').get_distribution('django-xml').version
3-
except Exception:
4-
__version__ = 'unknown'
1+
__version__ = "3.0.1"

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env python
2+
import re
3+
import os.path
24
from setuptools import setup, find_packages
35

46

@@ -10,10 +12,17 @@
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

1423
setup(
1524
name='django-xml',
16-
version="3.0.0",
25+
version=version,
1726
install_requires=[
1827
'lxml',
1928
'pytz',

0 commit comments

Comments
 (0)