Skip to content

Commit 3aa28f2

Browse files
committed
try to include sql file in package
1 parent 144f921 commit 3aa28f2

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ exclude *
22
include changelog.rst DEVELOP.rst License.txt pyproject.toml README.rst requirements-dev.txt setup.py
33
include scripts/docparser.py scripts/README.rst tox.ini
44
recursive-include pgspecial *.py
5+
recursive-include pgspecial *.sql
56
recursive-include tests *.py
67
recursive-include tests *.ini

pgspecial/dbcommands.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
from __future__ import unicode_literals
22
import logging
3+
from pathlib import Path
34
import shlex
45
import subprocess
56
from collections import namedtuple
67

78
import aiosql
89
from .main import special_command
910

10-
queries = aiosql.from_path("pgspecial/dbcommands.sql", "psycopg2")
11+
12+
dir_path = Path(__file__).parent
13+
sql_path = dir_path / "sql" / "dbcommands.sql"
14+
queries = aiosql.from_path(sql_path, "psycopg2")
1115

1216
TableInfo = namedtuple(
1317
"TableInfo",
File renamed without changes.

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
packages=find_packages(),
2323
description=description,
2424
long_description=open("README.rst").read(),
25+
package_data={
26+
"pgspecial": ["sql/dbcommands.sql"],
27+
},
2528
install_requires=[
2629
"click >= 4.1",
2730
"sqlparse >= 0.1.19",
2831
"psycopg >= 3.0.10",
32+
"aiosql >= 9.0",
2933
],
3034
classifiers=[
3135
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)