-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging/ca-0.5.1' into 'master' See merge request persper/code-analytics!132
- Loading branch information
Showing
17 changed files
with
443 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,13 @@ stages: | |
|
||
test_ci: | ||
stage: test | ||
image: ubuntu:18.04 | ||
image: hub.meri.dev/test-docker/test:latest | ||
# only: | ||
# - setup-ci | ||
before_script: | ||
- apt update && apt install -y openssh-client wget libarchive-dev libcurl4-openssl-dev git python3.7 python3-pip | ||
- apt update && apt install -y libarchive-dev #libcurl4-openssl-dev | ||
- apt install -y zlib1g-dev libicu-dev libcurl3 libcurl-openssl1.0-dev | ||
- apt install -y build-essential cmake libssl-dev pkg-config cmake | ||
- wget http://131.123.42.38/lmcrs/beta/srcML-Ubuntu18.04.deb | ||
- dpkg -i srcML-Ubuntu18.04.deb | ||
- mkdir -p ~/.ssh | ||
|
@@ -22,11 +24,9 @@ test_ci: | |
- export LC_ALL=C.UTF-8 | ||
- export LANG=C.UTF-8 | ||
script: | ||
- apt-get update | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "merico" | ||
- pip3 install pipenv | ||
|
||
- echo -e "machine gitlab.com\nlogin ${GITLAB_USER}\npassword ${GITLAB_PASSWD}" > ~/.netrc | ||
- git clone https://gitlab.com/persper/code-analytics.git && cd code-analytics | ||
#&& git checkout ${CI_COMMIT_REF_NAME} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ aenum = "*" | |
pytest-cov = "*" | ||
gitpython = "*" | ||
sphinx = "*" | ||
python-louvain = "*" | ||
|
||
[dev-packages] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,21 @@ The following procedure is tested on Ubuntu 16.04 LTS. | |
Download and install Python 3.6+: <https://www.python.org/downloads/>. | ||
|
||
Also, create a symbolic link from `python3` to `python` since some scripts reply on it. | ||
``` | ||
```sh | ||
sudo ln -s /usr/bin/python3 /usr/bin/python | ||
``` | ||
|
||
2. Install python dependencies (we recommend to use pipenv) | ||
|
||
```bash | ||
```sh | ||
pipenv install | ||
``` | ||
|
||
3. Update git | ||
|
||
In order to uset the `--indent-heuristic` option of `git diff`, we require git version >= 2.11. Use the following commands to upgrade: | ||
|
||
```bash | ||
```sh | ||
sudo add-apt-repository ppa:git-core/ppa -y | ||
sudo apt-get update | ||
sudo apt-get install git -y | ||
|
@@ -40,12 +40,12 @@ git --version | |
|
||
Add the following line to your `~/.bashrc` file. | ||
|
||
``` | ||
```sh | ||
export PYTHONPATH=$PYTHONPATH:/path/to/dir | ||
``` | ||
|
||
To update your path for the remainder of the session. | ||
``` | ||
```sh | ||
source ~/.bashrc | ||
``` | ||
|
||
|
@@ -55,14 +55,21 @@ Please download from [here](https://www.srcml.org/#download) and follow the [ins | |
|
||
srcML also needs `libarchive-dev` and `libcurl4-openssl-dev`. Install them with the following commands: | ||
|
||
```bash | ||
```sh | ||
sudo apt install libarchive-dev | ||
sudo apt install libcurl4-openssl-dev | ||
``` | ||
|
||
6. Check setup correctness | ||
|
||
```bash | ||
As the test process will create Git repositories, set up your global Git user name and email before testing: | ||
```sh | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
``` | ||
|
||
Run the test process: | ||
```sh | ||
pipenv run pytest test/test_analytics | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# import deps\n", | ||
"import os\n", | ||
"from persper.analytics.c import CGraphServer\n", | ||
"from persper.analytics.analyzer2 import Analyzer\n", | ||
"from persper.analytics.graph_server import C_FILENAME_REGEXES\n", | ||
"from persper.util.path import root_path" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# configure your project\n", | ||
"repo_path = os.path.join(root_path, 'repos/<your_repo_name>')\n", | ||
"\n", | ||
"# configure alpha for devrank\n", | ||
"alpha = 0.5" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# start analysis and show commit devrank values\n", | ||
"az = Analyzer(repo_path, CGraphServer(C_FILENAME_REGEXES))\n", | ||
"await az.analyze()\n", | ||
"ccgraph = az.graph\n", | ||
"ccgraph.commit_devranks(alpha)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "code-analytics-8iDyuztf", | ||
"language": "python", | ||
"name": "code-analytics-8idyuztf" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.