Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

Commit 50432b0

Browse files
committed
simplify version mechanism (fix #10) and call it v0.12
1 parent 5d486ee commit 50432b0

3 files changed

Lines changed: 6 additions & 21 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ build/*
33
dist
44
dist/*
55
*.pyc
6-
zxing/java
7-
zxing/version.py
6+
zxing/java/

setup.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,12 @@
1212

1313
########################################
1414

15-
# Based on this recipe, adapted for Python 3, Git 2.8.x, and PEP-440 version identifiers
16-
# http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/
17-
# https://www.python.org/dev/peps/pep-0440/#version-scheme
18-
19-
# Fetch version from git tags, and write to version.py.
20-
# Also, when git is not available (PyPi package), use stored version.py.
2115
version_py = path.join(path.dirname(__file__), 'zxing', 'version.py')
2216

23-
try:
24-
version_git = sp.check_output(["git", "describe", "--tags", "--dirty=_dirty"]).strip().decode('ascii')
25-
final, dev, blob, dirty = re.match(r'v?((?:\d+\.)*\d+)(?:-(\d+)-(g[a-z0-9]+))?(_dirty)?', version_git).groups()
26-
version_pep = final+('.dev%s+%s'%(dev,blob) if dev else '')+(dirty if dirty else '')
27-
except:
28-
d = {}
29-
with open(version_py, 'r') as fh:
30-
exec(fh.read(), d)
31-
version_pep = d['__version__']
32-
else:
33-
with open(version_py, 'w') as fh:
34-
print("# Do not edit this file, versioning is governed by git tags", file=fh)
35-
print('__version__="%s"' % version_pep, file=fh)
17+
d = {}
18+
with open(version_py, 'r') as fh:
19+
exec(fh.read(), d)
20+
version_pep = d['__version__']
3621

3722
########################################
3823

zxing/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__="0.12"

0 commit comments

Comments
 (0)