Skip to content

Commit c159253

Browse files
author
Charles Larivier
committed
refactor: move package under src/
Signed-off-by: Charles Larivier <charles@dribbble.com>
1 parent c592637 commit c159253

26 files changed

+20
-32
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,4 @@ cython_debug/
141141

142142

143143
.idea/
144-
/metabase/_version.py
144+
/src/metabase/_version.py

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
name="metabase-python",
1111
use_scm_version={
1212
"local_scheme": "dirty-tag",
13-
"write_to": "metabase/_version.py",
13+
"write_to": "src/metabase/_version.py",
1414
"fallback_version": "0.0.0",
1515
},
1616
description="A Python wrapper for interacting with Metabase's API.",
@@ -19,9 +19,8 @@
1919
author="Charles Lariviere",
2020
author_email="charleslariviere1@gmail.com ",
2121
url="https://github.com/chasleslr/metabase-python",
22-
packages=find_packages("metabase"),
23-
package_dir={"": "metabase"},
24-
py_modules=[splitext(basename(path))[0] for path in glob("metabase/*.py")],
22+
packages=find_packages("src"),
23+
package_dir={"": "src"},
2524
include_package_data=True,
2625
zip_safe=False,
2726
classifiers=[
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

metabase/resource.py renamed to src/metabase/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

3-
from exceptions import NotFoundError
43
from requests import HTTPError
54

65
from metabase import Metabase
6+
from metabase.exceptions import NotFoundError
77
from metabase.missing import MISSING
88

99

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/resources/test_database.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
from exceptions import NotFoundError
2-
3-
from metabase import Database
4-
from metabase.resources.field import Field
5-
from metabase.resources.table import Table
1+
from metabase import Database, Field, Table
2+
from metabase.exceptions import NotFoundError
63
from tests.helpers import IntegrationTestCase
74

85

tests/resources/test_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from metabase.resources.field import Field
1+
from metabase import Field
22
from tests.helpers import IntegrationTestCase
33

44

tests/resources/test_metric.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from exceptions import NotFoundError
2-
3-
from metabase.resources.metric import Metric
1+
from metabase import Metric
2+
from metabase.exceptions import NotFoundError
43
from tests.helpers import IntegrationTestCase
54

65

tests/resources/test_permission_group.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from exceptions import NotFoundError
2-
3-
from metabase import PermissionGroup, PermissionMembership
1+
from metabase import PermissionGroup
2+
from metabase.exceptions import NotFoundError
43
from tests.helpers import IntegrationTestCase
54

65

tests/resources/test_permission_membership.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from exceptions import NotFoundError
2-
31
from metabase import PermissionGroup, PermissionMembership
42
from tests.helpers import IntegrationTestCase
53

tests/resources/test_segment.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from exceptions import NotFoundError
2-
3-
from metabase.resources.segment import Segment
1+
from metabase import Segment
2+
from metabase.exceptions import NotFoundError
43
from tests.helpers import IntegrationTestCase
54

65

tests/resources/test_table.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from resources.segment import Segment
2-
3-
from metabase.resources.field import Field
4-
from metabase.resources.metric import Metric
1+
from metabase import Field, Metric
2+
from metabase.resources.segment import Segment
53
from metabase.resources.table import Dimension, Table
64
from tests.helpers import IntegrationTestCase
75

tests/resources/test_user.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from random import randint
22

3-
from exceptions import NotFoundError
4-
5-
from metabase.resources.user import User
3+
from metabase import User
4+
from metabase.exceptions import NotFoundError
65
from tests.helpers import IntegrationTestCase
76

87

tests/test_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from unittest.mock import patch
22

3-
from exceptions import NotFoundError
43
from requests import HTTPError
54

6-
from metabase.metabase import Metabase
5+
from metabase import Metabase
6+
from metabase.exceptions import NotFoundError
77
from metabase.missing import MISSING
88
from metabase.resource import (
99
CreateResource,

0 commit comments

Comments
 (0)