Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement recursive handling of import #23

Merged
merged 5 commits into from
Jun 12, 2020

Conversation

serge-sans-paille
Copy link
Collaborator

The recursive strategy basically states that if a symbol uses a symbol that uses
a symbol that... uses a deprecated symbol, even within a deep module hierarchy,
it is deprecated.

  • it's optional
  • it's still incompatible with the caching system (no dep handling)

@serge-sans-paille
Copy link
Collaborator Author

It also requires the dev version of beniget :-)

@serge-sans-paille serge-sans-paille force-pushed the feature/recursive-import branch 2 times, most recently from 6b33bfe to e679548 Compare June 5, 2020 21:02
@serge-sans-paille
Copy link
Collaborator Author

Not mergeable yet: I need to implement support of dependencies in the cache system

@serge-sans-paille serge-sans-paille force-pushed the feature/recursive-import branch from 83dd596 to b57ec5c Compare June 10, 2020 19:28
@serge-sans-paille
Copy link
Collaborator Author

ready for review, cc @JohanMabille and @marimeireles

@serge-sans-paille serge-sans-paille force-pushed the feature/recursive-import branch 2 times, most recently from 6da191b to f7f7976 Compare June 11, 2020 12:54
The recursive strategy basically states that if a symbol uses a symbol that uses
a symbol that... uses a deprecated symbol, even within a deep module hierarchy,
it is deprecated.

- it's optional
- it's still incompatible with the caching system (no dep handling)
@serge-sans-paille serge-sans-paille force-pushed the feature/recursive-import branch 2 times, most recently from d565692 to 3c30ac1 Compare June 11, 2020 21:24
Copy link
Contributor

@marimeireles marimeireles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, the caching part is still a little bit of dark magic to me, but the import logic and the recursion seems super good.

memestra/memestra.py Show resolved Hide resolved
memestra/caching.py Show resolved Hide resolved
memestra/memestra.py Outdated Show resolved Hide resolved
When recursive import is activated, a change in an imported file may have an
impact on the validity of the cache. To prevent that, we integrate the hash of
each imported module to the key.

This currently makes the computation much slower, there's probably another way to handle that.
Do not recompute the same key twice, using a key factory.
Speedup dependency computation using native ast module and short-circuiting.
Minimal documentation.
@serge-sans-paille serge-sans-paille force-pushed the feature/recursive-import branch from 3c30ac1 to 5e2d3bd Compare June 12, 2020 10:15
@serge-sans-paille serge-sans-paille merged commit 858c84f into master Jun 12, 2020
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.

2 participants