[geneagrapher] 188/226: Repackaging using Distribute (replacing setuptools).

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:11:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository geneagrapher.

commit 556701eddefedafed3de42af413c9865cc7892ee
Author: David Alber <alber.david at gmail.com>
Date:   Sat Dec 3 22:35:48 2011 -0800

    Repackaging using Distribute (replacing setuptools).
    
    Adopting the package tree and packaging files produced by the
    modern-package-template package.
    
    This references #11.
---
 HACKING.txt                                        |  19 ++++
 MANIFEST.in                                        |   2 +
 NEWS.txt                                           |  85 ++++++++++++++++
 README => README.rst                               |   0
 bootstrap.py                                       | 113 +++++++++++++++++++++
 buildout.cfg                                       |  13 +++
 setup.py                                           |  53 ++++++----
 {geneagrapher => src/geneagrapher}/__init__.py     |   0
 {geneagrapher => src/geneagrapher}/geneagrapher.py |   0
 {geneagrapher => src/geneagrapher}/grabber.py      |   0
 .../geneagrapher}/graph/__init__.py                |   0
 {geneagrapher => src/geneagrapher}/graph/graph.py  |   0
 {geneagrapher => src/geneagrapher}/graph/node.py   |   0
 {geneagrapher => src/geneagrapher}/graph/record.py |   0
 tests/__init__.py                                  |   1 -
 tests/{ => geneagrapher}/__init__.py               |   0
 .../test_geneagrapher_methods.py                   |   0
 tests/{ => geneagrapher}/test_grabber_methods.py   |   0
 tests/{ => geneagrapher}/test_graph_methods.py     |   0
 tests/{ => geneagrapher}/test_node_methods.py      |   0
 tests/{ => geneagrapher}/test_record_methods.py    |   0
 tests/{ => geneagrapher}/tests.py                  |   0
 22 files changed, 266 insertions(+), 20 deletions(-)

