Skip to content

Commit 9ef001f

Browse files
author
James William Pye
committed
Move project information into postgresql.project
1 parent 44d3b7b commit 9ef001f

5 files changed

Lines changed: 28 additions & 27 deletions

File tree

postgresql/__init__.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,20 @@
1212
__all__ = [
1313
'__author__',
1414
'__date__',
15-
'__project__',
16-
'__project_id__',
17-
'__docformat__',
1815
'__version__',
16+
'__docformat__',
1917
'version',
2018
'version_info',
2119
'open',
2220
]
2321

24-
__author__ = "James William Pye <x@jwp.name>"
25-
__date__ = "2009-12-14 21:16:00-07"
26-
27-
__project__ = 'py-postgresql'
28-
__project_id__ = 'http://python.projects.postgresql.org'
29-
30-
#: The py-postgresql version tuple.
31-
version_info = (1, 0, 0, 'dev', 0)
32-
33-
#: The py-postgresql version string.
34-
version = __version__ = '.'.join(map(str, version_info[:3])) + (
35-
version_info[3] if version_info[3] != 'final' else ''
36-
)
22+
# Optional.
23+
try:
24+
from .project import version_info, version, \
25+
author as __author__, date as __date__
26+
__version__ = version
27+
except ImportError:
28+
pass
3729

3830
# Avoid importing these until requested.
3931
_pg_iri = _pg_driver = _pg_param = None

postgresql/documentation/changes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Changes
1313
* Set the default client_min_messages level to WARNING.
1414
NOTICEs are often not desired by programmers, and py-postgresql's
1515
high verbosity further irritates that case.
16+
* Added postgresql.project module to provide project information.
17+
Project name, author, version, etc.
1618

1719
0.9.3 released on 2010-01-01
1820
----------------------------

postgresql/project.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# project information
2+
name = 'py-postgresql'
3+
identity = 'http://python.projects.postgresql.org/'
4+
author = "James William Pye <x@jwp.name>"
5+
6+
# Set this to the target date when approaching a release.
7+
date = None
8+
version_info = (1, 0, 0)
9+
version = '.'.join(map(str, version_info)) + (date is None and 'dev' or '')

postgresql/release/distutils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
"""
1414
import sys
1515
import os
16-
from .. import \
17-
__version__ as version, \
18-
__project__ as name, \
19-
__project_id__ as url
16+
from ..project import version, name, identity as url
2017
from distutils.core import Extension
2118

2219
LONG_DESCRIPTION = """

sphinx-src/conf.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# If your extensions are in another directory, add it here. If the directory
1919
# is relative to the documentation root, use os.path.abspath to make it
2020
# absolute, like shown here.
21-
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '../..'))
21+
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '../../postgresql'))
2222

2323
# General configuration
2424
# ---------------------
@@ -37,17 +37,16 @@
3737
master_doc = 'index'
3838

3939
# General substitutions.
40-
import postgresql as meta
41-
project = meta.__project__
42-
copyright = meta.__date__ + ', ' + meta.__author__
40+
import project
41+
copyright = '2010, ' + project.author
4342

4443
# The default replacements for |version| and |release|, also used in various
4544
# other places throughout the built documents.
4645
#
4746
# The short X.Y version.
48-
version = '.'.join(map(str, meta.version_info[:2]))
47+
version = '.'.join(map(str, project.version_info[:2]))
4948
# The full version, including alpha/beta/rc tags.
50-
release = meta.__version__
49+
release = project.version
5150

5251
# There are two options for replacing |today|: either, you set today to some
5352
# non-false value, then it is used:
@@ -145,7 +144,7 @@
145144
#html_file_suffix = ''
146145

147146
# Output file base name for HTML help builder.
148-
htmlhelp_basename = meta.__project__
147+
htmlhelp_basename = project.__name__
149148

150149

151150
# Options for LaTeX output
@@ -180,3 +179,5 @@
180179

181180
# If false, no module index is generated.
182181
#latex_use_modindex = True
182+
183+
project = project.name

0 commit comments

Comments
 (0)