Skip to content

Commit

Permalink
Release 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Jul 27, 2018
1 parent 50450b3 commit 443664e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 41 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
1.2.4 (2018-07-27)
==================

Bug Fixes
---------

- Fix exception on Windows when the executable path is too long to fit into the
PROCESSENTRY32 struct. Generally the shell shouldn't be buried this deep, and
we can always fix it when that actually happens, if ever. `#8
<https://github.com/sarugaku/shellingham/issues/8>`_


1.2.3 (2018-07-10)
=======================

Expand Down
3 changes: 0 additions & 3 deletions news/8.bugfix

This file was deleted.

50 changes: 25 additions & 25 deletions src/shellingham/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import importlib
import os

from ._core import ShellDetectionFailure


__version__ = '1.2.3.dev0'


def detect_shell(pid=None, max_depth=6):
name = os.name
try:
impl = importlib.import_module('.' + name, __name__)
except ImportError:
raise RuntimeError(
'Shell detection not implemented for {0!r}'.format(name),
)
try:
get_shell = impl.get_shell
except AttributeError:
raise RuntimeError('get_shell not implemented for {0!r}'.format(name))
shell = get_shell(pid, max_depth=max_depth)
if shell:
return shell
raise ShellDetectionFailure()
import importlib
import os

from ._core import ShellDetectionFailure


__version__ = '1.2.4'


def detect_shell(pid=None, max_depth=6):
name = os.name
try:
impl = importlib.import_module('.' + name, __name__)
except ImportError:
raise RuntimeError(
'Shell detection not implemented for {0!r}'.format(name),
)
try:
get_shell = impl.get_shell
except AttributeError:
raise RuntimeError('get_shell not implemented for {0!r}'.format(name))
shell = get_shell(pid, max_depth=max_depth)
if shell:
return shell
raise ShellDetectionFailure()
20 changes: 7 additions & 13 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ast
import pathlib
import shutil
import subprocess

import invoke
import parver
Expand Down Expand Up @@ -28,11 +29,11 @@ def clean(ctx):


def _read_version():
with INIT_PY.open() as f:
for line in f:
if line.startswith('__version__ = '):
return ast.literal_eval(line[len('__version__ = '):].strip())
raise EnvironmentError('failed to read version')
out = subprocess.check_output(['git', 'tag'], encoding='ascii')
version = max(parver.Version.parse(v).normalize() for v in (
line.strip() for line in out.split('\n')
) if v)
return version


def _write_version(v):
Expand Down Expand Up @@ -81,13 +82,6 @@ def _bump_release(version, type_):
PREBUMP = 'patch'


def _unprebump(version):
release = list(version.release)
release[REL_TYPES.index(PREBUMP)] -= 1
release = tuple(release)
version.base_version().clear(dev=True).replace(release=release)


def _prebump(version):
next_version = version.bump_release(PREBUMP).bump_dev()
print(f'[bump] {version} -> {next_version}')
Expand All @@ -98,7 +92,7 @@ def _prebump(version):
def release(ctx, type_, repo):
"""Make a new release.
"""
version = _unprebump(parver.Version.parse(_read_version()).normalize())
version = _read_version()
version = _bump_release(version, type_)
_write_version(version)

Expand Down

0 comments on commit 443664e

Please sign in to comment.