-
Notifications
You must be signed in to change notification settings - Fork 412
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
Import Cleanup for Services #907
Conversation
Except for 1 (clipboardXML), same number of lines of code in mainFrame, lots of code gone from fit, and no more complicated. Also spotted an import reference that got missed.
(cherry picked from commit bee125d)
(cherry picked from commit 6e17d88)
(cherry picked from commit f416c77)
(cherry picked from commit 5dc43b2)
(cherry picked from commit 74dd6cf)
@blitzmann so this PR is currently working as is. I need to rebase it to clean up the merge conflicts, I'll do that tomorrow. There are some cleanup of imports done in \Eos\ but it's very minimal. Majority of the stuff done in Eos is just code cleanup to get it to pass Tox. I did have to disable a bunch of tests in Tox, we'll want to re-enable most of those once Eos is cleaned up (mostly freaking out about the imports). I also configured Tox to allow lines up to 130 chars, that seems to fit better with the Pyfa codebase than the default 123 (or whatever it is). I did run some tests and didn't see any speed increases in how long it takes to calculate fits, so doesn't seem there'll be any end user benefit here. Just benefit for us with working introspection and Tox/Travis tests. TL:DR; |
(cherry picked from commit 68f4570)
(cherry picked from commit b6c5183)
(cherry picked from commit ea3e5e2)
(cherry picked from commit ab32a3a)
(cherry picked from commit 7fe7056)
(cherry picked from commit 04c30e7)
(cherry picked from commit 0d4f24a)
(cherry picked from commit f160aed)
(cherry picked from commit b375d3c)
(cherry picked from commit ab5f348)
(cherry picked from commit 61d1878)
Fixed all three issues with a single line change.
Not sure where @blitzmann seems everything is working now. You want to look at merging this in? |
I'm not concerned about passing formatting checks at the moment. Unless there is a compelling reason otherwise, please walk this PR back to where the imports are fixed - a formatting PR (which includes travis/tox/whatever) can be done separately (and in smaller chunks, plz - get with me on Slack for a better idea what I mean). As stated before, I prefer to have 1 thing done per PR, especially with low-level things like fucking with imports. Formatting changes for flavor-of-the-month CI, although cool, just mucks with my ability to assess the actual, real change. :) Also, not sure if you're aware, but git allows you to cherry pick commits from another branch. So if you create a new branch with only import fixes, it would be pretty easy to pull all the formatting commits over to another branch. |
The compelling reason is that Tox catches a LOT of missing references. I can say with absolute certainty that there are deep references that I would have never caught without Tox and pyCharms code inspection. I know that you have a boatload of stuff to review, but this goes hand in hand with each other, fixing the imports lets code inspection work, and code inspection helps find broken stuff. I am 99% sure that there is stuff I fixed that was broken a long time, but no one knew because how do you tell when the majority of the file is lit up with inspection issues, many of them false flags? There are still inspection issues that I think are things that are actually broken, but I'm only trying to correct the minimal amount to keep Tox happy. Pyfa is spaghetti enough that trying to trace a simple thing between 5 functions in 5 files (each of which does one thing before passing it on) is super difficult. Tox helps because with fixed imports it can follow those and flag the one that's wrong. Okay, so we could have turned off all of the other misc Tox checks and passed import reference stuff, right? Well, then we still have files filled to the brim with inspection issues. Even after Tox was happy I continued to find issues because we have Fit and fit and Fit, and pyCharm lit it up because Fit was missing the referenced object. When half of the file is lit up those are difficult to find. I literally went file by file, line by line through Services to find these issues. That's easy to do when a dozen or less lines are flagged, hard to do when hundreds are. TL;DR: Without cleaning up all the pep8 issues I would have never found a significant amount of issues.
How do you think that I caught this up to the dev branch? 😉 The formatting commits and import commits are too intertwined. Tox and pyCharm code inspection was too useful to helping sort this out. |
I fail to see how having Please roll this back and include only import fixes. You can include tox config and whatever else, fine, but formatting (whitespace, line wrapping, line endings, double newline before classes / fucntions / anything else that isn't strictly code) can all go to a separate PR. I am not going to merge import changes without easily being able to see exactly what changed without wadding through |
Let's Let's discuss this on Slack sometime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly looked over this and am currently fine with most of it. I need to make a build of OS X and test due to that one conditional import changing - just need to make sure it doesn't crash...
Question about all these though:
+from eos.saveddata.implant import Implant as es_Implant
+from eos.saveddata.character import Character as es_Character
+from eos.saveddata.module import Slot as es_Slot, Module as es_Module
+from eos.saveddata.fighter import Fighter as es_Fighter
Do we really need to define an alias for everything? I can understand defining aliases for services (to not confuse Fit object with Fit service), but most of these things are fine as is.
@@ -160,13 +159,6 @@ def remove(self, mod): | |||
for i in xrange(oldPos, len(self)): | |||
self[i].position -= 1 | |||
|
|||
def toDummy(self, index): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this moved to the Module class? Methinks this should remain as a property of the collection.
probably. we reuse stuff all over the place. Eos does with saveddata and gamedata IIRC. When mass changing them it was easier to just alias most of them, so that I could guarantee that there weren't references pointing to the wrong object. We probably SHOULD rename all the functions to actually be unique, but that's a lot more work. |
For some reason I can see a comment you added @blitzmann in Slack, but not here. Probably because I'm on mobile. If something got moved, it's because of cyclical imports. If you think it belongs somewhere else, then we'll have to merge the two functions, or create a stand alone library. |
This is the comment: Can you explain how it's a cyclic import? You know more about it than I do. I don't think it matters too much where it goes, but syntactically it makes more sense to keep it on the collection class. I've finished the conflict merge, gonna make a package and test on all platforms best I can, then merge to dev and make a pre-release build |
It's because of this one line here: When we were third partying the imports through So. Have a few choices:
|
One thing that I'd like for you to look at @blitzmann.
I totally forgot about this until I started going back through the code looking at TODOs. |
Gonna make a list of things that need to be fixed, just as a reminder to do them. I have the merged version on test_import branch, which is based on dev branch (these issues could totally be bad merges on my part v0v)
|
Do you want me to push commits against the new branch or against this PR? |
I actually just pushed it to your repo so you can make any changes necessary. :) I'll continue to test |
Help help I've been hacked! |
Fixed. Was caused by moving the function to
Same as above
Likely been broken this way a long time. This is an issue with the way we handle the graph window, see #952 I did clean up the super fugly imports in the middle of the file though, so we have better logging if it's not imported.
Not sure how what I did with this would have caused this. Literally just ported it over to Anyway, this is fixed, for some reason we were using a |
Another one when trying to backup all fittings: FIXED
FIXED
|
FIXED Import fitting is broken:
|
Fixed. pyCharm doesn't seem to catch these broken references when they're threaded. One more reason to not use threading.... |
merged into dev branch, tested on all platforms |
Cleans up a lot of the cyclical import issues for \Services. Enables tox and travis and codecov (once Travis-CI and CodeCov is setup).
Issue List
fittingView.py
:populate = sFit.removeModule(self.activeFitID, fit.modules.index(module))
Index is always failing to find a matching module, so always returns 0. (Odd part is, both
module
andfit.modules
look fine to me....)So far those are the only issues I've found.