Skip to content

Commit 5d1cca6

Browse files
committed
update
1 parent f3df0d6 commit 5d1cca6

File tree

7 files changed

+87
-21
lines changed

7 files changed

+87
-21
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [master,dev]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.6, 3.7, 3.8, 3.9]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install devDependence
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install mypy pycodestyle coverage lxml
29+
- name: Install dependencies
30+
run: |
31+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32+
- name: Lint with pep8
33+
run: |
34+
pycodestyle --max-line-length=140 --ignore=E501 --first --statistics postgresql_kernel
35+
- name: Unit Test
36+
run: |
37+
python -m coverage run --source=postgresql_kernel -m unittest discover -v -s . -p *test*.py
38+
python -m coverage report
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
run: |
27+
python setup.py sdist bdist_wheel bdist_egg
28+
- name: 'Upload dist'
29+
uses: 'actions/upload-artifact@v2'
30+
with:
31+
name: packages
32+
path: dist/*
33+
- name: Publish
34+
env:
35+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
36+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37+
run:
38+
twine upload dist/*
39+
© 2021 GitHub, Inc.
2.2 KB
Loading
150 KB
Loading
111 KB
Loading

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ include = postgresql_kernel
4242
exclude = tests
4343

4444
[options.data_files]
45-
/etc/my_package =
46-
site.d/00_default.conf
47-
host.d/00_default.conf
45+
share/jupyter/kernels/postgresql =
46+
postgresql_kernel/kernel.json
47+
postgresql_kernel/images/*.png
4848

test_postgresql_kernel.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,17 @@
33
import unittest
44
import jupyter_kernel_test as jkt
55

6+
helloworld = """ -- connection: postgres://postgres:postgres@localhost:5432/postgres
7+
-- autocommit: true
8+
select 'hello, world' as helloworld
9+
"""
10+
611

712
class PGKernelTests(jkt.KernelTests):
813
kernel_name = "postgresql"
9-
1014
language_name = "sql"
11-
12-
code_hello_world = ""
13-
14-
code_display_data = [
15-
{'code': '%plot -f png\nplot([1,2,3])', 'mime': 'image/png'},
16-
{'code': '%plot -f svg\nplot([1,2,3])', 'mime': 'image/svg+xml'}
17-
] if sys.platform == 'darwin' else []
18-
19-
completion_samples = [
20-
{
21-
'text': 'acos',
22-
'matches': {'acos', 'acosd', 'acosh'},
23-
},
24-
]
25-
26-
code_page_something = "ones?"
15+
code_hello_world = helloworld
2716

2817

2918
if __name__ == '__main__':
30-
unittest.main()
19+
unittest.main()

0 commit comments

Comments
 (0)