Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Add setup.py #64

Closed
wants to merge 1 commit into from
Closed

Add setup.py #64

wants to merge 1 commit into from

Conversation

professorjamesmoriarty
Copy link
Contributor

So I'm not sure why the makefile, nothing wrong with it ofc.
But I had some free time and figured I'd write a setup.py,
and maybe even throw it up on pypi. However that plan back
fired. It seems like googler is taken on pypi. That aside
if @jarun is cool with adding this an alt name could be
considered on pypi.

A small note, default prefix is /usr/local like the makefile.
I guess if its cool to add to project, the command to install would
be something like: sudo python setup.py install --prefix=/usr to
use /usr/ over /usr/local/ ofc.

Like I said nothing wrong with current install method. But pypi
permits people to install with some ease.

@zmwangx
Copy link
Collaborator

zmwangx commented Apr 27, 2016

Need to squash into self-contained commits to be merged. I'll review this either tonight or tomorrow afternoon, if @jarun doesn't beat me to that.

@zmwangx
Copy link
Collaborator

zmwangx commented Apr 27, 2016

A note on PyPI though: I don't think it's a good idea to upload to PyPI a "module" that cannot and should not be imported.

@zmwangx
Copy link
Collaborator

zmwangx commented Apr 27, 2016

I took a brief look actually: the use of prefix doesn't conform to setuptools conventions. setuptools's install and develop commands support --prefix natively, so one should not reinvent the wheels. Also, I'm not sure using setuptools is a good idea at all when you doesn't even have a package. All in all I find it an overkill — maybe Windows support is the only benefit? But then again, all you need to do is to drop two files — one script and one man page — somewhere on your search paths, the latter being optional, so I highly doubt that this is a useful addition (assuming that we're not submitting to PyPI).

I haven't looked at the details yet.

@jarun
Copy link
Owner

jarun commented Apr 28, 2016

pip and pypi have to do with libraries. We can't add this, unfortunately.

I do have some other stuff in mind:

  • I am looking for ways to reach areas we should. If you guys have some ideas to make googler more friendly (to install) on Windows (with/without Cygwin), do share. Better documentation for Windows would help.
    At some point I thought of adding nmake support script but that would be a overkill. :D
  • We need to document (detailed API headers) all the APIs, classes etc. for a friendlier code. Many GitHub users are visiting our utility nowadays and it's always nice to have more hands. I will start with this in a few days.
  • We need to have some sort of a ToDo list. So if you guys have any improvements, features in mind, do share.

As the first step, I think the functions are small and quite modular now with all extra conversions and assignments gone.

I shared the above in this particular thread because both of you have tremendous contributions in spreading and making googler better. I probably would never have thought of AUR or Homebrew or argparse myself.

@zmwangx
Copy link
Collaborator

zmwangx commented Apr 28, 2016

Re Windows: chocolatey. I have hardly ever used it in person though (been using it on AppVeyor — a Windows CI — to install prereqs like FFmpeg), because I have hardly touched Windows since I fled from it years ago.

Re API docs: I love docs, definitely more of those! As for style, I prefer numpy style (easier to read and potentially more extensive at the cost of taking up more vertical space), but I know many people prefer Google style. Could you please let me know your preferences?

As for HTML docs, I have quite some experience with Sphinx, but I always worked with packages. It remains to see if Sphinx could work with non-modularized code. I'll take a look this weekend if I have time.

Re ToDo list: I personally like issues tagged with "help wanted". I personally look at the "help wanted" tag if I feel like contributing to a project.

@jarun
Copy link
Owner

jarun commented Apr 28, 2016

I came across Chocolatey earlier. Not sure how popular it is yet. They use a closed forum. I didn't join.

I used numpy for Buku. I'm good.

We have a limit on keeping issues alive, remember? We can add a ToDo list section in README, given we have some items other than stuff we already discussed. I would like to add a deb package (noarch) if we can find a maintainer. BTW, does GitHub have any way to integrate generation of deb packages?

@professorjamesmoriarty
Copy link
Contributor Author

I'll close this PR, as it's out of scope for now.

That being said, I'd love to see a TODO list, or even issues. Both work for me personally. @jarun I can create debian packaging sometime this coming week to install the files. It'll be fairly straight forward. What you can do would be attach "binarys" (.deb file) when you create a release on github. And link to it on readme etc. We can explore that later tho.

@jarun
Copy link
Owner

jarun commented Apr 28, 2016

@shaggytwodope that's awesome! can't thank you enough, really.
Yep, we'll discuss and come up with the procedure.

@zmwangx
Copy link
Collaborator

zmwangx commented Apr 28, 2016

Continue discussion in #65.

@zmwangx zmwangx mentioned this pull request Jul 8, 2016
7 tasks
@lhaisrs
Copy link

lhaisrs commented Mar 1, 2017

Hi guys,

I'm a windows user and i find about 'googler' in this article in portuguese: http://terminalroot.com.br/2017/02/como-pesquisar-no-google-pelo-terminal.html then I try to use in Windows, I didn't get how to use like a variable of the system or call from the root but I got it how a python file.
I just cloned your project, set up: python googler "Using google or search in google" in the comand prompt and I had answers from Google. I tryed to add like a environment variable on Windows but I couldn't. So, if you guys think it's cool to share, I can pull request on Read.me my example using googler in Windows.

Look for this picture of my example in my fb: https://www.facebook.com/photo.php?fbid=1465830426780906&set=a.222344804462814.60161.100000618879721&type=3&theater

@professorjamesmoriarty
Copy link
Contributor Author

@lhaisrs So the short of it is that the terminal (shell?) you are using isnt making use of the hardcoded ansi color codes. Thats why the output is funky. Not sure what you can do, short of using another shell (maybe powershell? not a windows user sorry).

@zmwangx
Copy link
Collaborator

zmwangx commented Mar 1, 2017

@lhaisrs When I have to use Windows I use ConEmu which supports ANSI colors. See #70 (where I made googler Windows-compatible) for screenshot.

Adding environment variables in Windows (either globally or in shell profiles) is easy. Google is your friend.

@zmwangx
Copy link
Collaborator

zmwangx commented Mar 1, 2017

By the way you also need to change code page to UTF-8 on Windows — chcp 65001 — which I also mentioned in #70.

@lhaisrs
Copy link

lhaisrs commented Mar 1, 2017

Worked so much better in Powershell, but showed this error: 'charmap' codec can't encode character '\u2014' in position 101: character maps to that @zmwangx told about.

@zmwangx
Copy link
Collaborator

zmwangx commented Mar 1, 2017

I can't quite parse that sentence, sorry... But does chcp 65001 fix the problem? If not, what's your Python version and googler version?

@zmwangx
Copy link
Collaborator

zmwangx commented Mar 1, 2017

@lhaisrs Anyway, if you need additional help, please open a new issue (and follow the instructions in the template). This thread is hardly related to running googler on Windows.

@lock lock bot locked and limited conversation to collaborators Nov 15, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants