confluentinc / confluentinc/confluent-kafka-python

pip install --no-binary :all: confluent-kafka Deprecation Warning

Open
#1,507 1 comment 0 reactions 0 assignees View on GitHub
investigate further workaround
Dominant language
Python
Stars
509
Forks
964
Avg merge
2d 2h
Merged PRs (30d)
14

Description

Description
===========
To install confluent_kafka with kerberos support, we need to compile rdkafka from source and then install confluent_kafka without downloading the wheel, via:

pip install --no-binary :all: confluent-kafka

However, this throws a deprecation warning:

```
[root@91e9a6f59495 app-root]# pip install --no-binary :all: confluent-kafka
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Collecting confluent-kafka
Downloading confluent-kafka-2.0.2.tar.gz (119 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119.5/119.5 kB 2.3 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Installing collected packages: confluent-kafka
DEPRECATION: confluent-kafka is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
Running setup.py install for confluent-kafka ... done
Successfully installed confluent-kafka-2.0.2
```

---------------

However, using any combination of `--no-cache-dir` and `--use-pip` and `-use-feature=no-binary-enable-wheel-cache` results in downloading the wheel.

Is there a workaround for this to get rid of the deprecation warning?

-----

Using `pip install --no-cache-dir confluent_kafka` will result in downloading the wheel:

```
[root@91e9a6f59495 app-root]# pip install --no-cache-dir confluent-kafka
Collecting confluent-kafka
Downloading confluent_kafka-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
Installing collected packages: confluent-kafka
Successfully installed confluent-kafka-2.0.2
```

Using `pip install --use-pep517` results in the same:

```
[root@91e9a6f59495 app-root]# pip install --use-pep517 confluent-kafka
Collecting confluent-kafka
Downloading confluent_kafka-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 8.1 MB/s eta 0:00:00
Installing collected packages: confluent-kafka
Successfully installed confluent-kafka-2.0.2
```

Using both flags results in the same:

```
[root@91e9a6f59495 app-root]# pip install --use-pep517 --no-cache-dir confluent-kafka
Collecting confluent-kafka
Downloading confluent_kafka-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 2.5 MB/s eta 0:00:00
Installing collected packages: confluent-kafka
Successfully installed confluent-kafka-2.0.2
```

How to reproduce
================

Checklist
=========
Please provide the following information:

- [x] confluent-kafka-python and librdkafka version (`confluent_kafka.version()` and `confluent_kafka.libversion()`): 2.0.2 and 2.0.2
- [ ] Apache Kafka broker version:
- [ ] Client configuration: `{...}`
- [x] Operating system: RHEL
- [ ] Provide client logs (with `'debug': '..'` as necessary)
- [ ] Provide broker log excerpts
- [ ] Critical issue

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.