You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using 'installer` module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pdfminer-20221105-7.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pdfminer-20221105-7.fc35.x86_64/usr/lib/python3.8/site-packages+ /usr/bin/pytest -ra -m 'not network'==================================================================================== test session starts ====================================================================================platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)rootdir: /home/tkloczko/rpmbuild/BUILD/pdfminer.six-20221105plugins: hypothesis-6.75.3, benchmark-4.0.0, timeout-2.1.0collected 118 items / 2 errors========================================================================================== ERRORS ===========================================================================================_______________________________________________________________________ ERROR collecting tests/test_tools_dumppdf.py ________________________________________________________________________ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pdfminer.six-20221105/tests/test_tools_dumppdf.py'.Hint: make sure your test modules/packages have valid Python names.Traceback:/usr/lib64/python3.8/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level)tests/test_tools_dumppdf.py:7: in <module> from tools import dumppdfE ModuleNotFoundError: No module named 'tools'_______________________________________________________________________ ERROR collecting tests/test_tools_pdf2txt.py ________________________________________________________________________ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pdfminer.six-20221105/tests/test_tools_pdf2txt.py'.Hint: make sure your test modules/packages have valid Python names.Traceback:/usr/lib64/python3.8/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level)tests/test_tools_pdf2txt.py:6: in <module> import tools.pdf2txt as pdf2txtE ModuleNotFoundError: No module named 'tools'================================================================================== short test summary info ==================================================================================ERROR tests/test_tools_dumppdf.pyERROR tests/test_tools_pdf2txt.py!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!===================================================================================== 2 errors in 0.37s =====================================================================================
Probably the best solution here is to move everything except the entrypoint into the pdfminer package. And then only test things from the pdfminer package.
Another solution is to call pdf2txt in a subprocess. And not import pdf2txt from the tools directory solely to parse the arguments.
The tools directory/package has been around for a long time so people probably depend on it. But we can make it as slim as possible.
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolationbuildwith--no-isolationI'm using during all processes only locally installed modulescut off from access to the public network(pytest is executed with-m "not network")Here is pytest output:
Here is list of installed modules in build env
The text was updated successfully, but these errors were encountered: