Change Package Install Loading Step

Greeetings,

I have this package which fails on install if some codes in this file

That’s beacause i am importing some codes in init which requires requests. But it seems that for some reason, package installation executes your files before installing requriements which causes the install to fail without the try catch.

An improvement would be to decouple and priotise installing packages?

But it seems that for some reason, package installation executes your files before installing requriements which causes the install to fail without the try catch.

Yes, running setup.py necessarily involves first evaluating all the top-level imports in that file, and if doing so leads to running package code that requires a third-party package, the script will fail. Prioritizing installing packages is not an option, as setup.py must be run in order to find out what packages need to be installed.

There are multiple ways around this issue, many of which are listed here. I personally recommend the use of the attr: directive in setup.cfg.