Author: cito
Date: Fri Jan 15 13:42:07 2016
New Revision: 758

Log:
Build source distribution with setup script

Instead of building the source distribution (the tarball) manually
in mktar, we now let setup.py do the work for us.

This has the advantage that we can be sure that the created tarball
conforms to the standards (e.g. contains the egg-info bits), and we
don't need to maintain the list of source files in two places any
more - we only need to maintain the MANIFEST.in file now.

Note that setup.py creates a tar.gz file instead of .tgz as before.
We should also distribute it like that because it's the standard on
PyPI etc. I have also changed the download docs to reflect this.

Modified:
   branches/4.x/docs/download/download.rst
   branches/4.x/mkdocs
   branches/4.x/mktar
   trunk/docs/download/download.rst
   trunk/mkdocs
   trunk/mktar

Modified: branches/4.x/docs/download/download.rst
==============================================================================
--- branches/4.x/docs/download/download.rst     Fri Jan 15 13:30:25 2016        
(r757)
+++ branches/4.x/docs/download/download.rst     Fri Jan 15 13:42:07 2016        
(r758)
@@ -5,9 +5,9 @@
  * http://pypi.python.org/pypi/PyGreSQL/
 
 The **released version of the source code** is available at
-  * http://pygresql.org/files/PyGreSQL.tgz
+  * http://pygresql.org/files/PyGreSQL.tar.gz
 You can also check the latest **pre-release version** at
-  * http://pygresql.org/files/PyGreSQL-beta.tgz
+  * http://pygresql.org/files/PyGreSQL-beta.tar.gz
 A **Linux RPM** can be picked up from
   * http://pygresql.org/files/pygresql.i386.rpm
 A **NetBSD package** is available in their pkgsrc collection

Modified: branches/4.x/mkdocs
==============================================================================
--- branches/4.x/mkdocs Fri Jan 15 13:30:25 2016        (r757)
+++ branches/4.x/mkdocs Fri Jan 15 13:42:07 2016        (r758)
@@ -15,4 +15,3 @@
 cd docs
 ${MAKE} clean
 ${MAKE} html
-rm -f build/html/.buildinfo

Modified: branches/4.x/mktar
==============================================================================
--- branches/4.x/mktar  Fri Jan 15 13:30:25 2016        (r757)
+++ branches/4.x/mktar  Fri Jan 15 13:42:07 2016        (r758)
@@ -33,33 +33,19 @@
 
 ./mkdocs
 
-# The following does essentially the same as "python setup.py sdist".
+# Package as source distribution.
 
-TD=PyGreSQL-$VERSION
-TF=$DISTDIR/$TD.tgz
+rm -rf build dist
 
-MODFILES="pg.py pgdb.py pgmodule.c
-          pgfs.h pgtypes.h
-          setup.py setup.cfg
-          LICENSE.txt README.rst MANIFEST.in"
-DOCFILES="docs/Makefile docs/make.bat docs/*.rst docs/*.py
-          docs/contents docs/download docs/community
-          docs/_static docs/_templates"
-HTMLFILES="docs/_build/html"
-TESTFILES="tests/*.py"
-
-rm -rf $TD
-mkdir $TD
-mkdir -p $TD/docs/_build/html
-mkdir $TD/tests
-cp $MODFILES $TD
-cp -r $DOCFILES $TD/docs
-cp -r $HTMLFILES $TD/docs/_build
-cp $TESTFILES $TD/tests
-tar -cvzf $TF $TD
+python setup.py sdist
+
+DF=`ls dist`
+TF=$DISTDIR/$DF
+
+cp dist/$DF $TF
 chmod 644 $TF
-rm -rf $TD
+
 rm -f $DISTDIR/$SYMLINK
-ln -s $TD.tgz $DISTDIR/$SYMLINK
+ln -s $DF $DISTDIR/$SYMLINK
 
-echo "$TF has been built"
+echo "$TF has been built."

Modified: trunk/docs/download/download.rst
==============================================================================
--- trunk/docs/download/download.rst    Fri Jan 15 13:30:25 2016        (r757)
+++ trunk/docs/download/download.rst    Fri Jan 15 13:42:07 2016        (r758)
@@ -5,9 +5,9 @@
  * http://pypi.python.org/pypi/PyGreSQL/
 
 The **released version of the source code** is available at
-  * http://pygresql.org/files/PyGreSQL.tgz
+  * http://pygresql.org/files/PyGreSQL.tar.gz
 You can also check the latest **pre-release version** at
-  * http://pygresql.org/files/PyGreSQL-beta.tgz
+  * http://pygresql.org/files/PyGreSQL-beta.tar.gz
 A **Linux RPM** can be picked up from
   * http://pygresql.org/files/pygresql.i386.rpm
 A **NetBSD package** is available in their pkgsrc collection

Modified: trunk/mkdocs
==============================================================================
--- trunk/mkdocs        Fri Jan 15 13:30:25 2016        (r757)
+++ trunk/mkdocs        Fri Jan 15 13:42:07 2016        (r758)
@@ -15,4 +15,3 @@
 cd docs
 ${MAKE} clean
 ${MAKE} html
-rm -f build/html/.buildinfo

Modified: trunk/mktar
==============================================================================
--- trunk/mktar Fri Jan 15 13:30:25 2016        (r757)
+++ trunk/mktar Fri Jan 15 13:42:07 2016        (r758)
@@ -33,33 +33,19 @@
 
 ./mkdocs
 
-# The following does essentially the same as "python setup.py sdist".
+# Package as source distribution.
 
-TD=PyGreSQL-$VERSION
-TF=$DISTDIR/$TD.tgz
+rm -rf build dist
 
-MODFILES="pg.py pgdb.py pgmodule.c
-          pgtypes.h py3c.h
-          setup.py setup.cfg
-          LICENSE.txt README.rst MANIFEST.in"
-DOCFILES="docs/Makefile docs/make.bat docs/*.rst docs/*.py
-          docs/contents docs/download docs/community
-          docs/_static docs/_templates"
-HTMLFILES="docs/_build/html"
-TESTFILES="tests/*.py"
-
-rm -rf $TD
-mkdir $TD
-mkdir -p $TD/docs/_build/html
-mkdir $TD/tests
-cp $MODFILES $TD
-cp -r $DOCFILES $TD/docs
-cp -r $HTMLFILES $TD/docs/_build
-cp $TESTFILES $TD/tests
-tar -cvzf $TF $TD
+python setup.py sdist
+
+DF=`ls dist`
+TF=$DISTDIR/$DF
+
+cp dist/$DF $TF
 chmod 644 $TF
-rm -rf $TD
+
 rm -f $DISTDIR/$SYMLINK
-ln -s $TD.tgz $DISTDIR/$SYMLINK
+ln -s $DF $DISTDIR/$SYMLINK
 
-echo "$TF has been built"
+echo "$TF has been built."
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to