Package Details: python-flake8-pyproject 1.2.3-3

Git Clone URL: https://aur.archlinux.org/python-flake8-pyproject.git (read-only, click to copy)
Package Base: python-flake8-pyproject
Description: Flake8 plug-in loading the configuration from pyproject.toml
Upstream URL: https://github.com/john-hen/Flake8-pyproject
Licenses: MIT
Submitter: wjhandley
Maintainer: wjhandley
Last Packager: wjhandley
Votes: 0
Popularity: 0.000000
First Submitted: 2023-09-06 09:28 (UTC)
Last Updated: 2024-10-08 16:17 (UTC)

Latest Comments

gesh commented on 2024-12-23 14:43 (UTC) (edited on 2024-12-23 14:43 (UTC) by gesh)

Note: Package needs to be rebuilt for Python 3.13 (a bump to pkgrel suffices)

gesh commented on 2024-10-08 13:30 (UTC) (edited on 2024-10-08 13:34 (UTC) by gesh)

You must've missed my correction that python-wheel is indeed unnecessary -- since we use flit-core as a build backend, there's no need for it.

Further, as @bcb noted, the only use of python-tomli is guarded behind a check for python >=3.11. That version has been out for two years now, I don't think that we need to keep support for older version in the PKGBUILD. (It's a matter of taste whether to also include python explicitly as a dependency, up to you)

Finally, attached is a patch enabling the integration testsuite -- in general, it's good practice to run whatever reasonable testsuites upstream provides.

diff --git a/PKGBUILD b/PKGBUILD
index b141715..18d04c2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,6 +9,7 @@ url="https://github.com/john-hen/${_name}"
 license=('MIT')
 groups=()
 depends=(flake8 python-tomli python-wheel)
+checkdepends=(python-pytest python-pytest-cov)
 makedepends=(python-build python-installer python-flit-core)
 provides=()
 conflicts=()
@@ -22,6 +23,17 @@ sha256sums=(8f065721c53c1fe22d423d82db99eef6559b463a8701aa03b03668d43abfc851)
 build() {
     cd "$srcdir/$_name-$pkgver"
     python -m build --wheel --no-isolation
+    python -m installer --destdir=tmp_test_install dist/*.whl
+}
+
+check() {
+    cd "$srcdir/$_src_folder"
+
+    local site_packages=$(python -c 'import site; print(site.getsitepackages()[0])')
+    export PYTHONPATH="$PWD/tmp_test_install/${site_packages}:$PYTHONPATH"
+    export PATH="$PWD/tmp_test_install/usr/bin/:$PATH"
+
+    python -m pytest
 }

 package() {

gesh commented on 2024-09-30 13:13 (UTC) (edited on 2024-09-30 15:55 (UTC) by gesh)

Thanks for packaging! Some further comments:

  • PEP517 builds need python-wheel as a dependency as well TIL that's only true of projects using setuptools as a backend.
  • Trying to build this with flake8-1:7.1.1-1 and python-pycodestyle-2.11.1-2 fails -- I needed to manually bump python-pycodestyle to 2.12.1 for the dependency check of python -m build to pass.
  • It wouldn't be a bad idea to run the test suite as well in check() (this means adding python-pytest{,-cov} to checkdepends). ATM, though, I am getting test failures, though:
=========================== short test summary info ============================
FAILED tests/test_integration.py::test_config_pyproject[flake8] - assert "mod...
FAILED tests/test_integration.py::test_config_pyproject[flake8p] - FileNotFou...
FAILED tests/test_integration.py::test_config_flake8[flake8p] - FileNotFoundE...
FAILED tests/test_integration.py::test_config_setup[flake8p] - FileNotFoundEr...
FAILED tests/test_integration.py::test_config_tox[flake8p] - FileNotFoundErro...
FAILED tests/test_integration.py::test_config_mixed[flake8] - assert "module....
FAILED tests/test_integration.py::test_config_mixed[flake8p] - FileNotFoundEr...
FAILED tests/test_integration.py::test_config_toml[flake8] - AssertionError: ...
FAILED tests/test_integration.py::test_config_toml[flake8p] - FileNotFoundErr...
FAILED tests/test_integration.py::test_empty_folder[flake8p] - FileNotFoundEr...
FAILED tests/test_integration.py::test_empty_pyproject[flake8p] - FileNotFoun...
FAILED tests/test_integration.py::test_empty_tool_section[flake8p] - FileNotF...
FAILED tests/test_integration.py::test_run_main[flake8] - assert "module.py:3...
FAILED tests/test_integration.py::test_run_main[flake8p] - AssertionError: as...
========================= 14 failed, 6 passed in 1.81s =========================

EDIT: The build failures are only when I build in a clean chroot -- if I build with a simple makepkg everything works.

bcb commented on 2023-11-28 14:18 (UTC)

Thanks for packaging! Two comments:

  • python-tomli is not required -- it is only used for older versions of Python which do not have the standard tomllib library

  • python-flit-core needs to be in makedepends