-
Notifications
You must be signed in to change notification settings - Fork 17
Add installation script #107
base: develop
Are you sure you want to change the base?
Add installation script #107
Conversation
regarding #106 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This might better named install
or configure. I would much prefer using the scancode-toolkit config style here too
installation.sh
Outdated
@@ -0,0 +1,5 @@ | |||
#!/bin/bash | |||
virtualenv -q -p /usr/bin/python3.5 scancode-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaa, I'll see it and make required changes!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use the long form in the script please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done that!!
installation.sh
Outdated
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this echo? what does it bring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
install.sh
Outdated
@@ -0,0 +1,4 @@ | |||
#!/bin/bash | |||
virtualenv --quiet --python=/usr/bin/python2.7 scancode-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is fine. But I would rather have a proper ./configure, scancode-toolkit style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
|
configure.sh
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could insert a newline.
etc/configure.py
Outdated
|
||
|
||
def create_venv(): | ||
venv_dir = os.path.join(req_path, ".scancode-server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be consistent with the quotations ? Either "
(double quotes) everywhere or '
(single quotes) everywhere ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use single quote everywhere unless this is a doc string (or if the string contains single quotes)
etc/configure.py
Outdated
@@ -0,0 +1,29 @@ | |||
import subprocess | |||
import os | |||
import virtualenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could have alphabetically sorted imports and according to the python style guide ?
Signed-off-by: Chetanya <[email protected]>
Signed-off-by: Chetanya <[email protected]>
|
@pombredanne Its been a while since the pr was opened. @singh1114 plz review. |
run using
source ./installation.sh
It will do following things:
scancode-server
Signed-off-by: chetanya-shrimali [email protected]