From ec730eacf981519e8065ba18dd267331ce565c71 Mon Sep 17 00:00:00 2001 From: Gyorgy Orban Date: Fri, 27 Jul 2018 11:34:09 +0200 Subject: [PATCH] restructure python requirements files GitHub can automatically detect vulnerabilities in 3pp dependecies if the requirements files follow the naming conventions --- .ci/osx_extra_python_requirements | 2 -- Makefile | 13 +++++++------ README.md | 3 +-- docs/authentication.md | 2 +- .../auth/requirements.txt | 0 .../db_pg8000/requirements.txt | 0 .../db_psycopg2/requirements.txt | 0 .../dev/requirements.txt | 0 requirements_py/osx/requirements.txt | 6 ++++++ .../requirements.txt | 0 tests/Makefile | 6 +++--- 11 files changed, 18 insertions(+), 14 deletions(-) delete mode 100644 .ci/osx_extra_python_requirements rename .ci/auth_requirements => requirements_py/auth/requirements.txt (100%) rename .ci/python_requirements_psql_pg8000 => requirements_py/db_pg8000/requirements.txt (100%) rename .ci/python_requirements_psql_psycopg2 => requirements_py/db_psycopg2/requirements.txt (100%) rename .ci/python_requirements => requirements_py/dev/requirements.txt (100%) create mode 100644 requirements_py/osx/requirements.txt rename .ci/basic_python_requirements => requirements_py/requirements.txt (100%) diff --git a/.ci/osx_extra_python_requirements b/.ci/osx_extra_python_requirements deleted file mode 100644 index d49bcb782e..0000000000 --- a/.ci/osx_extra_python_requirements +++ /dev/null @@ -1,2 +0,0 @@ -scan-build==2.0.10 - diff --git a/Makefile b/Makefile index b7ee4a9f7e..6ca021ad00 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,10 @@ ROOT = $(CURRENT_DIR) ACTIVATE_RUNTIME_VENV ?= . venv/bin/activate ACTIVATE_DEV_VENV ?= . venv_dev/bin/activate -VENV_REQ_FILE ?= .ci/basic_python_requirements -VENV_DEV_REQ_FILE ?= .ci/python_requirements +VENV_REQ_FILE ?= requirements_py/requirements.txt +VENV_DEV_REQ_FILE ?= requirements_py/dev/requirements.txt -OSX_EXTRAS_VENV_REQ_FILE ?= .ci/osx_extra_python_requirements +OSX_VENV_REQ_FILE ?= requirements_py/osx/requirements.txt default: package @@ -48,9 +48,10 @@ venv: virtualenv -p python2 venv && \ $(ACTIVATE_RUNTIME_VENV) && pip install -r $(VENV_REQ_FILE) -add_osx_extras_to_venv: - # Run the extra build package. - $(ACTIVATE_RUNTIME_VENV) && pip install -r $(OSX_EXTRAS_VENV_REQ_FILE) +venv_osx: + # Create a virtual environment which can be used to run the build package. + virtualenv -p python2 venv && \ + $(ACTIVATE_RUNTIME_VENV) && pip install -r $(OSX_VENV_REQ_FILE) clean_venv: rm -rf venv diff --git a/README.md b/README.md index e97cda0507..621ccdc2f6 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,7 @@ git clone https://github.com/Ericsson/CodeChecker.git --depth 1 ~/codechecker cd ~/codechecker # Create a Python virtualenv and set it as your environment. -make venv -make add_osx_extras_to_venv +make venv_osx source $PWD/venv/bin/activate # Build and install a CodeChecker package. diff --git a/docs/authentication.md b/docs/authentication.md index efbed344cc..35692662bd 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -116,7 +116,7 @@ sudo apt-get install libldap2-dev libsasl2-dev libssl-dev source ~/checker_env/bin/activate # install required python modules -pip install -r .ci/auth_requirements +pip install -r requirements_py/auth/requirements.txt ~~~ #### PAM authentication diff --git a/.ci/auth_requirements b/requirements_py/auth/requirements.txt similarity index 100% rename from .ci/auth_requirements rename to requirements_py/auth/requirements.txt diff --git a/.ci/python_requirements_psql_pg8000 b/requirements_py/db_pg8000/requirements.txt similarity index 100% rename from .ci/python_requirements_psql_pg8000 rename to requirements_py/db_pg8000/requirements.txt diff --git a/.ci/python_requirements_psql_psycopg2 b/requirements_py/db_psycopg2/requirements.txt similarity index 100% rename from .ci/python_requirements_psql_psycopg2 rename to requirements_py/db_psycopg2/requirements.txt diff --git a/.ci/python_requirements b/requirements_py/dev/requirements.txt similarity index 100% rename from .ci/python_requirements rename to requirements_py/dev/requirements.txt diff --git a/requirements_py/osx/requirements.txt b/requirements_py/osx/requirements.txt new file mode 100644 index 0000000000..9836ba1439 --- /dev/null +++ b/requirements_py/osx/requirements.txt @@ -0,0 +1,6 @@ +alembic==0.9.2 +portalocker==1.1.0 +psutil==5.2.2 +sqlalchemy==1.1.11 +thrift==0.9.1 +scan-build==2.0.10 diff --git a/.ci/basic_python_requirements b/requirements_py/requirements.txt similarity index 100% rename from .ci/basic_python_requirements rename to requirements_py/requirements.txt diff --git a/tests/Makefile b/tests/Makefile index 864c262f9c..75bbd1913e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -111,13 +111,13 @@ test_clean: rm -rf build/workspace # Use the proper requirement file for the given test configuration -test_matrix_sqlite: VENV_DEV_REQ_FILE = .ci/basic_python_requirements +test_matrix_sqlite: VENV_DEV_REQ_FILE = requirements_py/requirements.txt test_matrix_sqlite: pycodestyle test_unit test_sqlite -test_matrix_psql_psycopg2: VENV_DEV_REQ_FILE = .ci/python_requirements_psql_psycopg2 +test_matrix_psql_psycopg2: VENV_DEV_REQ_FILE = requirements_py/db_psycopg2/requirements.txt test_matrix_psql_psycopg2: pycodestyle test_unit test_psql_psycopg2 -test_matrix_psql_pg8000: VENV_DEV_REQ_FILE = .ci/python_requirements_psql_pg8000 +test_matrix_psql_pg8000: VENV_DEV_REQ_FILE = requirements_py/db_pg8000/requirements.txt test_matrix_psql_pg8000: pycodestyle test_unit test_psql_pg8000 clean_travis: