From 1976f1acdd99a1f904b77d6a90e49bcd74bc587f Mon Sep 17 00:00:00 2001 From: Philipp Albrecht Date: Sun, 23 Jul 2023 18:04:31 +0200 Subject: Add package job to tox.ini This is still *very* basic, but it serves its purpose of failing for warnings during package build. I verified that `tox -e package` is failing by introducing some warnings with this change: ```diff diff --git a/setup.py b/setup.py index feb949595..6810eaf1e 100755 --- a/setup.py +++ b/setup.py @@ -51,8 +51,7 @@ def _get_constant(name): try: common.write_git_file() setuptools.setup( - packages=setuptools.find_namespace_packages(include=['qutebrowser', - 'qutebrowser.*']), + packages=setuptools.find_namespace_packages(include=['qutebrowser']), include_package_data=True, entry_points={'gui_scripts': ['qutebrowser = qutebrowser.qutebrowser:main']}, ``` --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tox.ini b/tox.ini index 7616cac38..83cf8fb1d 100644 --- a/tox.ini +++ b/tox.ini @@ -280,3 +280,13 @@ deps = commands = !qt5: {envpython} {toxinidir}/scripts/dev/build_release.py {posargs} qt5: {envpython} {toxinidir}/scripts/dev/build_release.py --qt5 {posargs} + +[testenv:package] +basepython = {env:PYTHON:python3} +setenv = + PYTHONWARNINGS=error + VIRTUALENV_PIP=23.2 +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/misc/requirements/requirements-dev.txt +commands = {envpython} -m build -- cgit v1.2.3-54-g00ecf From 7d445e6617db061a5755561ea1023c09bcb3ee77 Mon Sep 17 00:00:00 2001 From: Philipp Albrecht Date: Mon, 24 Jul 2023 13:20:17 +0200 Subject: Add CI job for package build We want to run a package build in CI with warnings turned into exceptions, in order to catch issues in CI (e.g. DeprecationWarning). --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1612a4eb..14d642491 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: args: "-f gcc" # For problem matchers - testenv: yamllint - testenv: actionlint + - testenv: package steps: - uses: actions/checkout@v3 with: -- cgit v1.2.3-54-g00ecf From e20bba8d91ffe450a855e4e75612bc6683327a36 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 25 Jul 2023 16:26:37 +0200 Subject: Don't fail on weird pip warning We got a `DeprecationWarning` during the package build, which we were not able to reproduce locally. For now we just don't turn this particular `DeprecationWarning` into an exception to not fail CI. --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 83cf8fb1d..4f5bd56e7 100644 --- a/tox.ini +++ b/tox.ini @@ -284,8 +284,7 @@ commands = [testenv:package] basepython = {env:PYTHON:python3} setenv = - PYTHONWARNINGS=error - VIRTUALENV_PIP=23.2 + PYTHONWARNINGS=error,default:pkg_resources is deprecated as an API.:DeprecationWarning deps = -r{toxinidir}/requirements.txt -r{toxinidir}/misc/requirements/requirements-dev.txt -- cgit v1.2.3-54-g00ecf