databaker icon indicating copy to clipboard operation
databaker copied to clipboard

Explicitly state imports in databaker.constants

Open goatchurchprime opened this issue 7 years ago • 3 comments

All recipes begin with: from databaker.constants import * so it helps if this is less of a mess -- like, for example, we know about all the constants that it does import.

Currently there is a circular dependency with an import bake

It appears this is to access the command line options in bake.Opt.params for use in the PARAMS() function -- which anyway doesn't seem to be called from anywhere.

We should delete this section

goatchurchprime avatar Oct 03 '16 10:10 goatchurchprime

Some of this will be addressed in https://github.com/sensiblecodeio/databaker/tree/python-3-support which is based on Dragon's changes in https://github.com/sensiblecodeio/databaker/tree/fix_circular_imports (which can't be merged as it's out of date and there are considerable enough differences to make it easier to hand patch the current master instead). import bake is gone from bake.py, and the bake.Opt.params has been refactored.

Python 3 seems to be less forgiving of these circular imports than Python 2, so it needs fixing first.

The * imports we should resolve too; the intent is unclear and produces noisy linter warnings.

StevenMaude avatar Oct 04 '16 16:10 StevenMaude

PARAMS is used in tests.

StevenMaude avatar Oct 06 '16 10:10 StevenMaude

The circular imports fixes are in master now, so we just need to explicitly state the imports now.

StevenMaude avatar Oct 18 '16 14:10 StevenMaude