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

Build instructions? #11

Closed
MattDMo opened this Issue Nov 13, 2013 · 22 comments

Comments

Projects
None yet
2 participants
@MattDMo

MattDMo commented Nov 13, 2013

Hi Isaac,
I know you don't like doing documentation until you're ready, but would you mind posting some (at least rudimentary) build instructions when you have a chance? I know you've been making a lot of changes recently, and especially with the issues the Sublime Forum has been having recently I haven't been able to see if you've posted a new build recently or not. I'd love to be able to hack on this a little myself, and build on my own.

Thanks!
Matt

PS:
Once you're ready for prime time and submit this to Package Control, I think you're going to get a lot of users very quickly. I built my themes originally using TextMate 1, but that doesn't work when I'm away from my Mac (which is at home), and TM butchers any custom global values you put in beyond what it supports. tmTheme-Editor is nice, but only supports JavaScript highlighting, and the regexen aren't the same as Sublime's. You ColorSchemeEditor is just absolutely fantastic, I love it! I've been at work so much lately I haven't had time to work on my color schemes much, but this tool is wonderful! :)

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 13, 2013

Thanks for the kind words. I think it is ready for another working release, but I haven't done an exhaustive test yet.

I was planning on allowing the tool to take piped arguments before release, but frankly I think that will happen later when I feel like it more.

What platform are you on (windows | OSX | linux)? And what python is installed on that machine?

Once everything is set up, it is pretty easy to build, but I want to give you fairly targeted instructions (to the best of my memory). I think as I get you going, I will simultaneously document that platform. There are a couple of quirks with each system.

Hopefully the source code isn't too scary, I've been meaning to modularize it more and add some comments, but hey that's open source sometims 😄.

@MattDMo

This comment has been minimized.

MattDMo commented Nov 14, 2013

No problem at all. I know what it's like to throw stuff out there then wonder if anyone is using it, has issues, improvements, whatever, so if I really like others' work I like to let them know 😀

My Ubuntu VM died recently, so I'm splitting my time between OS X 10.8.5 at home and XP at work, although I occasionally use Win7 as well. I keep my Python versions pretty up to date, and have both 2.7.6 and 3.3.2 installed, although I try to use Py3 as my standard when I can. For brevity's sake, it'd be fine if you just want to focus on Py3, in case there are major differences between the two.

If there's anything else just let me know, and thanks again for your help!

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 14, 2013

Everything is currently using PY 2.7.X due to dependency on WxPython. What system do you plan on building on...at least at first?

@MattDMo

This comment has been minimized.

MattDMo commented Nov 14, 2013

OK, no prob. Let's start with Windows, since I spend many of my waking hours at work during the week :)

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 14, 2013

Okay, windows:

Preface: The binaries are created with pyinstaller. On windows, I have been using a portable python because I am on a 64 bit system with a 64 bit python, so I build with a portable 32bit python to ensure it works on both 32bit and 64bit systems. With portable python, only 2.7.3.1 plays well with pyinstaller (last I checked). An actual installed Python might work with a later version no problem, but I have not tried it yet. So, I use http://ftp.nluug.nl/languages/python/portablepython/v2.7/PortablePython_2.7.3.1.exe. But feel free to try a later installed python or even a 64bit python. If it doesn't work, you can always use the portable one in the link to ensure it builds.

  • I recommend at least a python 2.7.3
  • Your python should also have installed WxPython 2.9 (2.8 possibly works, but there might be some minor issues) all of my builds are done with 2.9, so I can only promise that will work. The portable python makes it easy and uses 2.9.3. But it should be straight forward to install WxPython on a non-portable install as well http://www.wxpython.org/download.php (2.9 are near the bottom)
  • Windows when packaged with pyinstaller can cause TrendMicro anti-virus to flag the app (not a big fan of TrendMicro), but using UPX compression on the app fixes the issue (and makes the app smaller). http://upx.sourceforge.net/ Drop the binary in the same folder as your python.exe. The build script should automatically use it.

