Skip to content

setup.py: Don't import packages that aren't installed yet.#34

Open
leorochael wants to merge 1 commit intomarinho:masterfrom
leorochael:marinho-master
Open

setup.py: Don't import packages that aren't installed yet.#34
leorochael wants to merge 1 commit intomarinho:masterfrom
leorochael:marinho-master

Conversation

@leorochael
Copy link
Copy Markdown

setup.py should never attempt to import packages that are not yet
installed, including packages from the source it is distributing.

In this case, importing get_version() from geraldo.version was causing
reportlab to be imported by side-effect (via geraldo.__init__ which
imports geraldo.graphics, besides other modules).

However there is no guarantee that reportlab is already installed when
setup.py is run, as it is the job of setup.py to specify reportlab as a
dependency.

`setup.py` should never attempt to import packages that are not yet
installed, including packages from the source it is distributing.

In this case, importing `get_version()` from `geraldo.version` was causing
`reportlab` to be imported by side-effect (via `geraldo.__init__` which
imports `geraldo.graphics`, besides other modules).

However there is no guarantee that `reportlab` is already installed when
`setup.py` is run, as it is the job of `setup.py` to specify `reportlab` as a
dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant