Skip to content

Commit b0a6243

Browse files
committed
Merge branch 'hotfix/v1.8.3'
2 parents fe3beb5 + 183c120 commit b0a6243

File tree

7 files changed

+58
-11
lines changed

7 files changed

+58
-11
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changes
22
=======
33

4+
Version 1.8.3
5+
-------------
6+
7+
1. Single-source the version number to prevent version numbers mismatches.
8+
Release 1.8.2 contained a wrong version number in its download url
9+
on pypi.
410

511
Version 1.8.2
612
-------------

docs/conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
# documentation root, use os.path.abspath to make it absolute, like shown here.
2222
sys.path.insert(0, os.path.abspath('.') + "/../")
2323

24+
from ..release_utils import utils # nopep8
25+
2426
# -- General configuration ------------------------------------------------
2527

2628
# If your documentation needs a minimal Sphinx version, state it here.
@@ -55,9 +57,9 @@
5557
# built documents.
5658
#
5759
# The short X.Y version.
58-
version = '1.8.2'
60+
version = utils.find_version("../pygccxml/__init__.py")
5961
# The full version, including alpha/beta/rc tags.
60-
release = '1.8.2'
62+
release = utils.find_version("../pygccxml/__init__.py")
6163

6264
# The language for content autogenerated by Sphinx. Refer to documentation
6365
# for a list of supported languages.

docs/releasing.rst

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
Releasing
22
=========
33

4-
To build a new release, the following files should be modified:
5-
6-
Modify the version numbers in:
7-
8-
``setup.py`` (version and download_url)
4+
To build a new release, modify the version number in:
95

106
``pygccxml/__init__.py``
117

12-
``docs/conf.py``
8+
This version number will then automatically be used to build
9+
the documentation and by the setup.py script when building the wheels.
1310

1411
Do not forget to document the changes in the ``CHANGELOG.md`` file.
1512

pygccxml/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
# TODO:
4141
# 1. Add "explicit" property for constructors
4242

43-
__version__ = '1.8.2'
43+
__version__ = '1.8.3'

release_utils/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2014-2016 Insight Software Consortium.
2+
# Copyright 2004-2008 Roman Yakovenko.
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# See http://www.boost.org/LICENSE_1_0.txt

release_utils/utils.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
# Copyright 2014-2016 Insight Software Consortium.
3+
# Copyright 2004-2008 Roman Yakovenko.
4+
# Distributed under the Boost Software License, Version 1.0.
5+
# See http://www.boost.org/LICENSE_1_0.txt
6+
7+
import io
8+
import os
9+
import re
10+
11+
12+
def find_version(file_path):
13+
"""
14+
Find the version of pygccxml.
15+
16+
Used by setup.py and the sphinx's conf.py.
17+
Inspired by https://packaging.python.org/single_source_version/
18+
19+
Args:
20+
file_path (str): path to the file containing the version.
21+
"""
22+
23+
with io.open(
24+
os.path.join(
25+
os.path.dirname(__file__),
26+
os.path.normpath(file_path)),
27+
encoding="utf8") as fp:
28+
content = fp.read()
29+
30+
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
31+
content, re.M)
32+
if version_match:
33+
return version_match.group(1)
34+
raise RuntimeError("Unable to find version string.")

setup.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
# See http://www.boost.org/LICENSE_1_0.txt
66

77
from setuptools import setup
8+
from release_utils import utils
9+
10+
version = utils.find_version("../pygccxml/__init__.py")
811

912
setup(name="pygccxml",
10-
version="1.8.2",
13+
version=version,
1114
author="Roman Yakovenko",
1215
author_email="roman yakovenko at gmail com",
1316
maintainer="Michka Popoff and the Insight Software Consortium",
1417
maintainer_email="[email protected]",
1518
description="Python package for easy C++ declarations navigation.",
1619
url="https://github.com/gccxml/pygccxml",
17-
download_url="https://github.com/gccxml/pygccxml/archive/v1.8.1.tar.gz",
20+
download_url="https://github.com/gccxml/pygccxml/archive/v" +
21+
version + ".tar.gz",
1822
license="Boost",
1923
keywords="C++, declaration parser, CastXML, gccxml",
2024
packages=["pygccxml",

0 commit comments

Comments
 (0)