I think that is it for setup.

  • Checkout ColorSchemeEditor
  • Checkout pyinstaller into ColorSchemeEditor as pyinstaller (the build script will look for it to be named that)
  • After that, simply call with the python you want to build with python build.py -c subclrschm.
  • Check in the dist folder when done.

Hopefully I covered everything.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 14, 2013

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 14, 2013

If you use portable python, use the python.exe in the App folder; put upx.exe there as well. Don't use the wrapper exe (I forget what it is called).

@MattDMo

This comment has been minimized.

MattDMo commented Nov 17, 2013

So I actually didn't get a chance to try this at work, but I just ran it at home on my Mac (10.8.5, Python 2.7.5) and it worked perfectly. I use MacPorts, so I just pulled down py27-wxpython, cloned your repo, checked out GUI_Source, cloned pyinstaller inside, ran

$ python build.py -c subclrschm

moved the .app to Packages/User, and it all worked like a charm.

I'll see if I can test your Windows version tomorrow, but based on my experience here I doubt I'll run into any problems. Thanks!

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Nov 17, 2013

Yeah that is pretty much it for OSX. The big thing is not to use the built-in python on OSX; it really just didn't play nice being packaged. I don't think I installed mine from macports, but where you install it from doesn't really matter. WxPython 2.9 is pretty straight forward to install for OSX as well.

The big thing with windows is the UPX compression. And if your using a portable python to be aware of what version works.

Once it is all setup, they all pretty much build the same: linux, osx, windows.

@MattDMo

This comment has been minimized.

MattDMo commented Feb 8, 2014

So wxPython has now been updated to 3.0, and at least using the MacPorts version on OS X, it does not work. Go to http://sourceforge.net/projects/wxpython/files/wxPython/2.9.5.0/ to download 2.9.5, the last of the 2.x series. I don't know if you want to think about updating your code for 3.0, but I just figured I'd let you know.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Feb 8, 2014

2.9.5.0 breaks some stuff on other apps I have written...they seem to not test everything. I use the wx.lib.agw.supertooltip on some of my apps and it is broken in 2.9.5.0; it is also broken still in 3.0.

I will probably skip 2.9.5.0 support and bring it straight up to 3.0 support at some point. I need to provide some workarounds for some things. I utilize WxFormBuilder for the GUI as well. If WxFormBuilder is not compatible with 3.0, I may be waiting a while...I'm not a fan of hand coding the GUI unless I have to. WxFormBuilder is the nicest WxPython gui tool I have used (despite its bugs).

@MattDMo

This comment has been minimized.

MattDMo commented Feb 8, 2014

