Is Python 3.7 supported? (py-uvicorn does not work)

From: Miroslav Lachman <000.fbsd_at_quip.cz>
Date: Mon, 16 Aug 2021 23:56:32 UTC
Hi,

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'

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



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

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