Closed dimidd closed 6 years ago
Please don't mix changes in a single PR; this makes it harder to review.
Also, I'm not convinced that there is a need for the feature.
And unfortunately JSON does not support comments, unlike Python. If there is support for the customisation, I would prefer to see it implemented differently, eg by allowing the embedded settings to be overridden by an option that reads a separate file.
OK, I'll make a separate PR for whitespace fixes.
Regarding comments, how about using YAML which does support one-line comments?
I agree that the best option would be to add an optional flag --mappings_file <my_mappings.yml>
, to override the default one. Some projects even force the user to customize, by providing only an example file, but I didn't wan't to break existing scripts and docs.
In addition, setup.py
is way trop long, and I believe that outsourcing the mappings would also improve readability.
I'm still not convinced that there is a general use case for a separate mappings file. What are the changes you want to make? Can you not adjust the mappings after running setup?
As to simplifying setup, another approach might be to put the database setup in a separate Python module. That would allow comments, and allow conditional mapping depending on the DB version.
But at present, setup.py is working, and I don't see any pressing need to fix what ain't broken.
OK, if it's not relevant for other Pony users, I guess it's not worth the trouble.
Signed-off-by: Dimid Duchovny dimidd@gmail.com