From 930109c95015caf70cada7b1e05c1b7e812b6d3c Mon Sep 17 00:00:00 2001 From: Changaco Date: Sun, 29 Sep 2019 20:24:16 +0200 Subject: [PATCH 1/5] update project author and copyright --- LICENSE | 2 +- docs/conf.py | 8 ++++---- setup.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) 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..3a1d6bd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,7 @@ # 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 @@ -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'), ] diff --git a/setup.py b/setup.py index 7abb98a..4c5ddc5 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,8 @@ setup( name='postgres', - author='Gratipay, LLC', - author_email='chad@idelic.com', + author='Chad Whitacre et al.', + author_email='chad@zetaweb.com', description="postgres is a high-value abstraction over psycopg2.", long_description=open('README.md').read(), long_description_content_type='text/markdown', From cf2367fee4628ad541a12d083651050408459160 Mon Sep 17 00:00:00 2001 From: Changaco Date: Sun, 6 Oct 2019 17:29:45 +0200 Subject: [PATCH 2/5] bump version to 3.0 --- docs/conf.py | 4 ++-- postgres/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3a1d6bd..0704a2f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '2.2' +version = '3.0' # The full version, including alpha/beta/rc tags. -release = '2.2.2' +release = '3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/postgres/__init__.py b/postgres/__init__.py index 0c036d2..de3f21c 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' # Exceptions diff --git a/setup.py b/setup.py index 4c5ddc5..e1f5c52 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ long_description=open('README.md').read(), long_description_content_type='text/markdown', url='https://postgres-py.readthedocs.org', - version='2.2.2', + version='3.0', packages=find_packages(), install_requires=['psycopg2-binary >= 2.8', 'psycopg2-pool'], classifiers=[ From 8b207e973f9ba2501c0ec4c6c9e80c7fdb6b6aa7 Mon Sep 17 00:00:00 2001 From: Changaco Date: Tue, 8 Oct 2019 20:13:10 +0200 Subject: [PATCH 3/5] add a changelog to the documentation --- docs/conf.py | 12 +++++++++++- docs/index.rst | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0704a2f..7c87a80 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'] @@ -250,3 +253,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`) From ca1558cd15e43d0f6a26f2cf303cccca1a1ac190 Mon Sep 17 00:00:00 2001 From: Changaco Date: Sun, 13 Oct 2019 14:39:57 +0200 Subject: [PATCH 4/5] switch to setup.cfg --- docs/conf.py | 7 ++----- postgres/__init__.py | 2 +- setup.cfg | 33 +++++++++++++++++++++++++++++++++ setup.py | 28 ++-------------------------- 4 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 setup.cfg diff --git a/docs/conf.py b/docs/conf.py index 7c87a80..2717e9c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,11 +49,8 @@ # 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 = '3.0' -# The full version, including alpha/beta/rc tags. -release = '3.0' +import postgres +release = postgres.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/postgres/__init__.py b/postgres/__init__.py index de3f21c..1b95d21 100644 --- a/postgres/__init__.py +++ b/postgres/__init__.py @@ -195,7 +195,7 @@ psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) -__version__ = '3.0' +__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 e1f5c52..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='Chad Whitacre et al.', - author_email='chad@zetaweb.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='3.0', - 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() From c1364e4fc589b1ea5a0ffdff136a1f4b23ca5172 Mon Sep 17 00:00:00 2001 From: Changaco Date: Tue, 15 Oct 2019 20:07:59 +0200 Subject: [PATCH 5/5] improve flake8 config --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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