confluentinc / confluent-docker-utils

Common Python utils for testing Confluent's Docker images
Apache License 2.0
2 stars 0 forks source link

`python3 setup.py sdist` does not create an installable archive #84

Open 0xDEC0DE opened 1 month ago

0xDEC0DE commented 1 month ago

Steps to reproduce

curl -fLO https://github.com/confluentinc/confluent-docker-utils/archive/refs/tags/v0.0.78.tar.gz
tar xzf v0.0.78.tar.gz
cd confluent-docker-utils-0.0.78/
python3 setup.py sdist
pip3 install dist/confluent-docker-utils-0.0.78.tar.gz

Expected result

All requirements are downloaded, and the package installs

Actual behavior

Processing ./dist/confluent-docker-utils-0.0.78.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-wul03re5/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-wul03re5/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-05dl5x3l
         cwd: /tmp/pip-req-build-wul03re5/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-wul03re5/setup.py", line 15, in <module>
        install_requires=open('requirements.txt').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Miscellany

python3 setup.py install DOES claim to work, but running cub and dub afterward yields:

Traceback (most recent call last):
  File "/usr/local/bin/cub", line 33, in <module>
    sys.exit(load_entry_point('confluent-docker-utils==0.0.78', 'console_scripts', 'cub')())
  File "/usr/local/bin/cub", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib64/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'confluent.docker_utils'
0xDEC0DE commented 1 month ago

This can be trivially fixed by adding a MANIFEST.in file to the project.