diff --git a/HACKING.txt b/HACKING.txt
new file mode 100644
index 0000000..5a16441
--- /dev/null
+++ b/HACKING.txt
@@ -0,0 +1,19 @@
+Development setup
+=================
+
+To create a buildout,
+
+  $ python bootstrap.py
+  $ bin/buildout
+
+Release HOWTO
+=============
+
+To make a release, 
+
+  1) Update release date/version in NEWS.txt and setup.py
+  2) Run 'python setup.py sdist'
+  3) Test the generated source distribution in dist/
+  4) Upload to PyPI: 'python setup.py sdist register upload'
+  5) Increase version in setup.py (for next release)
+
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..1e7e568
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include README.rst
+include NEWS.txt
diff --git a/NEWS.txt b/NEWS.txt
new file mode 100644
index 0000000..0167149
--- /dev/null
+++ b/NEWS.txt
@@ -0,0 +1,85 @@
+News
+====
+
+0.2.1-r2
+--------
+
+*Release date: 11-Aug-2011*
+
+*A test in Geneagrapher 0.2.1-r1 was broken by new information added
+ to the Mathematics Genealogy Project. This release fixes the test,
+ but does not change the functionality from version 0.2.1-r1.
+
+0.2.1-r1
+--------
+
+*Release date: 03-Nov-2010*
+
+*A few tests in Geneagrapher 0.2.1 have become broken since that
+ version was released. This release fixes those tests, but does not
+ change the functionality from version 0.2.1.
+
+
+0.2.1
+-----
+
+*Release date: 01-Sep-2009*
+
+Changes made for this release:
+*Multiple advisors are now captured correctly. While this problem was
+ manifesting itself, ancestor trees were coming out as a branch-free
+ tree.
+
+*Added a test for the multiple advisor case, which enables quicker
+ recognition of similar problems.
+
+*Updated a few tests that had become broken due to updates in the Math
+ Genealogy Project’s database.
+
+
+0.2-r1
+------
+
+*Release date: 07-Oct-2008*
+
+*This Geneagrapher release slightly changes an installation-related
+ file to enable installation on machines running Python 2.6 that have
+ not yet installed Python setuptools.
+
+
+0.2
+---
+
+*Release date: 06-Oct-2008*
+
+Here are the most significant changes, from the perspective of the
+user:
+*Descendant trees. Now trees can be built placing a starting node at
+ the top and graphing all of its descendants. A couple points on this:
+
+ -These sorts of graphs tend to have a lot of “fan out” because some
+ people have a lot of students.
+
+ -Be careful. Do not inadvertently (or intentionally!) run a job that
+  requests the data for thousands of nodes.
+
+*Better character handling. I believe all characters are now displayed
+ correctly, as long as the generated dot file is processed by Graphviz
+ a certain way (see the Geneagrapher 0.2 Usage Guide).
+
+*No limit on the number of starting nodes.
+
+*This is a client application, meaning the user installs it somewhere
+ and runs it there. Furthermore, this package only generates the input
+ file to Graphviz, so that also needs to be installed. This is
+ probably more of a hassle than most Geneagrapher users want to go
+ through (not all, though), but this is just the first step.
+
+Additionally, behind-the-scenes changes happened:
+
+*Large portions of the code were rewritten.
+
+*Added a test suite to make it more maintainable. In particular, this
+should allow quicker diagnosis and modifications when the Mathematics
+Genealogy Project pages have changed.
+
diff --git a/README b/README.rst
similarity index 100%
rename from README
rename to README.rst
diff --git a/bootstrap.py b/bootstrap.py
new file mode 100644
index 0000000..63aebb9
--- /dev/null
+++ b/bootstrap.py
@@ -0,0 +1,113 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 102545 2009-08-06 14:49:47Z chrisw $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+# parsing arguments
+parser = OptionParser()
+parser.add_option("-v", "--version", dest="version",
+                          help="use a specific zc.buildout version")
+parser.add_option("-d", "--distribute",
+                   action="store_true", dest="distribute", default=True,
+                   help="Use Disribute rather than Setuptools.")
+
+options, args = parser.parse_args()
+
+if options.version is not None:
+    VERSION = '==%s' % options.version
+else:
+    VERSION = ''
+
+USE_DISTRIBUTE = options.distribute
+args = args + ['bootstrap']
+
+to_reload = False
+try:
+    import pkg_resources
+    if not hasattr(pkg_resources, '_distribute'):
+        to_reload = True
+        raise ImportError
+except ImportError:
+    ez = {}
+    if USE_DISTRIBUTE:
+        exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
+                         ).read() in ez
+        ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
+    else:
+        exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                             ).read() in ez
+        ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    if to_reload:
+        reload(pkg_resources)
+    else:
+        import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+
+if USE_DISTRIBUTE:
+    requirement = 'distribute'
+else:
+    requirement = 'setuptools'
+
+if is_jython:
+    import subprocess
+
+    assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+           quote(tmpeggs), 'zc.buildout' + VERSION],
+           env=dict(os.environ,
+               PYTHONPATH=
+               ws.find(pkg_resources.Requirement.parse(requirement)).location
+               ),
+           ).wait() == 0
+
+else:
+    assert os.spawnle(
+        os.P_WAIT, sys.executable, quote (sys.executable),
+        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+        dict(os.environ,
+            PYTHONPATH=
+            ws.find(pkg_resources.Requirement.parse(requirement)).location
+            ),
+        ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
diff --git a/buildout.cfg b/buildout.cfg
new file mode 100644
index 0000000..cb6c6d9
--- /dev/null
+++ b/buildout.cfg
@@ -0,0 +1,13 @@
+[buildout]
+parts = python scripts
+develop = .
+eggs = geneagrapher
+
+[python]
+recipe = zc.recipe.egg
+interpreter = python
+eggs = ${buildout:eggs}
+
+[scripts]
+recipe = zc.recipe.egg:scripts
+eggs = ${buildout:eggs}
diff --git a/setup.py b/setup.py
index f659f5d..a06cc40 100644
--- a/setup.py
+++ b/setup.py
@@ -1,22 +1,37 @@
-from ez_setup import use_setuptools
-use_setuptools()
 from setuptools import setup, find_packages
+import sys, os
 
-setup(name="Geneagrapher",
-      version="0.2.1-r2",
-      description="Generates mathematic genealogy graph files.",
-      long_description="""\
-The Geneagrapher generates Graphviz "dot" files of mathematical
-genealogies using data from the Math Genealogy Project's website.
-""",
-      author="David Alber",
-      author_email="alber.david at gmail.com",
-      url="http://www.davidalber.net/",
-      license="MIT",
-      packages=find_packages(exclude='tests'),
-      install_requires=['BeautifulSoup >= 3.2.0'],
-      entry_points={
-        'console_scripts': ['ggrapher = geneagrapher.geneagrapher:ggrapher']
-      },
-      test_suite="tests.tests"
+here = os.path.abspath(os.path.dirname(__file__))
+README = open(os.path.join(here, 'README.rst')).read()
+NEWS = open(os.path.join(here, 'NEWS.txt')).read()
+
+
+version = '0.2.1-r2'
+
+install_requires = [
+    'BeautifulSoup >= 3.2.0'
+]
+
+
+setup(name='geneagrapher',
+    version=version,
+    description="Generates mathematic genealogy graph files.",
+    long_description=README + '\n\n' + NEWS,
+    classifiers=[
+      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+    ],
+    keywords='',
+    author='David Alber',
+    author_email='alber.david at gmail.com',
+    url='http://www.davidalber.net/geneagrapher',
+    license='MIT',
+    packages=find_packages('src'),
+    package_dir = {'': 'src'},include_package_data=True,
+    zip_safe=False,
+    install_requires=install_requires,
+    entry_points={
+        'console_scripts':
+            ['ggrapher=geneagrapher.geneagrapher:ggrapher']
+    },
+    test_suite='tests.geneagrapher'
 )
diff --git a/geneagrapher/__init__.py b/src/geneagrapher/__init__.py
similarity index 100%
rename from geneagrapher/__init__.py
rename to src/geneagrapher/__init__.py
diff --git a/geneagrapher/geneagrapher.py b/src/geneagrapher/geneagrapher.py
similarity index 100%
rename from geneagrapher/geneagrapher.py
rename to src/geneagrapher/geneagrapher.py
diff --git a/geneagrapher/grabber.py b/src/geneagrapher/grabber.py
similarity index 100%
rename from geneagrapher/grabber.py
rename to src/geneagrapher/grabber.py
diff --git a/geneagrapher/graph/__init__.py b/src/geneagrapher/graph/__init__.py
similarity index 100%
rename from geneagrapher/graph/__init__.py
rename to src/geneagrapher/graph/__init__.py
diff --git a/geneagrapher/graph/graph.py b/src/geneagrapher/graph/graph.py
similarity index 100%
rename from geneagrapher/graph/graph.py
rename to src/geneagrapher/graph/graph.py
diff --git a/geneagrapher/graph/node.py b/src/geneagrapher/graph/node.py
similarity index 100%
rename from geneagrapher/graph/node.py
rename to src/geneagrapher/graph/node.py
diff --git a/geneagrapher/graph/record.py b/src/geneagrapher/graph/record.py
similarity index 100%
rename from geneagrapher/graph/record.py
rename to src/geneagrapher/graph/record.py
diff --git a/tests/__init__.py b/tests/__init__.py
index e4bafe5..e69de29 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1 +0,0 @@
-import tests
diff --git a/tests/__init__.py b/tests/geneagrapher/__init__.py
similarity index 100%
copy from tests/__init__.py
copy to tests/geneagrapher/__init__.py
diff --git a/tests/test_geneagrapher_methods.py b/tests/geneagrapher/test_geneagrapher_methods.py
similarity index 100%
rename from tests/test_geneagrapher_methods.py
rename to tests/geneagrapher/test_geneagrapher_methods.py
diff --git a/tests/test_grabber_methods.py b/tests/geneagrapher/test_grabber_methods.py
similarity index 100%
rename from tests/test_grabber_methods.py
rename to tests/geneagrapher/test_grabber_methods.py
diff --git a/tests/test_graph_methods.py b/tests/geneagrapher/test_graph_methods.py
similarity index 100%
rename from tests/test_graph_methods.py
rename to tests/geneagrapher/test_graph_methods.py
diff --git a/tests/test_node_methods.py b/tests/geneagrapher/test_node_methods.py
similarity index 100%
rename from tests/test_node_methods.py
rename to tests/geneagrapher/test_node_methods.py
diff --git a/tests/test_record_methods.py b/tests/geneagrapher/test_record_methods.py
similarity index 100%
rename from tests/test_record_methods.py
rename to tests/geneagrapher/test_record_methods.py
diff --git a/tests/tests.py b/tests/geneagrapher/tests.py
similarity index 100%
rename from tests/tests.py
rename to tests/geneagrapher/tests.py

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/geneagrapher.git



More information about the debian-science-commits mailing list