pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Proposal: root spec import mode to replace legacy importing and importmode

Open RonnyPfannschmidt opened this issue 2 years ago • 4 comments

this pr is a starting point for a import-mode that supports modern importing

the key ideas are

  • correctly setup import toplevels
  • in case of non-editable installation compare files to correctly fail collection when reinstall is needed

RonnyPfannschmidt avatar Mar 19 '23 10:03 RonnyPfannschmidt

Note on implementation,

This will require py3.9+ importlib_metadata apis for the details on resource

An accompanying note to migrate to their apis seems necessary (so that pytest can warn on stale resources as well

The best way to register test root namespaces is still unclear

RonnyPfannschmidt avatar Mar 25 '23 14:03 RonnyPfannschmidt

@bluetech i wonder if this proposal/idea could integrate with directory/package collection enhancements/changes in a way that allows migration

RonnyPfannschmidt avatar Jun 06 '23 08:06 RonnyPfannschmidt

... any chance this proposal might happen? (I realize that's probably just asking if anyone is going to take on the work and I"m not here volunteering so... mostly just poking it to see if there is interest)

gpshead avatar Apr 04 '25 04:04 gpshead

I have 2 refactoring of horror higher on my priority Lust ans im currently very thin stretched for time on that

RonnyPfannschmidt avatar Apr 04 '25 04:04 RonnyPfannschmidt