Aldriana / ShadowCraft-Engine

Calculations backend for ShadowCraft, a WoW theorycraft project.
GNU Lesser General Public License v3.0
37 stars 22 forks source link

Packaging #72

Closed julienp closed 13 years ago

julienp commented 13 years ago

70

Pull request so people can look at it.

You can create a .tar.gz package by running python setup.py sdist, the package will be in the dist folder. I installed it with pip into a virtualenv, and everything except translations seem to work (tests and scripts are not installed, I copied them manually to test).

dazer commented 13 years ago

Does that mean scripts/tests are not working untill I do something? all I get when running them is: Traceback (most recent call last): File "C:\Documents and Settings\nex\Escritorio\julienp-ShadowCraft-Engine-0199457\scripts\assassination.py", line 4, in sys.path.append(path.abspath(path.join(path.dirname(file), '..'))) NameError: name 'file' is not defined

Nevermind, figured I can run them from the command line.

I18n is working for me

julienp commented 13 years ago

Any chance you are running the script from Idle?

julienp commented 13 years ago

Translations work if you get everything from git, but not if it's installed as a package with setup.py. I need to update setup.py to include them properly.

dazer commented 13 years ago

Oh, I see what's going on now. And yes, I was running from Idle; not a huge deal now that I got around it, but It got me confused. Would it make sense to name the package ShadowCraft - Engine-0.1?: ShadowCraft, I believe, is the name of the compound UI+Engine project.

julienp commented 13 years ago

Accidentally got a commit adding a test for killing spree in there. Obviously not packaging related but it won't do any harm, so I'll leave it in for now. Updates on master always merge back cleanly, I'll check again once the Detailed EP pull request is in, but I think after that it could be merged. If Raconzor's UI isn't added before, he will have to adjust the imports, but that's about it.

Aldriana commented 13 years ago

I think I'm going to pull in detailed EP and raconzor's UI before doing this - I think that's about the extent of major pieces people still have outstanding.

julienp commented 13 years ago

Sounds good, I'll update it once those two pull requests are in.

julienp commented 13 years ago

Updated, all tests pass and scripts produce the same results.

Currently the source distribution created by setup.py has a small issue with i18n files: if you just drop the shadowcraft folder into whatever project you're using it in, translations will work. However if you install it with python setup.py install, .mo files will not be copied to your site-packages (I don't think python lets you have non .py files there). Setup.py can be extended to install the translation files in /usr/local/share/locale/*/ or whatever system prefix is set, but our current i18n.py will have to be adjusted to look for the files there. No idea where the files should go on windows.

Anyway, I don't think this is import right now and shouldn't delay pulling this, I just wanted to note it.