openSUSE / py2pack

Generate distribution packages from PyPI
Apache License 2.0
69 stars 40 forks source link

0.8.6: fails on generate yagot #146

Closed kloczek closed 3 years ago

kloczek commented 3 years ago
[tkloczko@barrel SPECS]$ py2pack fetch yagot
downloading package yagot-0.5.0...
from https://files.pythonhosted.org/packages/source/y/yagot/yagot-0.5.0.tar.gz
[tkloczko@barrel SPECS]$ py2pack generate yagot
generating spec file for yagot...
Traceback (most recent call last):
  File "setup.py", line 55, in <module>
    requirements = get_requirements('requirements.txt')
  File "setup.py", line 35, in get_requirements
    with open(requirements_file, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/metaextract/utils.py", line 105, in _setup_py_run_from_dir
    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
  File "/usr/lib64/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '/usr/bin/python3 setup.py -q --command-packages metaextract metaextract -o /tmp/tmpwa48st2y ' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/py2pack", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/py2pack/__init__.py", line 365, in main
    args.func(args)
  File "/usr/lib/python3.8/site-packages/py2pack/__init__.py", line 254, in generate
    _augment_data_from_tarball(args, tarball_file[0], data)
  File "/usr/lib/python3.8/site-packages/py2pack/__init__.py", line 162, in _augment_data_from_tarball
    data_archive = meta_utils.from_archive(filename)
  File "/usr/lib/python3.8/site-packages/metaextract/utils.py", line 134, in from_archive
    data = _setup_py_run_from_dir(root_dir, py_interpreter)
  File "/usr/lib/python3.8/site-packages/metaextract/utils.py", line 109, in _setup_py_run_from_dir
    subprocess.check_output(cmd, shell=True)
  File "/usr/lib64/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '/usr/bin/python3 setup.py -q --command-packages metaextract metaextract -o /tmp/tmpwa48st2y ' returned non-zero exit status 1.
toabctl commented 3 years ago

This is not a py2pack issue. yagot does not include the requirements.txt file in its sdist tarball. Try to install it (in a venv) with:

$ pip install -e . ~/Downloads/yagot-0.5.0.tar.gz 
Processing /home/tom/Downloads/yagot-0.5.0.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /home/tom/devel/metaextract/.tox/py39/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-xwp4a8va/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-xwp4a8va/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-38mlpr2b
         cwd: /tmp/pip-req-build-xwp4a8va/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-xwp4a8va/setup.py", line 54, in <module>
        requirements = get_requirements('requirements.txt')
      File "/tmp/pip-req-build-xwp4a8va/setup.py", line 34, in get_requirements
        with open(requirements_file, 'r') as fp:
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

Please fill a bug against yagot.

kloczek commented 3 years ago

Yep done that https://github.com/andy-maier/python-yagot/issues/55 Thx