Objective of this PR is to give the capability to generate Python classes in a subpackage of an existing application. (See: 16)
It add a new flag that allow to override the default top level package name chosen for classes generation.
For information, top level package is currently :
When pip:
pip value with '-' -> '_' replacement
Ex : test-avro became test_avro
Without pip:
blank
How-to :
Using this new flag, it is now possible to generate classes without pip but with a custom top level package.
Example :
with pkg_resources.path(api, "event") as event_directory:
# initialize the reader object
reader = AvscReader(directory=event_directory)
# generate the acyclic tree object
reader.read()
# initialize the writer object
writer = AvroWriter(reader.file_tree, top_level_package="api.event")
# compile python files using 'tests/test_records as the namespace root'
writer.write(root_dir="."))
Bonus :
We updated the package dependencies to use ranges of compatibility instead of fixed value.
This is useful in projects where these dependencies are already set to fixed value which is distinct from this library.
Objective of this PR is to give the capability to generate Python classes in a subpackage of an existing application. (See: 16)
It add a new flag that allow to override the default top level package name chosen for classes generation. For information, top level package is currently :
When pip: pip value with
'-' -> '_'
replacement Ex : test-avro became test_avroWithout pip: blank
How-to : Using this new flag, it is now possible to generate classes without pip but with a custom top level package. Example :
Bonus : We updated the package dependencies to use ranges of compatibility instead of fixed value. This is useful in projects where these dependencies are already set to fixed value which is distinct from this library.