From owner-freebsd-python@freebsd.org Sat Sep 14 11:26:24 2019 Return-Path: Delivered-To: freebsd-python@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6D5DF15B9 for ; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46Vqvh5QThz3MJh for ; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B852DF15B8; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) Delivered-To: python@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B81A1F15B7 for ; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Vqvh4ThFz3MJg for ; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7955A1F0DA for ; Sat, 14 Sep 2019 11:26:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x8EBQOa3038969 for ; Sat, 14 Sep 2019 11:26:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x8EBQOcr038968 for python@FreeBSD.org; Sat, 14 Sep 2019 11:26:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: python@FreeBSD.org Subject: [Bug 240476] security/py-fido2: Add FreeBSD support Date: Sat, 14 Sep 2019 11:26:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: feature, needs-patch, needs-qa X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: grembo@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: python@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? merge-quarterly? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2019 11:26:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240476 --- Comment #16 from Michael Gmelin --- (In reply to Kubilay Kocak from comment #15) Hi Koobs, > A couple of leftovers: > - RUN_DEPENDS don't also need to be in TEST_DEPENDS > (uhid-freebsd) > - setup.py says uhid-freebsd>=3D1.2.1, RUN_DEPENDS > says >=3D1.0. *_DEPENDS should match upstream > requirements as closely as possible modulo any > syntax limitations we have (we cant foo!=3Dx.y > right now for example) I will change those. Interestingly I couldn't find any mention of that fact= in the porters handbook, also, this sounds like something that could be added = to `portlint' quite easily. Do we have any tooling for extracting such details from setup.py automatica= lly? > On the test suite with OS specific tests, > upstreams should always 'skip' these tests > if the environment isn't appropriate for > the test. pytest and nose have very easy=20 > decorators upstreams can use to do this > with various condition support) Yes, that is what the pytest change did using conftest.py, by excluding who= le files, as linux_test.py was incompatible on import (not just when running t= he tests) as pyfakefs was missing. > When test suites 'dont' skip inappropriate > tests, one can usually (with most unittest > frameworks), skip individual tests explicitly > in the test invocation. > For example with pytest you can > -k 'not ' and with nose you can > - > {xclude} My first attempt was to do that in `do-test', by running `pytest -k' on the tests directory and excluding those offending files, which worked okay. But running `setup.py test' seems cleaner (IMHO) as it will pick up more th= ings specific to the project and once it became clear that I'll aim to upstream = it, I wanted a solution that worked outside of the ports framework and allowed those who want to improve the library to start right away. Also, obviously the added FreeBSD unit tests shouldn't interfere with upstream's CI. Introducing pytest or nose to the project would've made that easier, but they had valid reasons not to do that. > With unittest (in Python > 3.1) you can > skipIf [1], i cant recall if there's > a command line arg for skipping tests. This is exactly what the patch that was upstreamed does - it uses @skipIf on the platform specific test case classes: @unittest.skipIf(not sys.platform.startswith('linux'), 'Linux specific test case') class LinuxTest(unittest.TestCase): That, plus an extra catch on importing pyfakefs that ignores the exception = if the file is imported on a platform !=3D Linux. try: from fakefs import fake_filesystem except ImportError: if sys.platform.startswith('linux'): raise Not as clean as excluding the file completely, but it works.=20 > Also, if the tests use 'unittest', > then the Python package should > probably tests_require on > "unittest2;python_version < 3" unittest2 is only required for versions of python < 2.7 in this project, so= it should be okay (poudriere on FreeBSD and Travis CI on Linux agree): if sys.version_info[:2] < (2, 7): import unittest2 as unittest # pylint: disable=3Dg-import-not-at-top else: import unittest So one more iteration to improve *_DEPENDS and we should be done for now :) --=20 You are receiving this mail because: You are the assignee for the bug.=