Trilarion / imperialism-remake

Imperialism remake
https://remake.twelvepm.de/
GNU General Public License v3.0
54 stars 19 forks source link

Absolute import in `start.py` prevents startup #30

Closed krs013 closed 7 years ago

krs013 commented 7 years ago

This is another tiny pull request. In the recent update to imports, something changed that prevented the game from starting via command line in Linux and macOS. I thought at first that a lot of imports needed to be fixed, but it turned out that there was just one absolute import in start.py that occurred before sys.path was extended.

To be honest, imports and dependencies still look a little messy to me, but I am not an expert on Python imports and haven't done many projects this large, so I can't say if there's an objectively better way. I'd be interested in a discussion about this if anyone else is, but it's not a big deal, and there are better things to spend time on anyway.

Also it looks like a commit with some changes to .gitignore made it in. I added these because macOS adds .DS_Store files everywhere for search indexing, and emacs makes backup files left and right too. It shouldn't affect anything else, though, so it should be fine adding that upstream.

krs013 commented 7 years ago

Unrelated: tests show a pass bc return code is 0, but it looks like the travis server had an import error...

Trilarion commented 7 years ago

The reason for the error on Linux and Mac was that I still have the current folder in the Python path when starting. I will change it.

Also, I'm totally open to any discussion about the import system or anything else. In this case, it's the best I could come up with but somebody else might have a better idea.

Extending gitignore is also fine. And yes, that Travis log shows there is an error. Why is the "run all tests" script not returning an error code? Will investigate.