-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 FIX: CREATE DATABASE with psycopg2 v2.9 (#27)
Addresses aiidateam/aiida-core#5002: In v2.9, the context manager opens a transaction, but databases cannot be created within them. The fix is taken from: psycopg/psycopg2#941 (comment)
- Loading branch information
1 parent
43d8d30
commit 619d3aa
Showing
8 changed files
with
101 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,51 @@ | ||
[metadata] | ||
name = pgsu | ||
version = 0.2.0 | ||
description = Connect to an existing PostgreSQL cluster as a postgres superuser and execute SQL commands. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/aiidateam/pgsu | ||
author = AiiDA Team | ||
author_email = aiidateam@gmail.com | ||
license = MIT | ||
license_file = LICENSE | ||
classifiers = | ||
License :: OSI Approved :: MIT License | ||
Operating System :: MacOS :: MacOS X | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: POSIX :: Linux | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: Implementation :: CPython | ||
|
||
[options] | ||
packages = find: | ||
install_requires = | ||
click | ||
psycopg2-binary>=2.8.3 | ||
python_requires = ~=3.6 | ||
|
||
[options.packages.find] | ||
exclude = | ||
test* | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
pgsu = pgsu.cli:run | ||
|
||
[options.extras_require] | ||
pre_commit = | ||
pre-commit~=2.2 | ||
pylint~=2.5.0 | ||
testing = | ||
pgtest>=1.3.1 | ||
pytest | ||
pytest-cov | ||
|
||
[coverage:run] | ||
parallel=true | ||
parallel = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Setup script for pgsu python package""" | ||
import os | ||
from setuptools import setup, find_packages | ||
"""This file is needed for editable installs (`pip install -e .`). | ||
THIS_FOLDER = os.path.split(os.path.abspath(__file__))[0] | ||
Can be removed once the following is resolved | ||
https://github.com/pypa/packaging-problems/issues/256 | ||
""" | ||
from setuptools import setup | ||
|
||
setup( | ||
name='pgsu', | ||
version='0.2.0', | ||
description= | ||
('Connect to an existing PostgreSQL cluster as a postgres superuser and execute SQL commands.' | ||
), | ||
long_description=open(os.path.join(THIS_FOLDER, 'README.md')).read(), | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/aiidateam/pgsu', | ||
author='AiiDA Team', | ||
author_email='aiidateam@gmail.com', | ||
classifiers=[ | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: Microsoft :: Windows', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
], | ||
license='MIT', | ||
packages=find_packages(), | ||
install_requires=[ | ||
'psycopg2-binary>=2.8.3', | ||
'click', | ||
], | ||
extras_require={ | ||
'testing': ['pytest', 'pgtest>=1.3.1', 'pytest-cov'], | ||
# note: pre-commit hooks require python3 | ||
'pre-commit': ['pre-commit~=2.2', 'pylint~=2.5.0'] | ||
}, | ||
entry_points={'console_scripts': ['pgsu=pgsu.cli:run']}) | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# To use tox, see https://tox.readthedocs.io | ||
# Simply pip or conda install tox | ||
# If you use conda, you may also want to install tox-conda | ||
# then run `tox` or `tox -- {pytest args}` | ||
# run in parallel using `tox -p` | ||
[tox] | ||
envlist = py38 | ||
|
||
[testenv] | ||
usedevelop = true | ||
|
||
[testenv:py{37,38,39}] | ||
description = Run unit tests with this Python version | ||
extras = | ||
testing | ||
commands = pytest {posargs} |