-
Notifications
You must be signed in to change notification settings - Fork 188
RFE: Add support for building python pip packages #467
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
Open
drakenclimber
wants to merge
4
commits into
seccomp:main
Choose a base branch
from
drakenclimber:python-wheel2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ebb2593
python: Rename setup.py to setup.py.in
drakenclimber 4dc94a0
include: Change how seccomp-syscalls.h is included
drakenclimber bf319cf
python: Add support for building python wheels
drakenclimber c6483a3
github: Add Python continuous integration
drakenclimber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,75 @@ | ||
| # | ||
| # Continuous Integration Workflow libseccomp Python Code | ||
| # | ||
| # Copyright (c) 2025 Oracle and/or its affiliates. | ||
| # Author: Tom Hromatka <tom.hromatka@oracle.com> | ||
| # | ||
|
|
||
| # | ||
| # This library is free software; you can redistribute it and/or modify it | ||
| # under the terms of version 2.1 of the GNU Lesser General Public License as | ||
| # published by the Free Software Foundation. | ||
| # | ||
| # This library is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
| # for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public License | ||
| # along with this library; if not, see <http://www.gnu.org/licenses>. | ||
| # | ||
|
|
||
| name: Python Continuous Integration | ||
| on: ["push", "pull_request"] | ||
|
|
||
| jobs: | ||
| build-wheel: | ||
| name: Build Wheel | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Initialize libseccomp | ||
| uses: ./.github/actions/setup | ||
| - name: Build libseccomp | ||
| run: | | ||
| ./configure --enable-python | ||
| make check-build | ||
| - name: Build wheel | ||
| run: make python-wheel | ||
|
|
||
| build-wheels: | ||
| name: Build Wheels | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Initialize libseccomp | ||
| uses: ./.github/actions/setup | ||
| - name: Install cibuildwheel | ||
| run: python -m pip install cibuildwheel | ||
| - name: Build libseccomp | ||
| run: | | ||
| ./configure --enable-python | ||
| make check-build | ||
| - name: Build wheels | ||
| run: make python-wheels | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
| path: src/python/wheelhouse/*.whl | ||
|
|
||
| flake: | ||
| name: Run Flake | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Initialize libseccomp | ||
| uses: ./.github/actions/setup | ||
| - name: Install Flake Dependencies | ||
| run: sudo apt-get install python3-flake8-quotes | ||
| - name: flake8 Lint | ||
| uses: reviewdog/action-flake8@v3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -146,6 +146,7 @@ dnl #### | |
| AC_CONFIG_FILES([ | ||
| libseccomp.pc | ||
| include/seccomp.h | ||
| src/python/setup.py | ||
| ]) | ||
|
|
||
| dnl #### | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| build | ||
| build/ | ||
| dist/ | ||
| libseccomp.a | ||
| seccomp.c | ||
| seccomp.h | ||
| seccomp-syscalls.h | ||
| seccomp.egg-info/ | ||
| setup.py | ||
| wheelhouse/ |
This file contains hidden or 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,6 @@ | ||
| include seccomp.pyx | ||
| include libseccomp.pxd | ||
| include libseccomp.a | ||
| include seccomp.h | ||
| include seccomp-syscalls.h | ||
| include __init__.py |
This file contains hidden or 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
Empty file.
This file contains hidden or 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,2 @@ | ||
| [build-system] | ||
| requires = ["cython", "setuptools"] |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,8 +3,9 @@ | |
| # | ||
| # Enhanced Seccomp Library Python Module Build Script | ||
| # | ||
| # Copyright (c) 2012 Red Hat <pmoore@redhat.com> | ||
| # Copyright (c) 2012-2025 Red Hat <pmoore@redhat.com> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo? Did you mean to add a line for you/Oracle? |
||
| # Author: Paul Moore <paul@paul-moore.com> | ||
| # Author: Tom Hromatka <tom.hromatka@oracle.com> | ||
| # | ||
|
|
||
| # | ||
|
|
@@ -29,17 +30,20 @@ | |
|
|
||
| setup( | ||
| name = "seccomp", | ||
| version = os.environ["VERSION_RELEASE"], | ||
| version = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@", | ||
| description = "Python binding for libseccomp", | ||
| long_description = "Python API for the Linux Kernel's syscall filtering capability, seccomp.", | ||
| url = "https://github.com/seccomp/libseccomp", | ||
| maintainer = "Paul Moore", | ||
| maintainer_email = "paul@paul-moore.com", | ||
| license = "LGPLv2.1", | ||
| license = "LGPL-2.1", | ||
| platforms = "Linux", | ||
| ext_modules = cythonize([ | ||
| Extension("seccomp", ["seccomp.pyx"], | ||
| # unable to handle libtool libraries directly | ||
| extra_objects=["../.libs/libseccomp.a"]), | ||
| # Unable to handle libtool libraries directly. Also note that | ||
| # python wheel builds cannot use files outside of the build | ||
| # directory, so libseccomp.a is manually copied into src/python | ||
| # by Makefile.am | ||
| extra_objects=["libseccomp.a"]), | ||
| ]) | ||
| ) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's just me, but I'm fairly certain I'm going to be forever typing the wrong target as they only differ in that plural 's' at the end; would changing
python-wheelstopython-wheels-pipbe reasonable?