-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix install instructions (create install script) #19
Comments
Also tell user to run "source" on bashrc after adding to path. |
Added this to instructions: (source is an old alias) |
I will make an install script. |
So I was trying to add Besides, I am not sure if this is the best method. Help! @bhillmann @GabeAl |
I have been unsuccessful in using a setup.py to manually add binaries to the path. In the fine print of that article it states that adding command line tools written in Python. Unfortunately, this does not include binaries, and is still a method for Python only tools. That is why you get that encoding error, since Python is trying to decode the script as Python. There are workarounds, but again, this goes against my better judgement as we would have to build a system that replicates a system that is already exists, and that is Anaconda. If you really want to build it yourself, then you can look at what they do for similar tools, such as humann2. |
Very simple, just grab the binary from GitHub within the install script. That way you don't need to distribute big bloated packs of all the binaries.
That's it. Tested and working to grab the linux binary and name it the "universal name" shi7en_trimmer.exe which will work on Linux, Windows, and Mac. Just like this, we can grab the correct binary for the system easily this way from GitHub inside of a Python install script. Then we just tell the os to do chmod +x if it's UNIX (I think we might be able to work around this, too). To detect what system you're on is also easy:
This will allow you to customize the URL you grab in the "response = ur.urlopen(...)" line depending on what OS you're using. |
A more efficent way to download a file would be to fetch chunks. I also made a gzip version. Try the function I created awhile back in NINJA-utils located here def download_txt_url(path_to_file, url):
with urllib.request.urlopen(url) as stream:
CHUNK = 2 ** 14
with open(path_to_file, 'wb') as outfile:
while True:
chunk = stream.read(CHUNK)
if not chunk:
break
outfile.write(chunk) |
I will look into your all inputs and make one based on them. |
Do we need to help the user to add the binaries to the $PATH within the install script? |
Yes, I'll add those, hopefully this weekend!
Thanks as always!
…On Jan 12, 2017 6:04 PM, "Kaiwei Ang" ***@***.***> wrote:
Do we need to help the user to add the binaries to the $PATH within the
install script?
Besides, the mac version binaries are not in the release downloads. Do we
need to add them?
@GabeAl <https://github.com/GabeAl> @bhillmann
<https://github.com/bhillmann>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHrXBrwV6y_Mh41eOVdF2Tbo_strivs6ks5rRr-lgaJpZM4LIFWh>
.
|
As for the path thing, I think we could either try to do that or simply
ignore it for now.
If we don't want to worry about modifying the user's PATH, there's a
solution. Since the install script knows where it's putting the binaries,
the main shi7en script can call them with a relative path as long as the
binaries are in a different folder, like one called "bin".
…On Jan 13, 2017 2:56 PM, "Gabe A." ***@***.***> wrote:
Yes, I'll add those, hopefully this weekend!
Thanks as always!
On Jan 12, 2017 6:04 PM, "Kaiwei Ang" ***@***.***> wrote:
> Do we need to help the user to add the binaries to the $PATH within the
> install script?
> Besides, the mac version binaries are not in the release downloads. Do we
> need to add them?
> @GabeAl <https://github.com/GabeAl> @bhillmann
> <https://github.com/bhillmann>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AHrXBrwV6y_Mh41eOVdF2Tbo_strivs6ks5rRr-lgaJpZM4LIFWh>
> .
>
|
Example: user downloads shizen install script. Install script does the
following:
It downloads and puts the main shi7en script.
It creates a directory called "bin" and downloads the appropriate system
binaries, renaming them to something like "binary.exe" (replace "binary"
with the actual binary names without "Mac" or "lin" or whatever).
In the main python script, define a variable for each binary name and set
it to "bin/binary.exe" (again, replacing "binary" with each actual binary
name when you need it).
That'll remove all dependency on path and user environment. It'll expect
all binaries to be in a folder called "bin" within the directory of the
main shi7en script.
On Jan 13, 2017 3:01 PM, "Gabe A. wrote:
As for the path thing, I think we could either try to do that or simply
ignore it for now.
If we don't want to worry about modifying the user's PATH, there's a
solution. Since the install script knows where it's putting the binaries,
the main shi7en script can call them with a relative path as long as the
binaries are in a different folder, like one called "bin".
…On Jan 13, 2017 2:56 PM, "Gabe A." ***@***.***> wrote:
Yes, I'll add those, hopefully this weekend!
Thanks as always!
On Jan 12, 2017 6:04 PM, "Kaiwei Ang" ***@***.***> wrote:
> Do we need to help the user to add the binaries to the $PATH within the
> install script?
> Besides, the mac version binaries are not in the release downloads. Do we
> need to add them?
> @GabeAl <https://github.com/GabeAl> @bhillmann
> <https://github.com/bhillmann>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AHrXBrwV6y_Mh41eOVdF2Tbo_strivs6ks5rRr-lgaJpZM4LIFWh>
> .
>
|
@kaiweiang I agree, not having the Mac binaries would make testing on a Mac difficult. Thankfully, you're more than a tester, you're a developer. 8) |
What does this do, and is it compatible with a conda-free, env-free, package-free installation?
Thanks! |
I believe so as this is the proper way to access a package's data files (In this case, the adapters) at runtime. |
This is through 'pip' and not conda. So this will only work with the pip installation of the package and not as a standalone script. |
-rename shi7 trimmer binary (so that user doesn't have to)
-Include hyperlink to correct binary download on installation page
-show all steps involved (putting it in a bin folder, adding that to path)
The text was updated successfully, but these errors were encountered: