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

Not catching cycles in Django project #3

Open
filipeximenes opened this issue Feb 2, 2017 · 5 comments
Open

Not catching cycles in Django project #3

filipeximenes opened this issue Feb 2, 2017 · 5 comments
Labels

Comments

@filipeximenes
Copy link

I tested in a Django project with a pretty common circular import situation and it couldn't catch it:
myapp/models.py

from .managers import MyModelManager
class MyModel(models.Model):
    ....

myapp/managers.py

from .models import MyModel
class MyModelManager(models.ModelManager):
   ...
@bndr bndr added the bug label Feb 2, 2017
@bndr
Copy link
Owner

bndr commented Feb 2, 2017

Thanks for reporting!

@bndr
Copy link
Owner

bndr commented Feb 2, 2017

This should be fixed in version 0.0.5.

I added some test cases for relative imports here: https://github.com/bndr/pycycle/tree/master/tests/_projects/relative_imports.

Let me know if this solves your issue, so I can close it.

@filipeximenes
Copy link
Author

Cool @bndr. But now there might be another problem then. I've tested locally with full imports but pasted the example with relative (didn't know it would make a difference). Let me update it and test for both cases and report back to you.

@filipeximenes
Copy link
Author

It's not picking for both cases. I'm running from the root of the project with the command:
pycycle --here --ignore=node_modules --verbose

I can see it enters myapp.models.py and myapp.managers.py. I'm getting:

No worries, no cycles here!

@bndr
Copy link
Owner

bndr commented Feb 2, 2017

Are you on windows? Can you post your pycycle --version output, should be 0.0.6

Can you provide a small test project against which I can verify the fix?

Very much appreciate your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants