Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2012-present Gratipay, LLC
Copyright 2012-present Chad Whitacre et al.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
27 changes: 17 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -41,16 +44,13 @@

# General information about the project.
project = u'Postgres.py'
copyright = u'2015, Gratipay, LLC and contributors'
copyright = u'Chad Whitacre et al.'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.2'
import postgres
release = postgres.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -194,7 +194,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Postgrespy.tex', u'Postgres.py Documentation',
u'Gratipay, LLC', 'manual'),
u'Chad Whitacre et al.', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -224,7 +224,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'postgrespy', u'Postgres.py Documentation',
[u'Gratipay, LLC'], 1)
[u'Chad Whitacre et al.'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -238,7 +238,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Postgrespy', u'Postgres.py Documentation',
u'Gratipay, LLC', 'Postgrespy', 'One line description of project.',
u'Chad Whitacre et al.', 'Postgrespy', 'One line description of project.',
'Miscellaneous'),
]

Expand All @@ -250,3 +250,10 @@

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'


# -- Options for extensions ----------------------------------------------------

extlinks = {
'pr': ('https://github.com/chadwhitacre/postgres.py/pull/%s', '#'),
}
39 changes: 39 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,42 @@ An Object-Relational Mapper (ORM)
.. automodule:: postgres.orm
:members:
:member-order: bysource


Changelog
---------

**3.0.0 (Oct 19, 2019)**

- the :class:`ReadOnly` exception has been renamed to :class:`ReadOnlyAttribute`, and the :attr:`_read_only_attributes` attribute of the :class:`~postgres.orm.Model` class has been renamed to :attr:`attnames` (:pr:`91`)
- the ORM has been optimized and now supports `__slots__ <https://docs.python.org/3/reference/datamodel.html#slots>`_ (:pr:`88`)
- **BREAKING**: the :meth:`~postgres.Postgres.check_registration` method now always returns a list (:pr:`87`)
- PostgreSQL versions older than 9.2 are no longer supported (:pr:`83`)
- idle connections are now kept open for up to 10 minutes by default (:pr:`81`)
- the methods :meth:`~postgres.Postgres.run`, :meth:`~postgres.Postgres.one` and :meth:`~postgres.Postgres.all` now support receiving query paramaters as keyword arguments (:pr:`79`)
- **BREAKING**: the methods :meth:`~postgres.Postgres.run`, :meth:`~postgres.Postgres.one` and :meth:`~postgres.Postgres.all` no longer pass extra arguments to :meth:`~postgres.Postgres.get_cursor` (:pr:`79` and :pr:`67`)
- subtransactions are now supported (:pr:`78` and :pr:`90`)
- **BREAKING**: single-column rows aren't unpacked anymore when the `back_as` argument is provided (:pr:`77`)
- the cursor methods now also support the `back_as` argument (:pr:`77`)
- a new row type and cursor subclass are now available, see :class:`~postgres.cursors.SimpleRowCursor` for details (:pr:`75`)
- the ORM now supports non-default schemas (:pr:`74`)
- connections now also have a :meth:`get_cursor` method (:pr:`73` and :pr:`82`)
- the values accepted by the `back_as` argument can now be customized (:pr:`72`)
- the :meth:`~postgres.Postgres.one` and :meth:`~postgres.Postgres.all` no longer fail when a row is made up of a single column named :attr:`values` (:pr:`71`)
- any :exc:`~psycopg2.InterfaceError` exception raised during an automatic rollback is now suppressed (:pr:`70`)
- the :meth:`~postgres.Postgres.get_cursor` method has two new optional arguments: `autocommit` and `readonly` (:pr:`69`)
- :class:`~postgres.Postgres` objects now have a :attr:`readonly` attribute (:pr:`69`)
- the `url` argument is no longer required when creating a :class:`Postgres` object (:pr:`68`)

**2.2.2 (Sep 12, 2018)**

- the only dependency was changed from ``psycopg2 >= 2.5.0`` to ``psycopg2-binary >= 2.7.5`` (:pr:`64`)
- the license was changed from CC0 to MIT (:pr:`62`)

**2.2.1 (Oct 10, 2015)**

- a bug in the URL-to-DSN conversion function was fixed (:pr:`53`)

**2.2.0 (Sep 12, 2015)**

- the ORM was modified to detect some schema changes (:pr:`43`)
2 changes: 1 addition & 1 deletion postgres/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)


__version__ = '2.2.2'
__version__ = '3.0.0'


# Exceptions
Expand Down
33 changes: 33 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files

[metadata]
name = postgres
version = 3.0.0
author = Chad Whitacre et al.
author_email = chad@zetaweb.com
url = https://github.com/chadwhitacre/postgres.py
description = postgres is a high-value abstraction over psycopg2.
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
license_file = LICENSE
keywords = sql postgresql psycopg2
platforms = any
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: MIT
Operating System :: OS Independent
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: SQL
Topic :: Database :: Front-Ends
Topic :: Software Development :: Libraries :: Python Modules

[options]
packages = find:
install_requires =
psycopg2-binary >= 2.8
psycopg2-pool
setup_requires =
setuptools >= 39.2.0
28 changes: 2 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from setuptools import setup

from setuptools import setup, find_packages

setup(
name='postgres',
author='Gratipay, LLC',
author_email='chad@idelic.com',
description="postgres is a high-value abstraction over psycopg2.",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='https://postgres-py.readthedocs.org',
version='2.2.2',
packages=find_packages(),
install_requires=['psycopg2-binary >= 2.8', 'psycopg2-pool'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: MIT',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: SQL',
'Topic :: Database :: Front-Ends',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
setup()
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ usedevelop = true

[flake8]
ignore = E302,E303,E306,E731
exclude = .git/, .tox/, __pycache__/, docs/, build/, dist/
exclude = .*/, __pycache__/, docs/, build/, dist/
max_line_length = 99