Skip to content

Commit a9bc00a

Browse files
author
Charles Larivier
committed
Merge branch 'feature/add-connection' into develop
2 parents 37e5a59 + d3e66fe commit a9bc00a

38 files changed

+2502
-31
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python package
4+
name: main
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches:
9+
- main
910
pull_request:
10-
branches: [ main ]
11+
branches:
12+
- main
13+
- develop
1114

1215
jobs:
1316
build:
@@ -16,19 +19,41 @@ jobs:
1619
strategy:
1720
fail-fast: false
1821
matrix:
19-
python-version: ["3.8", "3.9", "3.10"]
22+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
25+
services:
26+
metabase:
27+
image: metabase/metabase
28+
ports:
29+
- 3000:3000
2030

2131
steps:
2232
- uses: actions/checkout@v2
33+
2334
- name: Set up Python ${{ matrix.python-version }}
2435
uses: actions/setup-python@v2
2536
with:
2637
python-version: ${{ matrix.python-version }}
38+
2739
- name: Install dependencies
2840
run: |
2941
python -m pip install --upgrade pip
3042
python -m pip install pipenv
31-
pipenv install --deploy
43+
pipenv install --deploy --dev
44+
45+
- name: Wait for Metabase to be initialized
46+
run: sleep 60s
47+
shell: bash
48+
3249
- name: Test with pytest
3350
run: |
34-
pipenv run pytest
51+
pipenv run pytest --cov=./ --cov-report=xml
52+
53+
- name: Upload coverage to Codecov
54+
uses: codecov/codecov-action@v2
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
directory: ./
58+
env_vars: OS,PYTHON
59+
fail_ci_if_error: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,6 @@ dmypy.json
139139
# Cython debug symbols
140140
cython_debug/
141141

142-
.idea
142+
143+
.idea/
144+
/metabase/_version.py

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/psf/black
11+
rev: 21.11b0
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/PyCQA/isort
16+
rev: 5.10.1
17+
hooks:
18+
- id: isort

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dev:
2+
@pipenv install --dev --pre
3+
@pipenv run pre-commit install

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7+
metabase-python = {editable = true, path = "."}
78

89
[dev-packages]
910
pre-commit = "*"

Pipfile.lock

Lines changed: 530 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# Metabase Python
2+
[![main](https://github.com/chasleslr/metabase-python/actions/workflows/main.yml/badge.svg)](https://github.com/chasleslr/metabase-python/actions/workflows/main.yml)
3+
[![codecov](https://codecov.io/gh/chasleslr/metabase-python/branch/main/graph/badge.svg?token=15G7HOQ1CM)](https://codecov.io/gh/chasleslr/metabase-python)
4+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "3.9"
2+
services:
3+
metabase:
4+
image: metabase/metabase
5+
ports:
6+
- 3000:3000

metabase/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from metabase.metabase import Metabase
2+
from metabase.resources.dataset import Dataset
3+
from metabase.resources.field import Field
4+
from metabase.resources.metric import Metric
5+
from metabase.resources.permission_group import PermissionGroup
6+
from metabase.resources.permission_membership import PermissionMembership
7+
from metabase.resources.segment import Segment
8+
from metabase.resources.table import Table
9+
from metabase.resources.user import User

metabase/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class NotFoundError(Exception):
2+
pass

0 commit comments

Comments
 (0)