From nobody Thu Aug 19 00:41:34 2021
X-Original-To: python@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E95EB1774AE5;
	Thu, 19 Aug 2021 00:41:47 +0000 (UTC)
	(envelope-from koobs.freebsd@gmail.com)
Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4GqmDW0YS8z3mgJ;
	Thu, 19 Aug 2021 00:41:47 +0000 (UTC)
	(envelope-from koobs.freebsd@gmail.com)
Received: by mail-pj1-x1034.google.com with SMTP id w13-20020a17090aea0db029017897a5f7bcso3578007pjy.5;
        Wed, 18 Aug 2021 17:41:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=sender:message-id:date:mime-version:user-agent:reply-to:subject
         :content-language:to:references:from:cc:in-reply-to
         :content-transfer-encoding;
        bh=6fzRBDp8jQ0Y8RYbp+zqKdHp1LkGJSl73ExHJMWO5os=;
        b=echMOckyR7dLQxlbHioaaBpX9XY37nei3RY9nbv608dIzzejLwQ1dFQgQr1mQHb6Nk
         Sxz+YBMW1krDvP+tUOs/5J09qgvG3fQMdbgmtL4bXkuARaloP15VMacK7rABZTgLmtaB
         m9dWOH1JEuGUU3rkMIJ/NKpO7qZ/RAaz80EPpBZ4nFpBWD9QvcFMLNO9qjETE18lFAJc
         22xjcmVpAcyFN9z4d2pzFlTbNrY0aMyKCyQE+k8N2YROcJNpPcyu+XD5YV4fGZwYwN8/
         gkSFnFGPf0supetU6vsIk68GIaqRE2p84a0eJ2+tcpfRrRlFPDvf8ljhE1c0A0odxbVK
         xqFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
         :reply-to:subject:content-language:to:references:from:cc:in-reply-to
         :content-transfer-encoding;
        bh=6fzRBDp8jQ0Y8RYbp+zqKdHp1LkGJSl73ExHJMWO5os=;
        b=hnKZIXXaYMvyxv97k+U1qQSH1HumLUweXdns70qFjtDW2sgwIiplG4GxxvoNcG8QAZ
         ZXvXN+fk77uQpkeqTgwMR30kGxZbcoS7xG/0GwpQoYCactfQ1rIzcmuzm7JV/cd17cmD
         N6i5aGBtH2pRRK+MhvFCMDkWE8aT5iwI5g+T+balUKO1g3bJrkhXq60I9ElwARtJOEfp
         iP1TABQ5ED02FaQ2YXm2Ac/Zx0ncddriyGyMMEj0wyUWiTfHfxpDsfdN1x1mK5Azofx5
         D+VM++47c3pIAPOi0GLZBlACAH3i4zLAel+3mEO1avLZXLU05Hg3prhFUVX6kefBVE7T
         9uvQ==
X-Gm-Message-State: AOAM530cRvF6iLBu0ttD5gIqjPx7engvECFw9nU8EbxvkkGKZhMIpmvz
	gI0ph1s0Ab01h5hUBb3sNGHv8awAH+5B1w==
X-Google-Smtp-Source: ABdhPJyijXL6t9aN4huSCIlfLWpXktdWYzbMahIBUm7g9phTi90vQTv+zyTTvEQ6aOOxy/5cJVhQqQ==
X-Received: by 2002:a17:902:6a82:b029:12d:2431:94c1 with SMTP id n2-20020a1709026a82b029012d243194c1mr9527169plk.63.1629333699612;
        Wed, 18 Aug 2021 17:41:39 -0700 (PDT)
Received: from ?IPV6:2403:5800:7500:3601:95c2:edc2:9066:e894? (2403-5800-7500-3601-95c2-edc2-9066-e894.ip6.aussiebb.net. [2403:5800:7500:3601:95c2:edc2:9066:e894])
        by smtp.gmail.com with UTF8SMTPSA id c12sm936880pfl.56.2021.08.18.17.41.37
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Wed, 18 Aug 2021 17:41:39 -0700 (PDT)
Message-ID: <b82d1900-c124-f02c-72ab-95eeb502a616@FreeBSD.org>
Date: Thu, 19 Aug 2021 10:41:34 +1000
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-python
List-Help: <mailto:python+help@freebsd.org>
List-Post: <mailto:python@freebsd.org>
List-Subscribe: <mailto:python+subscribe@freebsd.org>
List-Unsubscribe: <mailto:python+unsubscribe@freebsd.org>
Sender: owner-freebsd-python@freebsd.org
X-BeenThere: freebsd-python@freebsd.org
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101
 Thunderbird/93.0a1
