Skip to content

Commit ed4a63d

Browse files
authored
Merge pull request oremanj#75 from oremanj/ci-updates
Misc CI and packaging updates
2 parents afcee0d + a5578d3 commit ed4a63d

File tree

10 files changed

+84
-11570
lines changed

10 files changed

+84
-11570
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
Ubuntu:
11-
name: 'Ubuntu (${{ matrix.python }})'
11+
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
1212
timeout-minutes: 10
1313
runs-on: 'ubuntu-latest'
1414
strategy:
@@ -20,6 +20,16 @@ jobs:
2020
- '3.8'
2121
- '3.9'
2222
- '3.10'
23+
- 'pypy-3.7'
24+
- 'pypy-3.8'
25+
check_lint: ['0']
26+
extra_name: ['']
27+
include:
28+
- python: '2.7'
29+
extra_name: ', build only'
30+
- python: '3.9'
31+
check_lint: '1'
32+
extra_name: ', check lint'
2333
steps:
2434
- name: Checkout
2535
uses: actions/checkout@v2
@@ -30,5 +40,6 @@ jobs:
3040
- name: Run tests
3141
run: ./ci.sh
3242
env:
43+
CHECK_LINT: '${{ matrix.check_lint }}'
3344
# Should match 'name:' up above
34-
JOB_NAME: 'Ubuntu (${{ matrix.python }})'
45+
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ From source
8282

8383
To install from source::
8484

85+
pip install cython
8586
git clone https://github.com/oremanj/python-netfilterqueue
8687
cd python-netfilterqueue
8788
pip install .
8889

89-
If Cython is installed, Distutils will use it to regenerate the .c source from the .pyx. It will then compile the .c into a .so.
90-
9190
API
9291
===
9392

ci.sh

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,43 @@ set -ex -o pipefail
44

55
pip install -U pip setuptools wheel
66
sudo apt-get install libnetfilter-queue-dev
7+
78
python setup.py sdist --formats=zip
89
pip install dist/*.zip
9-
pip install -r test-requirements.txt
10+
11+
if python --version 2>&1 | fgrep -q "Python 2.7"; then
12+
# The testsuite doesn't run on 2.7, so do just a basic smoke test.
13+
unshare -Urn python -c "from netfilterqueue import NetfilterQueue as NFQ; NFQ()"
14+
exit $?
15+
fi
16+
17+
pip install -Ur test-requirements.txt
18+
19+
if [ "$CHECK_LINT" = "1" ]; then
20+
error=0
21+
if ! black --check setup.py tests; then
22+
cat <<EOF
23+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25+
26+
Formatting problems were found (listed above). To fix them, run
27+
28+
pip install -r test-requirements.txt
29+
black setup.py tests
30+
31+
in your local checkout.
32+
33+
EOF
34+
error=1
35+
fi
36+
if [ "$error" = "1" ]; then
37+
cat <<EOF
38+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40+
EOF
41+
fi
42+
exit $error
43+
fi
1044

1145
cd tests
1246
pytest -W error -ra -v .

0 commit comments

Comments
 (0)