Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ In progress (unreleased)
------------------------

* :gh:issue:`1121` :mod:`mitogen`: Log skipped :py:mod:`termios` attributes
* :gh:issue:`1238` packaging: Avoid :py:mod:`ast`, requires Python = 2.6


v0.3.22 (2025-02-04)
Expand Down
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import ast
import os
import re

from setuptools import find_packages, setup


def grep_version():
path = os.path.join(os.path.dirname(__file__), 'mitogen/__init__.py')
version_pattern = re.compile(
r"__version__ = \((\d+), (\d+), (\d+)(?:, '(dev)')?\)",
)
with open(path) as fp:
for line in fp:
if line.startswith('__version__'):
_, _, s = line.partition('=')
parts = ast.literal_eval(s.strip())
return '.'.join(str(part) for part in parts)
match = version_pattern.search(fp.read())
if match is None:
raise ValueError('Could not find __version__ string in %s', path)
return '.'.join(str(part) for part in match.groups())


def long_description():
Expand Down