Skip to content

Commit e04b4d2

Browse files
committed
Revert fastavro to non-optional dependency
Currently, skipping the avro extras would lead to an ImportError. It doesn't really make sense to make fastavro optional in the context of deserialization, no way to know ahead of time that the messages being deserialized definitely won't contain Avro schemas. This could only work if the deserializer had a plan for what to do when encountering a message serialized with a schema that requires a skipped dependency (raise an exception? skip the message? call a callback?)
1 parent e9d1ecb commit e04b4d2

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ Clone this repository and install it:
3232
python setup.py install -e .
3333
```
3434

35-
You most likely want to install one or more extras. For example, to use the schema registry with Avro schemas and [kafka-python](https://pypi.org/project/kafka-python/), you should install the `avro` and `kafka-python` extra:
35+
This library includes opt-in extra dependencies that enable support for certain features. For example, to use the schema registry with [kafka-python](https://pypi.org/project/kafka-python/), you should install the `kafka-python` extra:
3636

3737
```
38-
python setup.py install -e .[avro, kafka-python]
38+
python setup.py install -e .[kafka-python]
3939
```
4040

4141
Extra name | Purpose
4242
:--------- | :------
43-
avro | Allows using Apache Avro schemas, using `fastavro` as a backend
4443
kafka-python | Provides adapter classes to plug into `kafka-python`
4544

4645
## Usage

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ python_requires = >=3.7
3333
install_requires =
3434
boto3>=1.18.48
3535
typing-extensions>=3.10.0.2;python_version<"3.8"
36+
fastavro>=1.4.5
3637
setup_requires =
3738
setuptools
3839

3940
[options.extras_require]
4041
dev =
4142
pytest>=6
4243
flake8>=3
43-
avro =
44-
fastavro>=1.4.5
4544
kafka-python =
4645
kafka-python>=2
4746

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ python =
1010
[testenv]
1111
deps = pytest
1212
commands =
13-
pip install . .[dev] .[avro] .[kafka-python]
13+
pip install . .[dev] .[kafka-python]
1414
python -m pytest --ignore tests/integration
1515

1616
[testenv:flake8]
@@ -20,7 +20,7 @@ commands = flake8
2020
[testenv:mypy]
2121
deps = mypy
2222
commands =
23-
pip install . .[dev] .[avro] .[kafka-python]
23+
pip install . .[dev] .[kafka-python]
2424
python -m mypy
2525

2626
[pytest]

0 commit comments

Comments
 (0)