Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #36 from inklesspen/egg-main
Browse files Browse the repository at this point in the history
Default to a 'main' entry point with eggs.
  • Loading branch information
inklesspen committed Jun 17, 2015
2 parents 165c80e + 5e91c8f commit b9b3e94
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -8,6 +8,7 @@ unreleased
* Removed zope.interface requirement, since the interfaces themselves were removed in 0.2.0.
* Removed useless console_script entry point.
* Changed loader detection to only consider the final extension in a filename.
* Support and test egg specifications with no named entry point (because it's 'main').

0.2.0 (2015-06-14)
-----------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion src/montague/loadwsgi.py
Expand Up @@ -107,7 +107,10 @@ def inner(wsgi_app):
return factory

def _load_entry_point_factory(self, resource, entry_point_groups):
pkg, name = resource.split('#')
if "#" in resource:
pkg, name = resource.split('#')
else:
pkg, name = resource, "main"
entry_point_map = pkg_resources.get_entry_map(pkg)
factory = None
for group in entry_point_groups:
Expand Down
4 changes: 2 additions & 2 deletions tests/config_files/simple_config.json
Expand Up @@ -8,14 +8,14 @@
"use": "egg:montague_testapps#other"
},
"filtered-app": {
"use": "package:montague_testapps#basic_app",
"use": "package:montague_testapps",
"filter-with": "filter"
}
},
"composite": {},
"server": {
"server_factory": {
"use": "egg:montague_testapps#server_factory",
"use": "egg:montague_testapps",
"port": 42
},
"server_runner": {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_json_handling.py
Expand Up @@ -38,7 +38,7 @@ def test_read_config(working_set):
'egg': {'use': 'egg:montague_testapps#other'},
'filtered-app': {
'filter-with': 'filter',
'use': 'package:montague_testapps#basic_app',
'use': 'package:montague_testapps',
},
},
"composite": {},
Expand All @@ -50,7 +50,7 @@ def test_read_config(working_set):
},
'server': {
'server_factory': {
'use': 'egg:montague_testapps#server_factory',
'use': 'egg:montague_testapps',
'port': 42,
},
'server_runner': {
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -21,7 +21,7 @@ setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
deps =
montague_testapps >= 0.1.2
montague_testapps >= 0.1.3
mock
pytest
pytest-capturelog
Expand Down

0 comments on commit b9b3e94

Please sign in to comment.