Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Pre-automatic build wheels for each platform and release wheels on PyPI #94

Open
lambdalisue opened this issue Oct 16, 2019 · 2 comments · May be fixed by #96
Open

RFC: Pre-automatic build wheels for each platform and release wheels on PyPI #94

lambdalisue opened this issue Oct 16, 2019 · 2 comments · May be fixed by #96

Comments

@lambdalisue
Copy link
Contributor

I love pypcap and it is an awesome library but it does not provide wheels for each platform so users must build the library from source. It's quite painful, especially for Windows.

So what do you think about if I create a PR to provides a way to release wheels for each platform. I think I'll follow the netifaces method, which build wheels for Windows in AppVeyor and wheels for linux/mac in docker.

This would add extra steps when you release pypcap so I'd like to ask you the idea before I create a PR for it.

Thanks.

@hellais
Copy link
Member

hellais commented Oct 18, 2019

So what do you think about if I create a PR to provides a way to release wheels for each platform.

I think that would be super useful and much appreciated!

This would add extra steps when you release pypcap so I'd like to ask you the idea before I create a PR for it.

As long as those steps are documented and it's possible to do those on a macOS system (or somebody with a windows machine is willing to help out taking care of those builds) that is good for me!

@guyharris may also have some thoughts on this

@lambdalisue
Copy link
Contributor Author

As long as those steps are documented and it's possible to do those on a macOS system (or somebody with a windows machine is willing to help out taking care of those builds) that is good for me!

Nice. Well, I'm planning to use AppVeyor to compile pypcap for Windows so mac/linux contributors can download the artifact and upload to PyPI (like netifaces does).


I really would like to do this but I'm not 100% sure if I have enough time.
So I share my PowerShell script to create wheel for pypcap in case (License: follow pypcap's license).

# Chocolatey
Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Build requirements
choco install -y microsoft-build-tools visualcppbuildtools --version 14.0.25420.1

# Build pypcap
$pypcap = "https://github.com/pynetwork/pypcap/archive/v1.2.3.zip"
$NpcapSDK = "https://nmap.org/npcap/dist/npcap-sdk-1.03.zip"

# Enable TLS
[System.Net.ServicePointManager]::SecurityProtocol = @( `
    [Net.SecurityProtocolType]::Tls, `
    [Net.SecurityProtocolType]::Tls11, `
    [Net.SecurityProtocolType]::Tls12 `
)

# Download and extract pypcap
Invoke-WebRequest -UseBasicParsing -OutFile "$env:TEMP\pypcap.zip" -Uri $pypcap
Expand-Archive -Path "$env:TEMP\pypcap.zip" -DestinationPath "$env:TEMP\tmp"
Move-Item $(Get-ChildItem "$env:TEMP\tmp").FullName "$env:TEMP\pypcap"
Remove-Item $env:TEMP\tmp

# Download and extract NpcapSDK
Invoke-WebRequest -UseBasicParsing -OutFile "$env:TEMP\NpcapSDK.zip" -Uri $NpcapSDK
Expand-Archive -Path "$env:TEMP\NpcapSDK.zip" -DestinationPath "$env:TEMP\wpdpack"

Set-Location $env:TEMP\pypcap
python setup.py bdist_wheel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants