Skip to content
Open
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
9 changes: 5 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]
pull_request:
branches: [master]

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@v6.0.1
- uses: actions/setup-python@v6.2.0
- uses: pre-commit/action@v3.0.1
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Test and Lint
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
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
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions pcapng/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

from .scanner import FileScanner # noqa
from .writer import FileWriter # noqa

__all__ = ["FileScanner", "FileWriter"]
__version__ = "2.1.0"
47 changes: 42 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
[build-system]
requires = [
'setuptools >= 42',
'wheel',
'setuptools_scm[toml]>=3.4',
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "python-pcapng"
description = "Library to read/write the pcap-ng format used by various packet sniffers."
dynamic = ["version"]
readme = "README.rst"
requires-python = ">=3.8"
license = "Apache-2.0"
authors = [
{ name = "Samuele Santi", email = "samuele@samuelesanti.com" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"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",
]

[dependency-groups]
dev = [
"flake8>=5.0.4",
"isort>=5.13.2",
"pre-commit>=3.5.0",
"pytest>=8.3.5",
"pytest-cov>=5.0.0",
]
docs = [
"sphinx>=7.1.2",
"sphinx-rtd-theme>=3.1.0",
]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.targets.sdist]
packages = ["pcapng"]

[tool.setuptools_scm]
[tool.hatch.build.targets.wheel]
packages = ["pcapng"]

[tool.black]
target-version = ['py35']
Expand Down
42 changes: 0 additions & 42 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

Loading
Loading