Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Generate package list automatically in find_packages #646

Merged
merged 1 commit into from

2 participants

@minrk
Owner

Previously, the package list was manually specified, which meant that it became out of date any time a package was added, and IPython would become uninstallable. This would not be noticed for some time by developers, who always use setupegg.py --develop or symlinks.

This update immediately revealed that IPython.zmq.tests and IPython.extensions.tests were never included in 0.11. Other than that, there is no difference in the package list.

Wait for after 0.11, in case of unforeseen side effects.

@minrk
Owner

@fperez is there any reason that we should not do it this way? The only one I see is that you can change what's installed by creating new files inside the IPython dir, but this doesn't strike me as anything but an improvement.

@fperez
Owner

Nope, that's certainly the right way to do it. Merge away!

@minrk minrk Generate package list automatically in find_packages
Previously, the package list was manually specified, which meant that
it became out of date any time a package was added, and IPython would
become uninstallable. This would not be noticed for some time by
developers, who always use `setupegg.py --develop` or symlinks.

This update immediately revealed that IPython.zmq.tests and IPython.extensions.tests were never included in 0.11.  Other than that, there is no difference in the package list.
1eea56b
@minrk minrk merged commit 1eea56b into ipython:master
@jasongrout jasongrout referenced this pull request from a commit in jasongrout/ipython
@jasongrout jasongrout Extract session buffers as memoryviews
A bug in pyzmq forces us to have a workaround, which can be deleted when the pyzmq dependency is upgraded to fix pyzmq issue #646.

Thanks to @minrk for helping work on the code and also for the bugfix in pyzmq.
d4b39a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 1, 2011
  1. @minrk

    Generate package list automatically in find_packages

    minrk authored
    Previously, the package list was manually specified, which meant that
    it became out of date any time a package was added, and IPython would
    become uninstallable. This would not be noticed for some time by
    developers, who always use `setupegg.py --develop` or symlinks.
    
    This update immediately revealed that IPython.zmq.tests and IPython.extensions.tests were never included in 0.11.  Other than that, there is no difference in the package list.
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 48 deletions.
  1. +11 −48 setupbase.py
View
59 setupbase.py
@@ -82,58 +82,21 @@ def file_doesnt_endwith(test,endings):
# Find packages
#---------------------------------------------------------------------------
-def add_package(packages,pname,config=False,tests=False,scripts=False,
- others=None):
- """
- Add a package to the list of packages, including certain subpackages.
- """
- packages.append('.'.join(['IPython',pname]))
- if config:
- packages.append('.'.join(['IPython',pname,'config']))
- if tests:
- packages.append('.'.join(['IPython',pname,'tests']))
- if scripts:
- packages.append('.'.join(['IPython',pname,'scripts']))
- if others is not None:
- for o in others:
- packages.append('.'.join(['IPython',pname,o]))
-
def find_packages():
"""
Find all of IPython's packages.
"""
- packages = ['IPython']
- add_package(packages, 'config', tests=True, others=['profile'])
- add_package(packages, 'core', tests=True)
- add_package(packages, 'extensions')
- add_package(packages, 'external')
- add_package(packages, 'external.argparse')
- add_package(packages, 'external.decorator')
- add_package(packages, 'external.decorators')
- add_package(packages, 'external.guid')
- add_package(packages, 'external.Itpl')
- add_package(packages, 'external.mglob')
- add_package(packages, 'external.path')
- add_package(packages, 'external.pexpect')
- add_package(packages, 'external.pyparsing')
- add_package(packages, 'external.simplegeneric')
- add_package(packages, 'external.ssh')
- add_package(packages, 'kernel')
- add_package(packages, 'frontend')
- add_package(packages, 'frontend.qt')
- add_package(packages, 'frontend.qt.console', tests=True)
- add_package(packages, 'frontend.terminal', tests=True)
- add_package(packages, 'lib', tests=True)
- add_package(packages, 'parallel', tests=True, scripts=True,
- others=['apps','engine','client','controller'])
- add_package(packages, 'quarantine', tests=True)
- add_package(packages, 'scripts')
- add_package(packages, 'testing', tests=True)
- add_package(packages, 'testing.plugin', tests=False)
- add_package(packages, 'utils', tests=True)
- add_package(packages, 'zmq')
- add_package(packages, 'zmq.pylab')
- add_package(packages, 'zmq.gui')
+ excludes = ['deathrow']
+ packages = []
+ for dir,subdirs,files in os.walk('IPython'):
+ package = dir.replace(os.path.sep, '.')
+ if any([ package.startswith('IPython.'+exc) for exc in excludes ]):
+ # package is to be excluded (e.g. deathrow)
+ continue
+ if '__init__.py' not in files:
+ # not a package
+ continue
+ packages.append(package)
return packages
#---------------------------------------------------------------------------
Something went wrong with that request. Please try again.