Skip to content

Commit f56bf2c

Browse files
James RobinsonElijah Wilson
andauthored
Refactor to noteable pkg (#101)
* Rename package to noteable * Touchups * Changelog * Fix tests invocations. * More renaming * isort --------- Co-authored-by: Elijah Wilson <[email protected]>
1 parent a93b5c5 commit f56bf2c

32 files changed

+71
-77
lines changed

.github/workflows/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252

5353
# Run all of the tests
5454
- name: Flake8 - Style guide enforcement
55-
run: poetry run flake8 noteable_magics/ tests/ --count --show-source --statistics --benchmark
55+
run: poetry run flake8 noteable/ tests/ --count --show-source --statistics --benchmark
5656
if: ${{ matrix.python-version == 3.9 }}
5757

5858
- name: Black - Format check
59-
run: poetry run black --diff noteable_magics/ tests/
59+
run: poetry run black --diff noteable/ tests/
6060
if: ${{ matrix.python-version == 3.9 }}
6161

6262
- name: Isort - Import format check
63-
run: poetry run isort --diff --check noteable_magics/ tests/
63+
run: poetry run isort --diff --check noteable/ tests/
6464
if: ${{ matrix.python-version == 3.9 }}
6565

6666
- name: Safety - Python dependency vulnerability check

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- `%%sql @e456456 my_df << select a, b, c from foo` variable assignment syntax will now always return the resulting dataframe as well as silently assign to the interpreter variable (`my_df` in this case) as side-effect. Previously would only assign to the interpreter variable and announce the fact with a print(), while having no return result.
1515
- Now use jinjasql for SQL cell template expansion, not simple string.Template.
1616
- Simpler message printed as the cell's side-effect if an unknown datasource handle is attempted.
17+
- Repackaged all code to be in 'noteable' toplevel package, not 'noteable_magics.'
1718

1819
## [2.0.0] - 2022-03-15
1920
### Changed

noteable_magics/__init__.py renamed to noteable/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pkg_resources
22

3-
__version__ = pkg_resources.get_distribution("noteable_magics").version
3+
__version__ = pkg_resources.get_distribution("noteable").version
44

55
from .data_loader import LOCAL_DB_CONN_HANDLE, NoteableDataLoaderMagic, get_db_connection
66
from .datasources import bootstrap_datasources
@@ -11,7 +11,6 @@
1111

1212

1313
def load_ipython_extension(ipython):
14-
1514
# Initialize any remote datasource connections
1615
bootstrap_datasources()
1716

File renamed without changes.

noteable_magics/data_loader.py renamed to noteable/data_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from traitlets import Bool, Int
99
from traitlets.config import Configurable
1010

11-
from noteable_magics.sql.connection import Connection
11+
from noteable.sql.connection import Connection
1212

1313
EXCEL_MIMETYPES = {
1414
"application/vnd.ms-excel", # .xls

noteable_magics/datasources.py renamed to noteable/datasources.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
from sqlalchemy.engine import URL
1111

1212
# ipython-sql thinks mighty highly of isself with this package name.
13-
import noteable_magics.sql.connection
14-
from noteable_magics.sql.run import add_commit_blacklist_dialect
13+
import noteable.sql.connection
14+
from noteable.sql.run import add_commit_blacklist_dialect
1515

1616
DEFAULT_SECRETS_DIR = Path('/vault/secrets')
1717

18-
from noteable_magics.datasource_postprocessing import post_processor_by_drivername
18+
from noteable.datasource_postprocessing import post_processor_by_drivername
1919

2020
logger = structlog.get_logger(__name__)
2121

@@ -103,7 +103,7 @@ def bootstrap_datasource(
103103
)
104104

105105
# Remember the failure so can be shown if / when human tries to use the connection.
106-
noteable_magics.sql.connection.Connection.add_bootstrapping_failure(
106+
noteable.sql.connection.Connection.add_bootstrapping_failure(
107107
datasource_id, human_name, str(e)
108108
)
109109

@@ -133,7 +133,7 @@ def bootstrap_datasource(
133133

134134
# Teach ipython-sql about the connection!
135135
try:
136-
noteable_magics.sql.connection.Connection.set(
136+
noteable.sql.connection.Connection.set(
137137
connection_url,
138138
name=f'@{datasource_id}',
139139
human_name=human_name,
@@ -154,7 +154,7 @@ def bootstrap_datasource(
154154
)
155155

156156
# Remember the failure so can be shown if / when human tries to use the connection.
157-
noteable_magics.sql.connection.Connection.add_bootstrapping_failure(
157+
noteable.sql.connection.Connection.add_bootstrapping_failure(
158158
datasource_id, human_name, str(e)
159159
)
160160

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)