Skip to content

Commit

Permalink
add windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Apr 10, 2024
1 parent c1ed5c7 commit 0c3babd
Show file tree
Hide file tree
Showing 16 changed files with 1,080 additions and 34 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/python-publish-macos-and-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
name: Upload python package for macOS & linux

on:
release:
types: [ created ]
pull_request:
branches: [ "master" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -14,19 +14,7 @@ concurrency:
jobs:
build:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: macos-latest
arch: arm64
- os: macos-latest
arch: x86_64
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: i686
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -37,12 +25,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U build setuptools wheel twine cibuildwheel
pip install -U build setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
CIBW_ARCHS: ${{ matrix.arch }}
run: |
cibuildwheel --output-dir dist
twine upload dist/* --skip-existing
python3 -m build
47 changes: 47 additions & 0 deletions .github/workflows/python-publish-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload python package for macOS & linux

on:
pull_request:
branches: [ "master" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: macos-latest
arch: arm64
- os: macos-latest
arch: x86_64
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: i686

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U build setuptools wheel twine cibuildwheel
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
CIBW_ARCHS: ${{ matrix.arch }}
run: |
cibuildwheel --output-dir dist
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "pytun-pmd3"
version = "1.0.0"
description = "python-pytun fork with Darwin support (IPv6-ONLY)"
description = "python-pytun fork with darwin and windows support (IPv6-ONLY)"
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
keywords = ["tun", "tuntap", "darwin", "pymobiledevice3", "macos"]
keywords = ["tun", "tuntap", "darwin", "pymobiledevice3", "macos", "windows"]
authors = [
{ name = "doronz88", email = "[email protected]" }
]
Expand All @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]

Expand All @@ -30,6 +31,9 @@ test = ["pytest"]
"Homepage" = "https://github.com/doronz88/pytun-pmd3"
"Bug Reports" = "https://github.com/doronz88/pytun-pmd3/issues"

[tool.setuptools]
package-data = { "pytun_pmd3" = ["wintun/**/*"] }

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*"]

Expand Down
1 change: 1 addition & 0 deletions pytun_pmd3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pytun_pmd3.wintun import TunTapDevice
2 changes: 2 additions & 0 deletions pytun_pmd3/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class PyWinTunException(Exception):
pass
Loading

0 comments on commit 0c3babd

Please sign in to comment.