Reply-To: koobs@FreeBSD.org
Subject: Re: Is Python 3.7 supported? (py-uvicorn does not work)
Content-Language: en-US
To: Miroslav Lachman <000.fbsd@quip.cz>
References: <e9d88b7e-e733-3f1a-155b-7e975832865c@quip.cz>
From: Kubilay Kocak <koobs@FreeBSD.org>
Cc: python <python@FreeBSD.org>, freebsd-ports@freebsd.org,
 Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
In-Reply-To: <e9d88b7e-e733-3f1a-155b-7e975832865c@quip.cz>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 4GqmDW0YS8z3mgJ
X-Spamd-Bar: ---
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=gmail.com header.s=20161025 header.b=echMOcky;
	dmarc=none;
	spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::1034 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com
X-Spamd-Result: default: False [-3.20 / 15.00];
	 HAS_REPLYTO(0.00)[koobs@FreeBSD.org];
	 TO_DN_SOME(0.00)[];
	 R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c];
	 REPLYTO_ADDR_EQ_FROM(0.00)[];
	 RCVD_COUNT_THREE(0.00)[3];
	 DKIM_TRACE(0.00)[gmail.com:+];
	 NEURAL_HAM_SHORT(-1.00)[-0.997];
	 FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com];
	 RCVD_TLS_LAST(0.00)[];
	 MIME_TRACE(0.00)[0:+];
	 FREEMAIL_ENVFROM(0.00)[gmail.com];
	 MID_RHS_MATCH_FROM(0.00)[];
	 TAGGED_FROM(0.00)[];
	 DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
	 ARC_NA(0.00)[];
	 SUBJECT_HAS_QUESTION(0.00)[];
	 R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025];
	 FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com];
	 FROM_HAS_DN(0.00)[];
	 RCPT_COUNT_THREE(0.00)[4];
	 ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
	 NEURAL_HAM_LONG(-1.00)[-1.000];
	 MIME_GOOD(-0.10)[text/plain];
	 DMARC_NA(0.00)[FreeBSD.org];
	 NEURAL_HAM_MEDIUM(-1.00)[-1.000];
	 TO_MATCH_ENVRCPT_SOME(0.00)[];
	 RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1034:from]
X-ThisMailContainsUnwantedMimeParts: N

On 17/08/2021 9:56 am, Miroslav Lachman wrote:
> Hi,

Hi Miroslav,

If it's in tree then it's supported, in the sense that we accept issues 
for them and will endeavour to resolve reports.

Longer term, Python team will aim to move closer to tracking upstreams 
(CPython) definition of supported, which is essentially latest 
major.minor plus one minor version back (security and bugfixes).

> we are using Python 3.7 for hosted applications. New application 
> requires py-uvicorn so I built it in poudriere as usual. No errors. But 
> after installation on target machine uvicorn does not work spiting 
> following traceback:
> 
> Traceback (most recent call last):
>    File "/usr/local/bin/uvicorn", line 10, in <module>
>      from importlib.metadata import distribution
> ModuleNotFoundError: No module named 'importlib.metadata'

I couldn't see why/how uvicorn is using or calling importlib_metadata 
(it imports importlib, as the initial traceback line shows) in a cursory 
source review [1] . Something is transforming the import importlib call 
or falling back to importlib_metadata automatically for Python < 3.8, 
but I didn't investigate or isolate what.

Are all ports completely up to date with respect to latest versions in 
the tree?

> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>    File "/usr/local/bin/uvicorn", line 13, in <module>
>      from importlib_metadata import distribution
> ModuleNotFoundError: No module named 'importlib_metadata'
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>    File "/usr/local/bin/uvicorn", line 15, in <module>
>      from pkg_resources import load_entry_point
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 3242, in <module>
>      @_call_aside
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 3226, in _call_aside
>      f(*args, **kwargs)
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 3255, in _initialize_master_working_set
>      working_set = WorkingSet._build_master()
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 568, in _build_master
>      ws.require(__requires__)
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 886, in require
>      needed = self.resolve(parse_requirements(requirements))
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 772, in resolve
>      raise DistributionNotFound(req, requirers)
> pkg_resources.DistributionNotFound: The 'asgiref>=3.3.4' distribution 
> was not found and is required by uvicorn

But at a minimum it looks like the port is missing a RUN_DEPENDS on 
asgiref [2]

Maintainer is CC'd

> 
> 
> OK, py-importlib-metadata is probably missing so I tried to build it in 
> poudriere but it failed in configure stage with the following error:
> 
> ===>   py37-zipp-3.4.0 depends on package: py37-setuptools_scm>0 - found
> ===>   Returning to build of py37-zipp-3.4.0
> ===>   py37-zipp-3.4.0 depends on package: py37-setuptools>0 - found
> ===>   py37-zipp-3.4.0 depends on file: /usr/local/bin/python3.7 - found
> ===========================================================================
> =======================<phase: lib-depends    >============================
> ===========================================================================
> =======================<phase: configure      >============================
> ===>  Configuring for py37-zipp-3.4.0
> WARNING: The wheel package is not available.
> /usr/local/bin/python3.7: No module named pip
> Traceback (most recent call last):
>    File 
> "/usr/local/lib/python3.7/site-packages/setuptools/installer.py", line 
> 75, in fetch_build_egg
>      subprocess.check_call(cmd)
>    File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call
>      raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['/usr/local/bin/python3.7', 
> '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 
> '/tmp/tmpllmb234s', '--quiet', 'toml']' returned non-zero exit status 1.
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>    File "<string>", line 1, in <module>
>    File "setup.py", line 6, in <module>
>      setuptools.setup()
>    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", 
> line 152, in setup
>      _install_setup_requires(attrs)
>    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", 
> line 147, in _install_setup_requires
>      dist.fetch_build_eggs(dist.setup_requires)
>    File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", 
> line 782, in fetch_build_eggs
>      replace_conflicting=True,
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 768, in resolve
>      replace_conflicting=replace_conflicting
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 1051, in best_match
>      return self.obtain(req, installer)
>    File 
> "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 
> 1063, in obtain
>      return installer(requirement)
>    File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", 
> line 838, in fetch_build_egg
>      return fetch_build_egg(self, req)
>    File 
> "/usr/local/lib/python3.7/site-packages/setuptools/installer.py", line 
> 77, in fetch_build_egg
>      raise DistutilsError(str(e)) from e
> distutils.errors.DistutilsError: Command '['/usr/local/bin/python3.7', 
> '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 
> '/tmp/tmpllmb234s', '--quiet', 'toml']' returned non-zero exit status 1.
> *** Error code 1


This is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256872

Workaround, manually install py-toml or enable TOML option in 
setuptools_scm port options (which is disabled, causing this issue).

Reach out in #freebsd-python on Libera IRC if you need further help or 
have questions.

./koobs

[1] https://github.com/encode/uvicorn/search?q=importlib
[2] https://github.com/encode/uvicorn/blob/0.14.0/setup.py#L47


> Stop.
> make: stopped in /usr/ports/devel/py-zipp
> =>> Cleaning up wrkdir
> ===>  Cleaning for py37-zipp-3.4.0
> build of devel/py-zipp | py37-zipp-3.4.0 ended at Tue Aug 17 01:46:11 
> CEST 2021
> build time: 00:00:10
> !!! build failure encountered !!!
> 
> 
> Poudriere builder and the target machine are both FreeBSD 12.2 amd64.
> 
> Options in Poudriere are
> OPTIONS_UNSET= X11 GUI CUPS DOCS EXAMPLES NLS HAL
> DEFAULT_VERSIONS=apache=2.4 perl5=5.32 mysql=10.3m php=7.4 python=3.7 
> python3=3.7 pgsql=12 bdb=5
> 
> 
> Kind regards
> Miroslav Lachman
>