Skip to content

Commit 69867f5

Browse files
authored
Clean up tox environments & run tox on Fedora in CI
* Add CFLAGS and -std=c90 runs to tox config * Add Python 3.10 to tox config * List the pypy3 tox environment * Remove mentions of Python 2 from docs & Makefile * Update Travis CI mention in setup.py * Add tox-fedora GH workflow #419
1 parent 9f9bc4c commit 69867f5

File tree

6 files changed

+53
-12
lines changed

6 files changed

+53
-12
lines changed

.github/workflows/tox-fedora.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on: [push, pull_request]
2+
3+
name: Tox on Fedora
4+
5+
jobs:
6+
tox_test:
7+
name: Tox env "${{matrix.tox_env}}" on Fedora
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Run Tox tests
11+
uses: fedora-python/tox-github-action@master
12+
with:
13+
tox_env: ${{ matrix.tox_env }}
14+
dnf_install: >
15+
@c-development openldap-devel python3-devel
16+
openldap-servers openldap-clients lcov clang-analyzer valgrind
17+
enchant
18+
strategy:
19+
matrix:
20+
tox_env:
21+
- py36
22+
- py37
23+
- py38
24+
- py39
25+
- py310
26+
- c90-py36
27+
- c90-py37
28+
- py3-nosasltls
29+
- py3-trace
30+
- pypy3
31+
- doc
32+
33+
# Use GitHub's Linux Docker host
34+
runs-on: ubuntu-latest

Doc/installing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Alpine
130130

131131
Packages for building::
132132

133-
# apk add build-base openldap-dev python2-dev python3-dev
133+
# apk add build-base openldap-dev python3-dev
134134

135135
CentOS
136136
------
@@ -145,12 +145,12 @@ Debian
145145

146146
Packages for building and testing::
147147

148-
# apt-get install build-essential python3-dev python2.7-dev \
148+
# apt-get install build-essential python3-dev \
149149
libldap2-dev libsasl2-dev slapd ldap-utils tox \
150150
lcov valgrind
151-
151+
152152
.. note::
153-
153+
154154
On older releases ``tox`` was called ``python-tox``.
155155

156156
Fedora
@@ -159,7 +159,7 @@ Fedora
159159
Packages for building and testing::
160160

161161
# dnf install "@C Development Tools and Libraries" openldap-devel \
162-
python2-devel python3-devel python3-tox \
162+
python3-devel python3-tox \
163163
lcov clang-analyzer valgrind
164164

165165
.. note::

Doc/sample_workflow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ This will run tests on all supported versions of Python that you have
6161
installed, skipping the ones you don't.
6262
To run a subset of test environments, run for example::
6363

64-
(__venv__)$ tox -e py27,py36
64+
(__venv__)$ tox -e py36,py39
6565

6666
In addition to ``pyXY`` environments, we have extra environments
6767
for checking things independent of the Python version:
6868

6969
* ``doc`` checks syntax and spelling of the documentation
7070
* ``coverage-report`` generates a test coverage report for Python code.
71-
It must be used last, e.g. ``tox -e py27,py36,coverage-report``.
72-
* ``py2-nosasltls`` and ``py3-nosasltls`` check functionality without
71+
It must be used last, e.g. ``tox -e py36,py39,coverage-report``.
72+
* ``py3-nosasltls`` check functionality without
7373
SASL and TLS bindings compiled in.
7474

7575

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ lcov-clean:
3535
if [ -d build ]; then find build -name '*.gc??' -delete; fi
3636

3737
lcov-coverage:
38-
WITH_GCOV=1 tox -e py27,py36
38+
WITH_GCOV=1 tox -e py36
3939

4040
$(LCOV_INFO): build
4141
lcov --capture --directory build --output-file $(LCOV_INFO)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class OpenLDAP2:
9090
'Programming Language :: Python :: 3.7',
9191
'Programming Language :: Python :: 3.8',
9292
'Programming Language :: Python :: 3.9',
93-
# Note: when updating Python versions, also change .travis.yml and tox.ini
93+
# Note: when updating Python versions, also change tox.ini and .github/workflows/*
9494

9595
'Topic :: Database',
9696
'Topic :: Internet',

tox.ini

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
# Note: when updating Python versions, also change setup.py and .travis.yml
8-
envlist = py36,py37,py38,py39,py3-nosasltls,doc,py3-trace
7+
# Note: when updating Python versions, also change setup.py and .github/worlflows/*
8+
envlist = py{36,37,38,39,310},c90-py{36,37},py3-nosasltls,doc,py3-trace,pypy3
99
minver = 1.8
1010

1111
[gh-actions]
@@ -21,6 +21,8 @@ deps =
2121
passenv = WITH_GCOV
2222
# - Enable BytesWarning
2323
# - Turn all warnings into exceptions.
24+
setenv =
25+
CFLAGS=-Wno-int-in-bool-context -Werror -Werror=declaration-after-statement -std=c99
2426
commands = {envpython} -bb -Werror \
2527
-m unittest discover -v -s Tests -p 't_*' {posargs}
2628

@@ -51,6 +53,11 @@ setenv =
5153
PYTHON_LDAP_TRACE_FILE={envtmpdir}/trace.log
5254
commands = {[testenv]commands}
5355

56+
[testenv:c90]
57+
setenv =
58+
CFLAGS=-Wno-int-in-bool-context -Werror -Werror=declaration-after-statement -std=c90
59+
commands = {envpython} -Werror -c "import ldap" # we just test compilation here
60+
5461
[testenv:macos]
5562
# Travis CI macOS image does not have slapd
5663
# SDK libldap does not support ldap_init_fd

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy