Closed joaoe closed 1 year ago
Hi @joaoe
I think it is a good idea to make this package lighter.
faust-streaming
: This should be optional
pytz
: I think it can be removedfaker
: For now we should keep it, I think after some code refactor it can be added as optional
inflect
: See if can be removed (I need to take a proper look)The other dependencies are really important, so we need to keep them
Hi, thank you for your attention :) I though of making a small draft PR, but these kind of changes tend to be very opinionated, so I don't have the bandwidth to provide a patch that would be shred to bits :p
But for now, could you please just mark faust as optional and thing about the rest after ? That would in the immediate term help a lot with import bloat. Cheers.
@joaoe
I have created a PR to fix the dependencies. faust
and pydantic
were not optional at all but now they will. Also, I have removed pytz
as dependency.
The dependencies for now on are: dacite, Faker, fastavro, Inflector, python-dateutil, six and stringcase
Is your feature request related to a problem? Please describe. Hi ! In my project I'm working to reduce dependency bloat, import times, install times, package size, etc. dataclasses-avroschema happens to be a culprit. After running
pipdeptree
it shows a lot of pulled dependencies which are of no use for our project and yet seem to be of little use for dataclasses-avroschema.I just went through the dependency list in the
[tool.poetry.dependencies]
ofpyproject.toml
and have the following comments:fastavro
, seem this is pretty much requiredinflect
, used in a single place asp.singular_noun(name)
pytz
, use once to get the UTC timezone and then in testsdacite
, this seem requiredfaker
, used in many places infields.py
stringcase
, seems important as wellpydantic
, already optionaldc-avro
, already optionalfaust-streaming
, marked as required dependency even though the code has a fallback if it is not importableDescribe the solution you'd like
fastavro
, keepinflect
, possibly mark as optional dependency ? And add fallback in code when it is not importable.pytz
, I understand pretty much every project on pypi.org imports pytz, but this project as a library should include it only if strictly necessary 3.1. To access theutc
timezone object just usedatetime.UTC
from Python's stdlib. 3.2. Import it as test dependency for the other use.dacite
, keepfaker
is highly suspicious and seems like test code. Moreover, is it really necessary to have random example data for those fake functions ? Could this be instead either an optional or test dependency, and access faker lazily with a fallback if it is not imported/installed ? Faker is specially annoying because it just spams logging with messages about missing locales all the time.stringcase
, keepfaust-streaming
, this should be marked as an optional dependency. This is actually the biggest source of bloat.Describe alternatives you've considered None.