Importing pokedex can take several seconds due to its rather large
dependencies—in particular, sqlalchemy, whoosh, and pkg_resources seem
to be the largest offenders. Normally, it would be possible to import
only the submodules one needs (pokedex.db, say), but pokedex.__init__
brings in all the submodules, for use by the command-line interface.
The fix is rather obvious:
- Move the command-line stuff into pokedex.main.
Note: because the submodules are no longer imported by default, any
script which expects `import pokedex` to be useful will likely break.
Note: the `pokedex` command will not work until you re-run `python
setup.py develop`, to update entry_points.txt.
- Don't import pkg_resources until necessary.
- Helper base class: Named
Subclasses: OfficiallyNamed, UnofficiallyNamed
for these, a 'name' column is created in the appropriate text table
also, they get automatic __str__/__repr__/__unicode__
- Faux columns: ProseColumn, TextColumn
these become columns in the appropriate text tables
these text tables (*_text, *_prose) are auto-generated at the end
the main table gets one property (singular name) that gets the English text
and one (plural name) with dict of texts keyed by language
- Every named table gets 'identifier'
- Languages compare & hash equal to their identifiers
- Existing foreign-name tables replaced by the autogenerated ones
- order_by: names replaced by identifiers
- New function: all_tables(), yields all tables
- Markdown move properties removed for now
- Schema test suite
The CSVs are now the only package data. Otherwise, setuptools would
copy every single sprite individually to the standard library directory,
which is slow and time-consuming and wasteful. If you need the sprites,
use them from the repo. :(
The package_data line was still wrong.
Also turned off zip_safe, since it's really not; pokedex setup tries to
write to the install directory!
Finally, bumped the whoosh version; the beta I required has been taken
off pypi, and the bugs in b6 seem to be gone now.