faust-streaming / faust

Python Stream Processing. A Faust fork
https://faust-streaming.github.io/faust/
Other
1.65k stars 183 forks source link

Unable to install using Docker on Mac. #570

Closed hgalytoby closed 11 months ago

hgalytoby commented 11 months ago

Steps to reproduce

FROM python:3.10.13
RUN pip install --upgrade pip
RUN pip3 install faust-streaming
FROM ubuntu:latest
RUN apt-get update \
    && apt-get install -y python3-pip \
    && python3 -m pip install --upgrade pip
RUN pip3 install faust-streaming

Actual behavior

On 2023/11/20, I successfully installed and ran faust-streaming using Docker. However, as of today, 2023/11/21, I am unable to install faust-streaming anymore. I attempted to install faust-streaming separately using two different images, namely Ubuntu and Python 3.10.13, but without success.

I can install faust-streaming locally on my Mac.

I can install faust-streaming on Ubuntu using Docker and a Dockerfile.

I can install faust-streaming on Windows.

I am unsure why using Docker on Mac is presenting this issue. Has anyone else encountered a similar problem?

I conducted separate tests on MacOs M1 versions 14.1.1, 12.6.2, and 13.4.1.

Full traceback

...move
#0 7.735               ********************************************************************************
#0 7.735               The following seems to be defined outside of `pyproject.toml`:
#0 7.735       
#0 7.735               `optional-dependencies = {'sentry': ['raven<7.0,>=6.10.0', 'raven-aiohttp>=0.7.0', 'sentry_sdk>=0.7.10'], 'cython': ['cython'], 'rocksdict': ['rocksdict<4.0,>=0.3.11'], 'uvloop': ['uvloop>=0.8.1'], 'prometheus': ['prometheus_client'], 'aiodns': ['aiodns>=1.1'], 'setproctitle': ['setproctitle>=1.1'], 'datadog': ['datadog'], 'rocksdb': ['faust-streaming-rocksdb>=0.8.0'], 'fast': ['aiodns>=1.1', 'faust-cchardet', 'ciso8601', 'cython', 'orjson<4.0,>=2.0', 'setproctitle>=1.1'], 'statsd': ['statsd~=4.0.1'], 'ciso8601': ['ciso8601'], 'cchardet': ['faust-cchardet'], 'aiomonitor': ['aiomonitor>=0.4.4'], 'orjson': ['orjson<4.0,>=2.0'], 'redis': ['aredis<2.0,>=1.1.3'], 'debug': ['setproctitle>=1.1', 'aiomonitor>=0.4.4'], 'eventlet': ['faust-aioeventlet', 'dnspython'], 'yaml': ['pyyaml>=5.1']}`
#0 7.735       
#0 7.735               According to the spec (see the link below), however, setuptools CANNOT
#0 7.735               consider this value unless `optional-dependencies` is listed as `dynamic`.
#0 7.735       
#0 7.735               https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
#0 7.735       
#0 7.735               To prevent this problem, you can list `optional-dependencies` under `dynamic` or alternatively
#0 7.735               remove the `[project]` table from your file and rely entirely on other means of
#0 7.735               configuration.
#0 7.735               ********************************************************************************
#0 7.735       
#0 7.735       !!
#0 7.735         _handle_missing_dynamic(dist, project_table)
#0 7.735       Traceback (most recent call last):
#0 7.735         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
#0 7.735           main()
#0 7.735         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
#0 7.735           json_out['return_val'] = hook(**hook_input['kwargs'])
#0 7.735         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
#0 7.735           return hook(metadata_directory, config_settings)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
#0 7.735           self.run_setup()
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
#0 7.735           exec(code, locals())
#0 7.735         File "<string>", line 254, in <module>
#0 7.735         File "<string>", line 189, in do_setup
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
#0 7.735           return distutils.core.setup(**attrs)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 159, in setup
#0 7.735           dist.parse_config_files()
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 627, in parse_config_files
#0 7.735           pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py", line 67, in apply_configuration
#0 7.735           return _apply(dist, config, filepath)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 56, in apply
#0 7.735           _apply_project_table(dist, config, root_dir)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 82, in _apply_project_table
#0 7.735           corresp(dist, value, root_dir)
#0 7.735         File "/tmp/pip-build-env-uvwtr156/overlay/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 163, in _long_description
#0 7.735           file = val.get("file") or []
#0 7.735       AttributeError: 'NoneType' object has no attribute 'get'
#0 7.735       [end of output]
#0 7.735   
#0 7.735   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 7.737 error: metadata-generation-failed
#0 7.737 
#0 7.737 × Encountered error while generating package metadata.
#0 7.737 ╰─> See above for output.
#0 7.737 
#0 7.737 note: This is an issue with the package mentioned above, not pip.
#0 7.737 hint: See above for details.

Versions

somnam commented 11 months ago

This seems to be caused by latest update in setuptools, particularly this commit. The setup.cfg file seems to be inconsistent with pyproject.toml causing the build to fail. For some reason building faust-streaming downloads this latest version of setuptools and causes the error:

pip install --verbose faust-streaming
Using pip 23.0.1 from /Users/tomek/workspace/faust-test/venv/lib/python3.10/site-packages/pip (python 3.10)
Collecting faust-streaming
  Downloading faust-streaming-0.10.16.tar.gz (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.2/757.2 kB 6.5 MB/s eta 0:00:00
  Running command pip subprocess to install build dependencies
  Ignoring cython: markers 'implementation_name == "cpython" and python_version >= "3.12"' don't match your environment
  Collecting setuptools
    Downloading setuptools-69.0.0-py3-none-any.whl (819 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.4/819.4 kB 6.9 MB/s eta 0:00:00
  -- more package downloads --
  Installing collected packages: wheel, typing-extensions, tomli, setuptools, packaging, cython, setuptools_scm
  Successfully installed cython-3.0.5 packaging-23.2 setuptools-69.0.0 setuptools_scm-8.0.4 tomli-2.0.1 typing-extensions-4.8.0 wheel-0.41.3
   -- installing --
      AttributeError: 'NoneType' object has no attribute 'get'
  note: This error originates from a subprocess, and is likely not a problem with pip.

Did anyone find a workaround for this issue until a fix is released?

Btw. This seems universal for arm64, happens for me on Linux image too. The same error happens in faust CI pipelines.

mahesh-avoma commented 11 months ago

We are facing same issue on arm64 ec2 instances, a quick fix will be appreciated as we have production workloads

somnam commented 11 months ago

I've added a pr that attempts to temporarily fix the issue https://github.com/faust-streaming/faust/pull/571, but it looks like CI workflows need approval to see if it works.

mhaley-tignis commented 11 months ago

For now I have pinned to faust-streaming==0.10.13, before the pyproject.toml file was introduced.

hgalytoby commented 11 months ago

The new version has been released to address this issue. Thank you, everyone.

🎉🎉🎉