Skip to content
Commits on Source (44)
image: registry.gitlab.gnome.org/gnome/pygobject/main:v13
image: registry.gitlab.gnome.org/gnome/pygobject/main:v15
stages:
- build_and_test
......@@ -25,6 +25,7 @@ cache:
paths:
- coverage/
script:
- $env:CHERE_INVOKING = 'yes'
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
......@@ -34,7 +35,7 @@ coverage:
paths:
- coverage/
variables:
PYENV_VERSION: "3.6.10"
PYENV_VERSION: "3.6.12"
script:
- bash -x ./.gitlab-ci/coverage-docker.sh
......@@ -51,49 +52,45 @@ pages:
only:
- master
python3-mingw32:
mingw32:
variables:
PYTHON: "python3"
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
<<: *mingw-defaults
python3-mingw64:
mingw64:
variables:
PYTHON: "python3"
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
<<: *mingw-defaults
python3.5:
variables:
PYENV_VERSION: "3.5.9"
<<: *defaults
python3.6:
variables:
PYENV_VERSION: "3.6.10"
PYENV_VERSION: "3.6.12"
<<: *defaults
python3.7:
variables:
PYENV_VERSION: "3.7.6-debug"
PYENV_VERSION: "3.7.9-debug"
<<: *defaults
python3.8:
variables:
PYENV_VERSION: "3.8.1-debug"
PYENV_VERSION: "3.8.5-debug"
<<: *defaults
python3.9:
variables:
PYENV_VERSION: "3.9.0-debug"
<<: *defaults
pypy3.6:
allow_failure: true
variables:
PYENV_VERSION: "pypy3.6-7.3.0"
PYENV_VERSION: "pypy3.6-7.3.1"
<<: *defaults
xenial-i386-py3:
old-i386-py3:
stage: build_and_test
image: registry.gitlab.gnome.org/gnome/pygobject/old:v3
image: registry.gitlab.gnome.org/gnome/pygobject/old:v4
artifacts:
paths:
- coverage/
......
FROM ubuntu:cosmic
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
......@@ -39,12 +41,10 @@ ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
RUN pyenv install pypy2.7-7.3.0
RUN pyenv install pypy3.6-7.3.0
RUN pyenv install --debug 2.7.17
RUN pyenv install 3.5.9
RUN pyenv install 3.6.10
RUN pyenv install --debug 3.7.6
RUN pyenv install --debug 3.8.1
RUN pyenv install pypy3.6-7.3.1
RUN pyenv install 3.6.12
RUN pyenv install --debug 3.7.9
RUN pyenv install --debug 3.8.5
RUN pyenv install --debug 3.9.0
ENV PATH="/usr/lib/ccache:${PATH}"
FROM i386/ubuntu:xenial
FROM i386/ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
autoconf-archive \
......
......@@ -10,13 +10,16 @@ python ./.gitlab-ci/fixup-covpy-paths.py coverage/.coverage*
# Remove external headers (except gi tests)
for path in coverage/*.lcov; do
lcov --rc lcov_branch_coverage=1 -r "${path}" '/usr/include/*' -o "${path}"
lcov --rc lcov_branch_coverage=1 -r "${path}" '/home/*' -o "${path}"
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '/usr/include/*' -o "${path}"
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '/home/*' -o "${path}"
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '*/msys64/*' -o "${path}"
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '*subprojects/*' -o "${path}"
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '*tmp-introspect*' -o "${path}"
done
python -m coverage combine coverage
python -m coverage html --show-contexts --ignore-errors -d coverage/report-python
genhtml --ignore-errors=source --rc lcov_branch_coverage=1 \
genhtml --ignore-errors=source --config-file .gitlab-ci/lcovrc \
coverage/*.lcov -o coverage/report-c
cd coverage
......
from __future__ import print_function
import sys
import os
import io
import re
def main(argv):
# Fix paths in coverage files to match our current source layout
# so that coverage report generators can find the source.
# Mostly needed for Windows.
# Fix paths in lcov files generated on a Windows host so they match our
# current source layout.
paths = argv[1:]
for path in paths:
print("cov-fixup:", path)
text = io.open(path, "r", encoding="utf-8").read()
text = text.replace("\\\\", "/")
end = text.index("/gi/")
try:
# coverage.py
start = text[:end].rindex("\"") + 1
except ValueError:
# lcov
start = text[:end].rindex(":") + 1
old_root = text[start:end]
new_root = os.getcwd()
if old_root != new_root:
print("replacing %r with %r" % (old_root, new_root))
text = text.replace(old_root, new_root)
with io.open(path, "w", encoding="utf-8") as h:
h.write(text)
for old_root in set(re.findall(":(.*?)/gi/.*?$", text, re.MULTILINE)):
if old_root != new_root:
print("replacing %r with %r" % (old_root, new_root))
text = text.replace(old_root, new_root)
with io.open(path, "w", encoding="utf-8") as h:
h.write(text)
if __name__ == "__main__":
......
# lcov and genhtml configuration
# See http://ltp.sourceforge.net/coverage/lcov/lcovrc.5.php
# Always enable branch coverage
lcov_branch_coverage = 1
# Exclude precondition assertions, as we can never reasonably get full branch
# coverage of them, as they should never normally fail.
# See https://github.com/linux-test-project/lcov/issues/44
lcov_excl_br_line = LCOV_EXCL_BR_LINE|g_return_if_fail|g_return_val_if_fail|g_assert|g_assert_
# Similarly for unreachable assertions.
lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_assert_not_reached
......@@ -2,7 +2,7 @@
set -e
TAG="registry.gitlab.gnome.org/gnome/pygobject/old:v3"
TAG="registry.gitlab.gnome.org/gnome/pygobject/old:v4"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile.old" .
......
......@@ -2,10 +2,10 @@
set -e
TAG="registry.gitlab.gnome.org/gnome/pygobject/main:v13"
TAG="registry.gitlab.gnome.org/gnome/pygobject/main:v15"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
sudo docker run -e PYENV_VERSION='3.8.1-debug' --rm --security-opt label=disable \
sudo docker run -e PYENV_VERSION='3.8.5-debug' --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
......@@ -47,8 +47,12 @@ fi;
# BUILD & TEST AGAIN USING SETUP.PY
python setup.py build_tests
lcov --config-file .gitlab-ci/lcovrc --directory . --capture --initial --output-file \
"${COV_DIR}/${CI_JOB_NAME}-baseline.lcov"
xvfb-run -a python -m coverage run --context "${COV_KEY}" tests/runtests.py
# COLLECT GCOV COVERAGE
lcov --rc lcov_branch_coverage=1 --directory . --capture --output-file \
lcov --config-file .gitlab-ci/lcovrc --directory . --capture --output-file \
"${COV_DIR}/${CI_JOB_NAME}.lcov"
......@@ -2,34 +2,22 @@
set -e
# skip the fontconfig cache, it's slooowww
export MSYS2_FC_CACHE_SKIP=1
export PANGOCAIRO_BACKEND=win32
export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export MSYS2_ARCH="i686"
else
export MSYS2_ARCH="x86_64"
fi
pacman --noconfirm -Suy
pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-$PYTHON-cairo \
mingw-w64-$MSYS2_ARCH-$PYTHON \
mingw-w64-$MSYS2_ARCH-$PYTHON-pip \
mingw-w64-$MSYS2_ARCH-$PYTHON-pytest \
mingw-w64-$MSYS2_ARCH-$PYTHON-coverage \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-libffi \
mingw-w64-$MSYS2_ARCH-glib2 \
mingw-w64-$MSYS2_ARCH-gtk3 \
"${MINGW_PACKAGE_PREFIX}"-ccache \
"${MINGW_PACKAGE_PREFIX}"-glib2 \
"${MINGW_PACKAGE_PREFIX}"-gobject-introspection \
"${MINGW_PACKAGE_PREFIX}"-gtk3 \
"${MINGW_PACKAGE_PREFIX}"-libffi \
"${MINGW_PACKAGE_PREFIX}"-python \
"${MINGW_PACKAGE_PREFIX}"-python-cairo \
"${MINGW_PACKAGE_PREFIX}"-python-coverage \
"${MINGW_PACKAGE_PREFIX}"-python-pip \
"${MINGW_PACKAGE_PREFIX}"-python-pytest \
"${MINGW_PACKAGE_PREFIX}"-toolchain \
git \
perl
lcov
# ccache setup
export PATH="$MSYSTEM/lib/ccache/bin:$PATH"
......@@ -39,23 +27,25 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# coverage setup
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs -Werror"
PYVER=$($PYTHON -c "import sys; sys.stdout.write(''.join(map(str, sys.version_info[:3])))")
COV_DIR="$(pwd)/coverage"
COV_KEY="${MSYSTEM}.${PYVER}"
COV_KEY="${CI_JOB_NAME}"
mkdir -p "${COV_DIR}"
export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDEVMODE
export PYTHONDEVMODE=1
$PYTHON setup.py build_tests
MSYSTEM= $PYTHON -m coverage run --context "${COV_KEY}" tests/runtests.py
python setup.py build_tests
lcov \
--config-file .gitlab-ci/lcovrc \
--directory "$(pwd)" \
--capture --initial --output-file \
"${COV_DIR}/${COV_KEY}-baseline.lcov"
# FIXME: lcov doesn't support gcc9
#~ curl -O -J -L "https://github.com/linux-test-project/lcov/archive/master.tar.gz"
#~ tar -xvzf lcov-master.tar.gz
MSYSTEM= python -m coverage run --context "${COV_KEY}" tests/runtests.py
#~ ./lcov-master/bin/lcov \
#~ --rc lcov_branch_coverage=1 --no-external \
#~ --directory . --capture --output-file \
#~ "${COV_DIR}/${COV_KEY}.lcov"
lcov \
--config-file .gitlab-ci/lcovrc \
--directory "$(pwd)" --capture --output-file \
"${COV_DIR}/${COV_KEY}.lcov"
......@@ -14,5 +14,5 @@ recursive-include examples *.py *.png *.css *.ui *.gif *.gresource *.jpg *.xml
recursive-include gi *.h meson.build
recursive-include tests *.py *.c *.h *.xml *.supp meson.build
recursive-include docs *.rst *.svg LICENSE *.ico *.png *.css *.py *.dia Makefile
recursive-include .gitlab-ci *.sh *.rst *.py Dockerfile*
recursive-include .gitlab-ci *.sh *.rst *.py Dockerfile* lcovrc
recursive-include pygtkcompat meson.build
3.40.1 - 2021-03-30
-------------------
* Fix tests with glib 2.68 :mr:`166`
* Fix a regression with marshalling partial() objects :mr:`165` :issue:`464`
3.40.0 - 2021-03-19
-------------------
* GTK 4 compatibility fixes :mr:`148` :mr:`159` :mr:`144` :mr:`145`
* Python 3.9 and 3.10 compatibility fixes :mr:`152` :mr:`156`
* New minimal dependency requirements due to dropping support for Ubuntu 16.04 :mr:`151`
* Python 3.6+
* glib 2.56+
* gobject-introspection 1.56+
* pycairo 1.16+
3.38.0 - 2020-09-12
-------------------
......
Metadata-Version: 1.2
Name: PyGObject
Version: 3.38.0
Version: 3.40.1
Summary: Python bindings for GObject Introspection
Home-page: https://pygobject.readthedocs.io
Author: James Henstridge
......@@ -22,7 +22,7 @@ Description: .. image:: https://pygobject.readthedocs.io/en/latest/_images/pygob
<https://developer.gnome.org/glib/stable/>`__, `GIO
<https://developer.gnome.org/gio/stable/>`__ and many more.
It supports Linux, Windows and macOS and works with **Python 3.5+** and
It supports Linux, Windows and macOS and works with **Python 3.6+** and
**PyPy3**. PyGObject, including this documentation, is licensed under the
**LGPLv2.1+**.
......@@ -40,4 +40,4 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.5, <4
Requires-Python: >=3.6, <4
......@@ -18,4 +18,4 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.5, <4
Requires-Python: >=3.6, <4
Metadata-Version: 1.2
Name: PyGObject
Version: 3.38.0
Version: 3.40.1
Summary: Python bindings for GObject Introspection
Home-page: https://pygobject.readthedocs.io
Author: James Henstridge
......@@ -22,7 +22,7 @@ Description: .. image:: https://pygobject.readthedocs.io/en/latest/_images/pygob
<https://developer.gnome.org/glib/stable/>`__, `GIO
<https://developer.gnome.org/gio/stable/>`__ and many more.
It supports Linux, Windows and macOS and works with **Python 3.5+** and
It supports Linux, Windows and macOS and works with **Python 3.6+** and
**PyPy3**. PyGObject, including this documentation, is licensed under the
**LGPLv2.1+**.
......@@ -40,4 +40,4 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.5, <4
Requires-Python: >=3.6, <4
......@@ -17,6 +17,7 @@ setup.py
.gitlab-ci/coverage-docker.sh
.gitlab-ci/fixup-covpy-paths.py
.gitlab-ci/fixup-lcov-paths.py
.gitlab-ci/lcovrc
.gitlab-ci/run-docker-old.sh
.gitlab-ci/run-docker-runtime.sh
.gitlab-ci/run-docker.sh
......
......@@ -12,7 +12,7 @@
<https://developer.gnome.org/glib/stable/>`__, `GIO
<https://developer.gnome.org/gio/stable/>`__ and many more.
It supports Linux, Windows and macOS and works with **Python 3.5+** and
It supports Linux, Windows and macOS and works with **Python 3.6+** and
**PyPy3**. PyGObject, including this documentation, is licensed under the
**LGPLv2.1+**.
......
......@@ -77,10 +77,12 @@ Who Is Using PyGObject?
* `Lollypop <https://wiki.gnome.org/Apps/Lollypop>`__ - a modern music player
* `Meld <http://meldmerge.org/>`__ - a visual diff and merge tool
* `MyPaint <http://mypaint.org/>`__ - a nimble, distraction-free, and easy tool for digital painters
* `Nicotine+ <https://nicotine-plus.org/>`__ - a graphical client for the Soulseek file sharing network
* `Orca <https://wiki.gnome.org/Projects/Orca>`__ - a flexible and extensible screen reader
* `Pithos <https://pithos.github.io/>`__ - a Pandora Radio client
* `Pitivi <http://www.pitivi.org/>`__ - a free and open source video editor
* `Quod Libet <https://quodlibet.readthedocs.io/>`__ - a music library manager / player
* `Terminator <https://gnome-terminator.org/>` -- The Robot Future of Terminals
* `Transmageddon <http://www.linuxrising.org/>`__ - a video transcoder
......
......@@ -25,6 +25,13 @@ import os
import sys
import textwrap
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Pango', '1.0')
gi.require_version('PangoCairo', '1.0')
gi.require_version('GdkPixbuf', '2.0')
gi.require_version('GtkSource', '4')
from gi.repository import GLib, GObject, Pango, GdkPixbuf, Gtk, Gio
try:
......