So I have a different issue now, on Ubuntu 13.10. I installed wxpython, git cloned your repository into Packages, and built the binary (I have the binary source on Dropbox, so I'm using the exact same files I just used to build successfully on OS X). If I run the binary on its own from the command line, it opens just fine. However, if I go to ColorScheme: Editor (current theme) in ST3, it gives me this message:

Color Scheme Editor:
Subclrschm binary has not been downloaded.

Would you like to download the subclrschm binary now?

Any ideas?

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Feb 8, 2014

The plugin downloads the latest version into your user directory. That is where the ST3 plugin looks for the app to be. So when it doesn't find it, it asks to download it for you. You can go ahead and accept, it should download it into your User folder under subclrschm. If the one you built works better on Ubuntu 13.10, then you can just overwrite it with yours I believe. The plugin only looks at the version.json file that gets downloaded with the app via the plugin.

@MattDMo

This comment has been minimized.

MattDMo commented Feb 8, 2014

When asked to download, and after hitting OK, I get:

Color Scheme Editor:
Failed to download and install subclrschm.

Packages/ColorSchemeEditor/version.json had a linux max value of 0.0.8, changing it to 0.0.9 and putting my freshly-compiled binary in the Packages/User directory didn't make any difference...

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Feb 8, 2014

Under User/subclrschm/subclrschm-bin-linux/ it expects to find the binary subclrschm (no extension) and a version.json file with the following format:

{
    "version": "0.0.8"
}

If you recreate that setup, and make sublclrschm-bin-linux version match the Packages/ColorSchemeEditor/version.json, it should stop complaining.

@MattDMo

This comment has been minimized.

MattDMo commented Feb 8, 2014

OK, that did it! Thanks!

As a follow-up note for other people reading this, after creating the directory structure, copying the binary, setting Packages/User/subclrschm/subclrschm-bin-linux/version.json to

{
    "version": "0.0.9"
}

and Packages/ColorSchemeEditor/version.json to:

{
    "linux": {
        "min": "0.0.5",
        "max": "0.0.9"
    },
    "osx": {
        "min": "0.0.5",
        "max": "0.0.9"
    },
    "windows": {
        "min": "0.0.5",
        "max": "0.0.9"
    }
}

you'll need to restart ST3 before everything will work.

@MattDMo

This comment has been minimized.

MattDMo commented Feb 13, 2014

I posted A Guide to Installing ColorSchemeEditor for Sublime Text 3 on my blog. It's a combination of everything we've talked about here, along with a distillation of my own experiences. It covers all three supported platforms. Please let me know what you think about it, or if you have any suggestions or changes you'd like to make.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Feb 13, 2014

Cool, I will check it out in the next couple of days. I will probably borrow from your documentation to construct an official document on building.

Thanks for your interest and work on documenting this stuff. My focus jumps around to different projects quite frequently (when I have time to play with them), so I don't always finish up all of this stuff. It is nice to have others on occasion to finish things like this. It allows me more time to tinker :).

I need to fire up my linux VM and figure out what the actual issue with the linux versioning is as well...

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Feb 13, 2014

@MattDMo Looks like a pretty good write up.

It should be noted that building is not required. The easiest way to install would simply be to install the ColorShemeEditor plugin and hit okay when it asks to download.

OSX users and Windows users should never have to build it from scratch unless they want the latest dev changes. Linux might require building for compatibility with your current linux distro.

Assuming on Windows, OSX, or Linux that there is some network issue which causes the download to fail, then manual setup can be done by downloading the latest binary from https://github.com/facelessuser/subclrschm-bin, selecting the correct branch, and placing them in the appropriate location.

Again, in Linux, building might be required. Also, I plan on resolving the version check issue on Linux, but I haven't looked into why your linux version check would get confused yet.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Jun 1, 2015

I may be ditching PyInstaller support moving forward.

If I do this, assuming you have wxPython installed, you should be able to simply pull the package and say:

python setup.py build
python setup.py install

If developing, you could also do something like this and you would always have your changes accessible globally:

pip install --editable .

I guess you could also just say for a non developer install (haven't tried that):

pip install .

This support already exists, but the ColorSchemeEditor plugin is not yet aware of this install method. It is possible that I will make this the only way moving forward as building linux, windows, and OSX binaries is exhausting. Linux binaries more so as often those are the ones that give me the most trouble in distribution.

ColorSchemeEditor may still check the version, and warn the user when they are out of date, but it would be the users responsibility to update to the latest.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Jun 17, 2015

Build instructions are being done away with as I am going to kill PyInstaller support.

Moving forward, I will require people to just install the package into their system Python. That way I don't have to build binaries, and nor do you.

Source for tool is not at https://github.com/facelessuser/subclrschm. Supports WxPython 3.0.2 now. Probably broke some backwards compatibility stuff with 2.9.4. Travis CI is complaining about lint; I'll get to it tomorrow probably. Assuming Python 2.7 is being used, current install instructions are now:

python setup.py build
python setup.py install

If you are playing around with the source, you can do this from the project root instead, and all changes should be picked up without building:

pip install --editable .

The sublime plugin will do away with pulling down binaries and require people to have the tool in their path, maybe allow them to specify an absolute path. Anyways, this should be much easier to maintain for me. And not nearly as hard for other people to install manually.

@facelessuser

This comment has been minimized.

Owner

facelessuser commented Jun 17, 2015

Went ahead and got things solid again. I am going to close this issue in favor of #16. As this build instructions are no longer needed, but documentation in general is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment