Skip to content

Commit

Permalink
Housekeeping (#13)
Browse files Browse the repository at this point in the history
* cleanup `release.yml`

* add python 3.11 & 3.12 to ci matrix

* cleanup README

* cleanup tests

* cleanup: `arango_datasets`

* rename test file

* cleanup: `create_graph`

* cleanup `datasets.py`
  • Loading branch information
aMahanna committed Jan 2, 2024
1 parent 753a5bc commit 1e23ba4
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 368 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: Lint - Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: Test - Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
Expand Down
61 changes: 5 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,7 @@ env:
PACKAGE_DIR: arango_datasets
TESTS_DIR: tests
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
name: Lint - Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: pip install .[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: Run bandit
run: bandit --exclude "./tests/*" -r ./
test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
name: Test - Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Set up ArangoDB Instance via Docker
run: docker create --name adb -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb/arangodb:3.10.0
- name: Start ArangoDB Instance
run: docker start adb
- name: Setup pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install packages
run: pip install .[dev]
- 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 --cov-fail-under=75

release:
needs: [lint, test]
runs-on: ubuntu-latest
name: Release package
steps:
Expand All @@ -66,24 +17,22 @@ jobs:
run: git fetch --prune --unshallow

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

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

- name: Install dependencies
run: pip install .[dev]
run: pip install build twine

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

- name: Publish to PyPI Test
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__
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Package for loading example datasets into an ArangoDB Instance.

```py
from arango_datasets.datasets import Datasets
from arango import ArangoClient
from arango_datasets import Datasets

# Datasets requires a valid database object
db = ArangoClient(hosts='http://localhost:8529').db("dbName", username="root", password="")

datasets = Datasets(db)

# list available datasets
# List available datasets
datasets.list_datasets()

# list more information about the dataset files and characteristics
#datasets.dataset_info("IMDB_X")
# List more information about a particular dataset
datasets.dataset_info("IMDB_X")

# Import the dataset
# datasets.load("IMDB_X")
datasets.load("IMDB_X")
```
1 change: 1 addition & 0 deletions arango_datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from arango_datasets.datasets import Datasets # noqa: F401
Loading

0 comments on commit 1e23ba4

Please sign in to comment.