Skip to content

Commit

Permalink
Housekeeping (#26)
Browse files Browse the repository at this point in the history
* initial commit

* new: controller example in README

* new: `track_adb`, `track_cug`

* cleanup: progress tracker

* revive branch with more cleanup

build workflow will most likely hang due to dead runners

* temp: use `housekeeping` branch name

* cleanup notebook

* cleanup notebook (again)

* checkpoint

* checkpoint

* checkpoint

* bump

* remove: imdb dump

too large for test purposes

* fix rich color

* fix tests

* Update test_adapter.py

* Update test_adapter.py

* update tests

* update notebooks

* fix arangorestore

* fix arangorestore (2)

* fix isort

* cleanup

* new: coveralls

* more cleanup

* Update README.md

* bump

* update notebook

* cleanup workflows

* lock python-arango

* update release action

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* migrate to `pyproject.toml`

* fix lint

* Update config.yml

* add `tests` to `mypy`

* optimize: `__process_adb_vertex`

* update `prepare_adb_vertex` docstring
  • Loading branch information
aMahanna committed Nov 22, 2023
1 parent 1887ddc commit f5efa8f
Show file tree
Hide file tree
Showing 25 changed files with 6,254 additions and 2,451 deletions.
44 changes: 35 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ workflows:
python_ci:
jobs:
- lint
- test
- test:
matrix:
parameters:
python_version: ["3.9", "3.10"]

# orbs:
# coveralls: coveralls/[email protected]

jobs:
lint:
Expand All @@ -13,58 +19,78 @@ jobs:
resource_class: gpu.nvidia.small.multi
steps:
- checkout

- restore_cache:
key: pip-and-local-cache

- run:
name: Setup Python 3.10
command: pyenv install 3.10 && pyenv global 3.10

- run:
name: Install Dependencies
command: |
pip install --upgrade pip setuptools setuptools-scm wheel
pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11 cugraph-cu11
pip install ".[dev]"
- run:
name: Run black
command: black --check --verbose --diff --color --config=pyproject.toml ./adbcug_adapter ./tests/

- run:
name: Run flake8
command: flake8 ./adbcug_adapter ./tests

- run:
name: Run isort
command: isort --check ./adbcug_adapter ./tests/
# - run:
# name: Run mypy
# command: mypy ./adbcug_adapter ./tests

- run:
name: Run flake8
command: flake8 ./adbcug_adapter ./tests
name: Run mypy
command: mypy ./adbcug_adapter ./tests

- save_cache:
key: pip-and-local-cache
paths:
- ~/.local
- ~/.cache/pip

test:
parameters:
python_version:
type: string
machine:
image: linux-cuda-11:default
resource_class: gpu.nvidia.small.multi
steps:
- checkout

- restore_cache:
key: pip-and-local-cache

- run:
name: Setup Python 3.10
command: pyenv install 3.10 && pyenv global 3.10
name: Setup Python
command: |
pyenv install << parameters.python_version >>
pyenv global << parameters.python_version >>
- run:
name: Install Dependencies
command: |
pip install --upgrade pip setuptools setuptools-scm wheel
pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11 cugraph-cu11
pip install ".[dev]"
- run:
name: Setup Docker
command: |
sudo systemctl start docker
docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD= arangodb/arangodb
docker start adb
- run:
name: Run PyTest
command: pytest --cov=adbcug_adapter --cov-report xml --cov-report term-missing -v --color=yes --no-cov-on-fail --code-highlight=yes
command: pytest --cov=adbcug_adapter --cov-report xml --cov-report term-missing -v --color=yes --no-cov-on-fail --code-highlight=yes --cov-fail-under=75

# - coveralls/upload
2 changes: 1 addition & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/build.yml

This file was deleted.

101 changes: 33 additions & 68 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,45 @@ on:
workflow_dispatch:
release:
types: [published]
env:
PACKAGE_DIR: adbcug_adapter
TESTS_DIR: tests
jobs:
build:
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
include:
- python: "3.7"
DB_NAME: "py37"

- python: "3.8"
DB_NAME: "py38"

- python: "3.9"
DB_NAME: "py39"
name: gpu
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
- name: Publish to coveralls.io
if: matrix.python == '3.8'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: conda run -n ${{ matrix.python }} coveralls --service=github

release:
needs: build
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}
name: release
runs-on: ubuntu-latest
name: Release package
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Fetch complete history for all tags and branches
run: git fetch --prune --unshallow
- name: Setup python
uses: actions/setup-python@v2

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Conda Build
run: |
source ~/anaconda3/etc/profile.d/conda.sh
conda activate condabuild39
anaconda logout
conda config --set anaconda_upload yes
conda-build --token '${{ secrets.CONDA_TOKEN }}' --user arangodb .
python-version: "3.10"

- name: Install release packages
run: pip install setuptools wheel twine setuptools-scm[toml]

- name: Build distribution
run: python setup.py sdist bdist_wheel

- name: Publish to Test PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: twine upload --repository testpypi dist/* #--skip-existing

- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --repository pypi dist/* #--skip-existing

changelog:
needs: release
runs-on: ubuntu-latest
name: changelog
name: Update Changelog
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -88,10 +53,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup python
uses: actions/setup-python@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Install release packages
run: pip install wheel gitchangelog pystache
Expand All @@ -103,12 +68,12 @@ jobs:
run: gitchangelog ${{env.VERSION}} > CHANGELOG.md

- name: Make commit for auto-generated changelog
uses: EndBug/add-and-commit@v7
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
add: "CHANGELOG.md"
branch: actions/changelog
new_branch: actions/changelog
message: "!gitchangelog"

- name: Create pull request for the auto generated changelog
Expand Down
Loading

0 comments on commit f5efa8f

Please sign in to comment.