Skip to content

Commit

Permalink
Merge pull request #83 from sarugaku:frostming/issue81
Browse files Browse the repository at this point in the history
fix: always detect the host shell on MacOS
  • Loading branch information
frostming committed Oct 24, 2023
2 parents e5bdc07 + 778f76e commit bbfe7fb
Show file tree
Hide file tree
Showing 7 changed files with 367 additions and 333 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- run: pip install black ruff
- run: |
- run: |
ruff check src
black --check src
build:
Expand All @@ -20,13 +20,13 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install build dependencies
run: python -m pip install --upgrade build
Expand Down
675 changes: 353 additions & 322 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions news/81.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that ``detect_shell()`` always returns the host shell on MacOS.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifier =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Software Development :: Libraries :: Python Modules

[options]
Expand Down
4 changes: 2 additions & 2 deletions src/shellingham/posix/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def iter_process_parents(pid, max_depth=10):
processes_mapping = {}
for line in output.split("\n"):
try:
pid, ppid, args = line.strip().split(None, 2)
_pid, ppid, args = line.strip().split(None, 2)
# XXX: This is not right, but we are really out of options.
# ps does not offer a sane way to decode the argument display,
# and this is "Good Enough" for obtaining shell names. Hopefully
Expand All @@ -40,7 +40,7 @@ def iter_process_parents(pid, max_depth=10):
args = tuple(a.strip() for a in args.split(" "))
except ValueError:
continue
processes_mapping[pid] = Process(args=args, pid=pid, ppid=ppid)
processes_mapping[_pid] = Process(args=args, pid=_pid, ppid=ppid)

for _ in range(max_depth):
try:
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37, py38, py39, py310, py311
envlist = py37, py38, py39, py310, py311, py312

[gh-actions]
python =
Expand All @@ -8,6 +8,7 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
allowlist_externals = pipenv
Expand Down

0 comments on commit bbfe7fb

Please sign in to comment.