Add installation script#107
Conversation
|
regarding #106 |
pombredanne
left a comment
There was a problem hiding this comment.
Thanks!
This might better named install or configure. I would much prefer using the scancode-toolkit config style here too
| @@ -0,0 +1,5 @@ | |||
| #!/bin/bash | |||
| virtualenv -q -p /usr/bin/python3.5 scancode-server | |||
There was a problem hiding this comment.
We are not using Python 3 for this project, but only Python 2.7 for as long as ScanCode proper is nt ported to Python 3
Also, what are -q and -p options? long form are better
Also this is not portable on Windows, is it?
I would much prefer that we adopt the configure script from scancode https://github.com/nexB/scancode-toolkit/blob/f8132b344ba3a700907c41038e3d663002bbac63/configure ... Can you look into this?
There was a problem hiding this comment.
yaa, I'll see it and make required changes!!
There was a problem hiding this comment.
sorry about -q and -p part, -q is for quiet and -p is an option to decide the python interpreter to create virtual env which requires python root directory as an argument.
There was a problem hiding this comment.
Just use the long form in the script please.
| virtualenv -q -p /usr/bin/python3.5 scancode-server | ||
| source scancode-server/bin/activate | ||
| pip install -r requirements.txt | ||
| echo "source scancode-server/bin/activate" No newline at end of file |
There was a problem hiding this comment.
Why this echo? what does it bring?
There was a problem hiding this comment.
that was a mistake. I'll remove it!! 😉
|
|
|
The point is not it executes, but that it pass the tests on Python3. If you can install and pass the tests of https://github.com/nexB/scancode-toolkit on Python3 that would be news to me. |
|
@pombredanne That was the problem we discussed earlier regarding issue #100 in pr #105. And finalized that we have to consider that the user has already installed |
|
scancode-toolkit DOES NOT RUN on Python3, therefore scancode-server that depends on scancode-toolkit CANNOT RUN on Python3, simple. |
|
@pombredanne Pardon, but i changed it to Python 2.7 😓 |
|
@pombredanne plz review! |
| @@ -0,0 +1,4 @@ | |||
| #!/bin/bash | |||
| virtualenv --quiet --python=/usr/bin/python2.7 scancode-server | |||
There was a problem hiding this comment.
Where do you get virtualenv from?
Could you try to see how the scancode-toolkit configure script works and use this instead?
There was a problem hiding this comment.
Okk!! @pombredanne i will see to how that works! but plz let me know the problem this code. Like it does what we want it to.
There was a problem hiding this comment.
This script is fine. But I would rather have a proper ./configure, scancode-toolkit style
There was a problem hiding this comment.
ok!! will work on that!
|
@pombredanne The error is at line 11 of |
|
Thanks. I think you have copied too much from scancode etc/ ..... take only what is strictly needed. Not everything. What is |
|
Thanks!. what is the etc/configure2.py file in the commits? |
|
And what are the changes you made to the original script? |
|
This is not the final commit 😅 |
9322b9d to
a5e6828
Compare
|
@pombredanne plz review. I will document it after we reach on a common solution. Thanks! |
|
Thanks! |
| python2.7 "$CONFIGURE_ROOT_DIR/etc/ConfigureScript.py" | ||
| if [ -f "$CONFIGURE_ROOT_DIR/.scancode-server/bin/activate" ]; then | ||
| source $CONFIGURE_ROOT_DIR/.scancode-server/bin/activate | ||
| fi No newline at end of file |
There was a problem hiding this comment.
It would be great if you could insert a newline.
|
|
||
|
|
||
| def create_venv(): | ||
| venv_dir = os.path.join(req_path, ".scancode-server") |
There was a problem hiding this comment.
Can we be consistent with the quotations ? Either "(double quotes) everywhere or '(single quotes) everywhere ?
There was a problem hiding this comment.
we use single quote everywhere unless this is a doc string (or if the string contains single quotes)
| @@ -0,0 +1,29 @@ | |||
| import subprocess | |||
| import os | |||
| import virtualenv | |||
There was a problem hiding this comment.
Maybe we could have alphabetically sorted imports and according to the python style guide ?
Signed-off-by: Chetanya <chetanyashrimalie5@gmail.com>
Signed-off-by: Chetanya <chetanyashrimalie5@gmail.com>
|
|
|
@pombredanne Its been a while since the pr was opened. @singh1114 plz review. |

run using
source ./installation.shIt will do following things:
scancode-serverSigned-off-by: chetanya-shrimali chetanyashrimalie5@gmail.com