-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aac2ac
commit 043f139
Showing
5 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# @Author: jankincai | ||
# @Date: 2024-09-13 10:48:33 | ||
# @Last Modified by: jankincai | ||
# @Last Modified time: 2024-09-14 11:21:11 | ||
|
||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
|
||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
name: Build and publish Python to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
sudo apt install libpcap-dev | ||
- name: Build package | ||
run: python -m build -s | ||
- name: Publish package to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish package to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# @Author: jankincai | ||
# @Date: 2024-09-12 10:45:37 | ||
# @Last Modified by: jankincai | ||
# @Last Modified time: 2024-09-12 17:18:27 | ||
|
||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ "master", "develop" ] | ||
pull_request: | ||
branches: [ "master", "develop" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- 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 tox | ||
sudo apt install libpcap-dev | ||
- name: Lint with flake8 | ||
run: flake8 pylibpcap | ||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: python -m tox | ||
# - name: Test with pytest | ||
# run: | | ||
# pytest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# @Author: JanKinCai | ||
# @Date: 2019-11-09 10:08:53 | ||
# @Last Modified by: jankincai | ||
# @Last Modified time: 2024-09-12 10:31:22 | ||
# @Last Modified time: 2024-09-14 10:04:08 | ||
import os | ||
import glob | ||
|
||
|
@@ -12,10 +12,6 @@ | |
from Cython.Distutils import build_ext | ||
|
||
|
||
with open('README.md') as f: | ||
long_description = f.read() | ||
|
||
|
||
def read_requirements(path): | ||
"""read requirements | ||
|
@@ -59,7 +55,7 @@ def read_requirements(path): | |
|
||
setup( | ||
name="python-libpcap", | ||
version="0.5.0", | ||
version="0.5.1", | ||
author="JanKinCai", | ||
author_email="[email protected]", | ||
maintainer="JanKinCai", | ||
|
@@ -68,7 +64,8 @@ def read_requirements(path): | |
download_url="https://github.com/caizhengxin/python-libpcap.git", | ||
license="BSD", | ||
description="Cython libpcap", | ||
long_description=long_description, | ||
long_description=open('README.md').read(), | ||
long_description_content_type="text/markdown", | ||
keywords=[ | ||
"python-libpcap", | ||
"pylibpcap", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters