From e92997945543ef71fe8446d568a8fa7615740c48 Mon Sep 17 00:00:00 2001 From: Bryan Bennett Date: Tue, 27 Sep 2022 10:35:42 -0400 Subject: [PATCH 1/8] Switch to github workflows for CI Issue: #46 --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------------- setup.cfg | 5 ++--- 3 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dd79e3e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Test and Lint +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest -vvv --cov=pcapng --cov-report=term-missing tests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a31842c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -dist: xenial - -language: python - -branches: - except: - - gh-pages - -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9-dev" - -install: - - pip install .[dev] - -script: - - py.test -vvv --cov=pcapng --cov-report=term-missing tests diff --git a/setup.cfg b/setup.cfg index 040ad88..fb9d58c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,10 +13,9 @@ license_files = classifiers = Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython [options] From 4c1b32e2027c3814d4eab693f9b3473ef8befbc2 Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:12:06 +0100 Subject: [PATCH 2/8] Supported Python versions: 3.10 to 3.14 --- .github/workflows/test.yml | 45 +++++++++++++++++++------------------- setup.cfg | 6 +++-- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd79e3e..087974a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,10 @@ +--- name: Test and Lint on: push: - branches: [ $default-branch ] + branches: [$default-branch] pull_request: - branches: [ $default-branch ] + branches: [$default-branch] jobs: build: @@ -11,25 +12,25 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest -vvv --cov=pcapng --cov-report=term-missing tests + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest -vvv --cov=pcapng --cov-report=term-missing tests diff --git a/setup.cfg b/setup.cfg index fb9d58c..c76ef0d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,9 +13,11 @@ license_files = classifiers = Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 + Programming Language :: Python :: 3.14 Programming Language :: Python :: Implementation :: CPython [options] From 07acd061e9b908bec31bca187cabf1b9ad56e79f Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:13:29 +0100 Subject: [PATCH 3/8] Update pre-commit actions --- .github/workflows/pre-commit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b9655e6..6915fbe 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,6 +13,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 From 218d6c7f6dec4d8ca85cfa1a622daaa2df4f5f6a Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:14:15 +0100 Subject: [PATCH 4/8] Run pre-commit on default branch and PRs --- .github/workflows/pre-commit.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6915fbe..d21431b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -5,9 +5,10 @@ name: pre-commit on: - pull_request: push: - branches: [master] + branches: [$default-branch] + pull_request: + branches: [$default-branch] jobs: pre-commit: From 58fa2868b031e837a3b3288e84e39b295545a858 Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:16:13 +0100 Subject: [PATCH 5/8] Update GHA deps versions --- .github/workflows/pre-commit.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d21431b..e9f49b1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,6 +14,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.1 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + - uses: pre-commit/action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 087974a..61a2bad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,9 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From 52fe307bc90559519ccbdcf02664f6d2d93b302a Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:20:44 +0100 Subject: [PATCH 6/8] fix branch names --- .github/workflows/pre-commit.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e9f49b1..2ec532b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,9 +6,9 @@ name: pre-commit on: push: - branches: [$default-branch] + branches: [master] pull_request: - branches: [$default-branch] + branches: [master] jobs: pre-commit: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61a2bad..72a08c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test and Lint on: push: - branches: [$default-branch] + branches: [master] pull_request: - branches: [$default-branch] + branches: [master] jobs: build: From 21340cff3bb88581d93a18da1ba2e12123ac1ba9 Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:22:36 +0100 Subject: [PATCH 7/8] fix versions --- .github/workflows/pre-commit.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2ec532b..7fe8475 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,6 +14,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - - uses: pre-commit/action@v3 + - uses: actions/checkout@v6.0.1 + - uses: actions/setup-python@v6.2.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72a08c5..1865592 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,9 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.1 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From a2f5604b916bdf4e3eae148615a32bc8d58aa2a4 Mon Sep 17 00:00:00 2001 From: Samuele Santi Date: Sun, 25 Jan 2026 02:24:27 +0100 Subject: [PATCH 8/8] install pytest-cov for tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1865592..deaee38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: |