Skip to content

Commit

Permalink
Merge branch 'housekeeping' of https://github.com/arangoml/cugraph-ad…
Browse files Browse the repository at this point in the history
…apter into housekeeping
  • Loading branch information
aMahanna committed Oct 16, 2023
2 parents abde401 + 7a34b66 commit d5cb742
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 39 deletions.
59 changes: 32 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,45 @@ env:
TESTS_DIR: tests
jobs:
build:
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
include:
- python: "3.7"
DB_NAME: "py37"

- python: "3.8"
DB_NAME: "py38"
container: "rapidsai/rapidsai:cuda11.8-runtime-ubuntu22.04-py3.8"

- python: "3.9"
DB_NAME: "py39"
name: gpu
container: "rapidsai/rapidsai:cuda11.8-runtime-ubuntu22.04-py3.9"

- python: "3.10"
container: "rapidsai/rapidsai:cuda11.8-runtime-ubuntu22.04-py3.10"

name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Set up pip & install packages
run: |
source ~/anaconda3/etc/profile.d/conda.sh
conda activate ${{ matrix.python }}
python -m pip install --upgrade pip setuptools wheel
pip install .[dev]
- name: Run black
run: conda run -n ${{ matrix.python }} black --check --verbose --diff --color ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
- name: Run flake8
run: flake8 ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
- name: Run isort
run: isort --check --profile=black ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
- name: Run mypy
run: conda run -n ${{ matrix.python }} mypy ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
- name: Run pytest in conda env
run: conda run -n ${{ matrix.python }} pytest --dbName ${{ matrix.DB_NAME }} --cov=${{env.PACKAGE_DIR}} --cov-report xml --cov-report term-missing -v --color=yes --no-cov-on-fail --code-highlight=yes
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: pip install -e '.[dev]'
# - name: Run black
# run: black --check --verbose --diff --color ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
# - name: Run flake8
# run: flake8 ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
# - name: Run isort
# run: isort --check --profile=black ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
# - name: Run mypy
# run: mypy ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}}
# - name: Setup Docker
# uses: docker/setup-buildx-action@v2.8.0
# - name: Set up ArangoDB Instance via Docker
# run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb
# - name: Start ArangoDB Instance
# run: docker start adb
- name: Run pytest
run: pytest --cov=${{env.PACKAGE_DIR}} --cov-report xml --cov-report term-missing -v --color=yes --no-cov-on-fail --code-highlight=yes
- name: Publish to coveralls.io
if: matrix.python == '3.8'
env:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@
"pytest-cov>=2.0.0",
"coveralls>=3.3.1",
"types-setuptools",
"adb-cloud-connector",
],
},
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Utilities",
"Typing :: Typed",
],
Expand Down
26 changes: 15 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path
from typing import Any, List, Optional

from adb_cloud_connector import get_temp_credentials
from arango import ArangoClient
from arango.database import StandardDatabase
from cudf import DataFrame
Expand All @@ -22,20 +23,23 @@
likes_adbcug_adapter: ADBCUG_Adapter


def pytest_addoption(parser: Any) -> None:
parser.addoption("--url", action="store", default="http://localhost:8529")
parser.addoption("--dbName", action="store", default="_system")
parser.addoption("--username", action="store", default="root")
parser.addoption("--password", action="store", default="")
# def pytest_addoption(parser: Any) -> None:
# parser.addoption("--url", action="store", default="http://localhost:8529")
# parser.addoption("--dbName", action="store", default="_system")
# parser.addoption("--username", action="store", default="root")
# parser.addoption("--password", action="store", default="")


def pytest_configure(config: Any) -> None:
con = {
"url": config.getoption("url"),
"username": config.getoption("username"),
"password": config.getoption("password"),
"dbName": config.getoption("dbName"),
}
# con = {
# "url": config.getoption("url"),
# "username": config.getoption("username"),
# "password": config.getoption("password"),
# "dbName": config.getoption("dbName"),
# }

# temporary workaround for build.yml purposes
con = get_temp_credentials()

print("----------------------------------------")
print("URL: " + con["url"])
Expand Down

0 comments on commit d5cb742

Please sign in to comment.