Skip to content

Commit

Permalink
add github workflow (#1)
Browse files Browse the repository at this point in the history
* add github workflow

* fix typo

* add more docs
  • Loading branch information
dannysepler committed Jun 4, 2022
1 parent 4d38ab0 commit 44f4c51
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci

on: [push, pull_request]

jobs:
build:
name: Running python ${{ matrix.python-version }} on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

steps:
- uses: actions/checkout@v2

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

- name: Install pip and dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Install killport
run: |
pip install .
- name: Run tests
run: |
pytest .
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Kill processes using a given port on your laptop.

## Installation

`pip install keyport`
`pip install killport`

## Usage

Expand All @@ -16,3 +16,8 @@ Kill processes using a given port on your laptop.

`killport 1234 --view-only`
- Displays the processes that would be deleted, but doesn't actually delete them.

## How does this differ from...

- [freeport](https://github.com/yashbathia/freeport/) -- Windows support, since this uses `psutil` rather than `lsof`
- [kill-port](https://github.com/tiaanduplessis/kill-port) -- Very similar, but this is available in PyPI vs NPM
1 change: 0 additions & 1 deletion killport.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def kill_ports(*, ports: list[int], view_only: bool = False) -> int:
process = pinfo.process
print(f'- {process.name()} (pid {process.pid}) on port {pinfo.port}')
if not view_only:
print(f'sending sigterm to {pinfo}')
process.send_signal(SIGTERM)

return 1 if processes else 0
Expand Down

0 comments on commit 44f4c51

Please sign in to comment.