diff --git a/LICENSE b/LICENSE index d71d13f..5c98c50 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/docs/conf.py b/docs/conf.py index 59671cd..2717e9c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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'] @@ -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. @@ -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 @@ -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. @@ -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'), ] @@ -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', '#'), +} diff --git a/docs/index.rst b/docs/index.rst index ad4993c..2aa46af 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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__ `_ (: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`) diff --git a/postgres/__init__.py b/postgres/__init__.py index 0c036d2..1b95d21 100644 --- a/postgres/__init__.py +++ b/postgres/__init__.py @@ -195,7 +195,7 @@ psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) -__version__ = '2.2.2' +__version__ = '3.0.0' # Exceptions diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a02e344 --- /dev/null +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 7abb98a..6068493 100644 --- a/setup.py +++ b/setup.py @@ -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() diff --git a/tox.ini b/tox.ini index 4abb273..ea4e606 100644 --- a/tox.ini +++ b/tox.ini @@ -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