epic-framework / epic-sklearn

MIT License
2 stars 0 forks source link

Tests fail to run due to weird import logic - naming collision with `sklearn` #2

Open bd-assaf opened 2 weeks ago

bd-assaf commented 2 weeks ago

Locally, everything works: MacOS, platform darwin -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0.

When CI runs tests, upon import, when trying to run from sklearn.preprocessing import MinMaxScaler (first import from the outside sklearn), instead it tries to search for it in epic/sklearn/preprocessing/__init__.py, for some reason. This leads to a circular import at kneedle.

Perhaps the way that the tests are run causes a confusion between the external and internal sklearn. Maybe because epic is just a namespace?

yonatanp commented 2 weeks ago

Interesting. We worked hard to figure out the exact flags of testing to suit the namespace situation, but it looks like the top level “epic” still remains a base folder in the import path. Might be a change in behavior (e.g. more recent pytest version) or, more likely, an import collision that didn’t happen with older sklearn versions. I will take a deeper look.

yonatanp commented 2 weeks ago

Same issue as https://github.com/epic-framework/epic-pandas/issues/1

bd-assaf commented 2 weeks ago

I don't thing it has anything to do with the content of sklearn. On the contrary, when it needs to go outside, it searches for stuff in the internal structure. It's almost surely a pytest behavior that has changed between versions.