From d7e8c86be62aa94d0a72f0dd75c7145b25a02418 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 19 May 2021 12:46:05 +0800 Subject: [PATCH 1/3] feat: add requirements and cache in actions fix: 10s is not enough in ACTION --- .github/workflows/run_test.yaml | 14 +++++++++++--- README.md | 10 +++++++++- requirements-dev.txt | 8 ++++++++ requirements.txt | 5 +++++ 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index 0d3e179b..7ef190c7 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -20,10 +20,19 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Configure pip cache + uses: actions/cache@v1 + id: pip-cache + with: + path: venv + key: pip-1-${{ hashFiles('**/requirements-dev.txt') }} + restore-keys: | + pip- - name: Install dependencies run: | python -m pip install --upgrade pip - pip install django-import-export future futures six gevent prettytable pytest + pip install -r requirements-dev.txt + if: steps.pip-cache.outputs.cache-hit != 'true' - name: Test with pytest run: | mkdir tmp @@ -32,9 +41,8 @@ jobs: pushd nebula-docker-compose/ cp ../../tests/docker-compose.yaml ./ docker-compose up -d - sleep 10 + sleep 60 popd popd cd tests pytest -s -v - diff --git a/README.md b/README.md index 5cbc5bb1..b94cb414 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,15 @@ When your environment cannot access `pypi`, you need to install the following pa - httplib2 - futures # python2.x is needed +or +``` +pip install -r requirements.txt +``` +dev version +``` +pip install -r requirements-dev.txt +``` + ### Option two: using pip ```python @@ -143,4 +152,3 @@ while resp.has_next(): | 2.0.0.post1 | 2.0.0beta | | 2.0.0rc1 | 2.0.0-rc1 | | 2.0.0 | >= 2.0.0 | - diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..020aeec4 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,8 @@ +django-import-export +future +six +httplib2 +futures; python_version < '3.0' +gevent +prettytable +pytest \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..8411fe59 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +django-import-export +future +six +httplib2 +futures; python_version < '3.0' \ No newline at end of file From e8bf50714dd762e2c7a8eccd7182aff673395a37 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 19 May 2021 13:29:49 +0800 Subject: [PATCH 2/3] fix: drop cache --- .github/workflows/run_test.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index 7ef190c7..7e119904 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -20,19 +20,10 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Configure pip cache - uses: actions/cache@v1 - id: pip-cache - with: - path: venv - key: pip-1-${{ hashFiles('**/requirements-dev.txt') }} - restore-keys: | - pip- - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt - if: steps.pip-cache.outputs.cache-hit != 'true' - name: Test with pytest run: | mkdir tmp From 542c4005b08ce1c0ace4e38f64cf4c5d04aa4a54 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 19 May 2021 14:48:30 +0800 Subject: [PATCH 3/3] fix: delete useless info in README --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index b94cb414..2d48bee4 100644 --- a/README.md +++ b/README.md @@ -54,19 +54,12 @@ sudo python3 setup.py install When your environment cannot access `pypi`, you need to install the following packages manually. -- django-import-export -- future -- six -- httplib2 -- futures # python2.x is needed - -or ``` pip install -r requirements.txt ``` dev version ``` -pip install -r requirements-dev.txt +pip install -r requirements.txt ``` ### Option two: using pip