Skip to content

Clean up tox environments & run tox on Fedora in CI #419

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

Merged
merged 6 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/tox-fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on: [push, pull_request]

name: Tox on Fedora

jobs:
tox_test:
name: Tox env "${{matrix.tox_env}}" on Fedora
steps:
- uses: actions/checkout@v2
- name: Run Tox tests
uses: fedora-python/tox-github-action@master
with:
tox_env: ${{ matrix.tox_env }}
dnf_install: >
@c-development openldap-devel python3-devel
openldap-servers openldap-clients lcov clang-analyzer valgrind
enchant
strategy:
matrix:
tox_env:
- py36
- py37
- py38
- py39
- py310
- c90-py36
- c90-py37
- py3-nosasltls
- py3-trace
- pypy3
- doc

# Use GitHub's Linux Docker host
runs-on: ubuntu-latest
10 changes: 5 additions & 5 deletions Doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Alpine

Packages for building::

# apk add build-base openldap-dev python2-dev python3-dev
# apk add build-base openldap-dev python3-dev

CentOS
------
Expand All @@ -145,12 +145,12 @@ Debian

Packages for building and testing::

# apt-get install build-essential python3-dev python2.7-dev \
# apt-get install build-essential python3-dev \
libldap2-dev libsasl2-dev slapd ldap-utils tox \
lcov valgrind

.. note::

On older releases ``tox`` was called ``python-tox``.

Fedora
Expand All @@ -159,7 +159,7 @@ Fedora
Packages for building and testing::

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

.. note::
Expand Down
6 changes: 3 additions & 3 deletions Doc/sample_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ This will run tests on all supported versions of Python that you have
installed, skipping the ones you don't.
To run a subset of test environments, run for example::

(__venv__)$ tox -e py27,py36
(__venv__)$ tox -e py36,py39

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

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


Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ lcov-clean:
if [ -d build ]; then find build -name '*.gc??' -delete; fi

lcov-coverage:
WITH_GCOV=1 tox -e py27,py36
WITH_GCOV=1 tox -e py36

$(LCOV_INFO): build
lcov --capture --directory build --output-file $(LCOV_INFO)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class OpenLDAP2:
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
# Note: when updating Python versions, also change .travis.yml and tox.ini
# Note: when updating Python versions, also change tox.ini and .github/workflows/*

'Topic :: Database',
'Topic :: Internet',
Expand Down
11 changes: 9 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# and then run "tox" from this directory.

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

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

Expand Down Expand Up @@ -51,6 +53,11 @@ setenv =
PYTHON_LDAP_TRACE_FILE={envtmpdir}/trace.log
commands = {[testenv]commands}

[testenv:c90]
setenv =
CFLAGS=-Wno-int-in-bool-context -Werror -Werror=declaration-after-statement -std=c90
commands = {envpython} -Werror -c "import ldap" # we just test compilation here

[testenv:macos]
# Travis CI macOS image does not have slapd
# SDK libldap does not support ldap_init_fd
Expand Down