Skip to content

Commit 8303d23

Browse files
Drop python 3.6, add python 3.11, bump the wheel dev req (#132)
Drop python 3.6, add python 3.11, bump the wheel dev req
1 parent bc87a21 commit 8303d23

11 files changed

+8
-19
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
14+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
1515

1616
services:
1717
postgres:
@@ -42,11 +42,11 @@ jobs:
4242
pip install -r requirements-dev.txt
4343
4444
- name: Run unit tests
45-
run: coverage run --source pgspecial -m py.test
45+
run: coverage run --source pgspecial -m pytest
4646

4747
- name: Run Black
4848
run: black --check .
49-
if: matrix.python-version == '3.6'
49+
if: matrix.python-version == '3.7'
5050

5151
- name: Coverage
5252
run: |

pgspecial/dbcommands.py

-3
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ def list_indexes(cur, pattern, verbose):
479479

480480
@special_command("\\df", "\\df[+] [pattern]", "List functions.")
481481
def list_functions(cur, pattern, verbose):
482-
483482
if verbose:
484483
verbose_columns = """
485484
,CASE
@@ -1394,7 +1393,6 @@ def describe_one_table_details(cur, schema_name, relation_name, oid, verbose):
13941393
if cur.rowcount > 0:
13951394
status.append("Indexes:\n")
13961395
for row in cur:
1397-
13981396
# /* untranslated index name */
13991397
status.append(f''' "{row[0]}"''')
14001398

@@ -1901,7 +1899,6 @@ def shell_command(cur, pattern, verbose):
19011899

19021900
@special_command("\\dE", "\\dE[+] [pattern]", "List foreign tables.", aliases=())
19031901
def list_foreign_tables(cur, pattern, verbose):
1904-
19051902
if verbose:
19061903
verbose_cols = """
19071904
, pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as "Size",

pgspecial/iocommands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def read_from_file(path):
122122

123123

124124
def _index_of_file_name(tokenlist):
125-
for (idx, token) in reversed(list(enumerate(tokenlist[:-2]))):
125+
for idx, token in reversed(list(enumerate(tokenlist[:-2]))):
126126
if token.is_keyword and token.value.upper() in ("TO", "FROM"):
127127
return idx + 2
128128
raise Exception("Missing keyword in \\copy command. Either TO or FROM is required.")

pgspecial/main.py

-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class CommandNotFound(Exception):
3535

3636
@export
3737
class PGSpecial(object):
38-
3938
# Default static commands that don't rely on PGSpecial state are registered
4039
# via the special_command decorator and stored in default_commands
4140
default_commands = {}
@@ -290,7 +289,6 @@ def register_special_command(
290289
aliases=(),
291290
command_dict=None,
292291
):
293-
294292
cmd = command.lower() if not case_sensitive else command
295293
command_dict[cmd] = SpecialCommand(
296294
handler, syntax, description, arg_type, hidden, case_sensitive

pgspecial/namedqueries.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
class NamedQueries(object):
3-
43
section_name = "named queries"
54

65
usage = """Named Queries are a way to save frequently used queries

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 88
3-
target-version = ['py36']
3+
target-version = ['py37']
44
include = '\.pyi?$'
55
exclude = '''
66
/(

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pre-commit>=1.16.0
77
black>=20.8b1
88
configobj>=5.0.6
99
twine==1.11.0
10-
wheel==0.33.6
10+
wheel==0.38.1

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
"Operating System :: Unix",
3434
"Programming Language :: Python",
3535
"Programming Language :: Python :: 3",
36-
"Programming Language :: Python :: 3.6",
3736
"Programming Language :: Python :: 3.7",
3837
"Programming Language :: Python :: 3.8",
3938
"Programming Language :: Python :: 3.9",
4039
"Programming Language :: Python :: 3.10",
40+
"Programming Language :: Python :: 3.11",
4141
"Programming Language :: SQL",
4242
"Topic :: Database",
4343
"Topic :: Database :: Front-Ends",

tests/dbutils.py

-2
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,11 @@ def teardown_db(conn):
132132

133133

134134
def setup_foreign(conn):
135-
136135
foreign_conn = db_connection(FOREIGN_TEST_DB_NAME)
137136
with foreign_conn.cursor() as foreign_cur:
138137
foreign_cur.execute("create table if not exists foreign_foo (a int, b text)")
139138

140139
with conn.cursor() as cur:
141-
142140
# foreign database wrapper
143141
cur.execute("create extension if not exists postgres_fdw")
144142
cur.execute(

tests/test_specials.py

-3
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,6 @@ def test_slash_sf_verbose(executor):
985985

986986
@fdw_test
987987
def test_slash_dE(executor):
988-
989988
with foreign_db_environ():
990989
results = executor(r"\dE")
991990
title = None
@@ -998,7 +997,6 @@ def test_slash_dE(executor):
998997

999998
@fdw_test
1000999
def test_slash_dE_with_pattern(executor):
1001-
10021000
with foreign_db_environ():
10031001
results = executor(r"\dE foreign_foo")
10041002
title = None
@@ -1020,7 +1018,6 @@ def test_slash_dE_with_pattern(executor):
10201018

10211019
@fdw_test
10221020
def test_slash_dE_verbose(executor):
1023-
10241021
with foreign_db_environ():
10251022
results = executor(r"\dE+")
10261023
title = None

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36, py37, py38, py39, py310
2+
envlist = py37, py38, py39, py310, py311
33
[testenv]
44
deps = pytest
55
configobj

0 commit comments

Comments
 (0)