Skip to content

Commit 8801324

Browse files
initial travis.yml + gitignore
1 parent 2acee50 commit 8801324

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
src/apipkg/version.py
2+
__pycache__
3+
*.egg-info
4+
.cache/
5+
.eggs/

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: python
2+
python:
3+
- "2.6"
4+
- "2.7"
5+
- "3.3"
6+
- "3.4"
7+
- "3.5"
8+
- "3.5-dev" # 3.5 development branch
9+
- "3.6"
10+
- "3.6-dev" # 3.6 development branch
11+
- "3.7-dev" # 3.7 development branch
12+
- "nightly" # currently points to 3.7-dev
13+
# command to install dependencies
14+
env:
15+
- EDITABLE=-e
16+
- EDITABLE=
17+
install:
18+
- pip install -U setuptools pip setuptools_scm pytest
19+
- pip install $EDITABLE .
20+
# command to run tests
21+
script: pytest

src/apipkg/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def distribution_version(name):
3535
return dist.version
3636

3737

38-
def initpkg(pkgname, exportdefs, attr=dict(), eager=False):
38+
def initpkg(pkgname, exportdefs, attr=None, eager=False):
3939
""" initialize given package from the export definitions. """
40+
attr = attr or {}
4041
oldmod = sys.modules.get(pkgname)
4142
d = {}
4243
f = getattr(oldmod, '__file__', None)
@@ -64,6 +65,7 @@ def initpkg(pkgname, exportdefs, attr=dict(), eager=False):
6465

6566

6667
def importobj(modpath, attrname):
68+
"""imports a module, then resolves the attrname on it"""
6769
module = __import__(modpath, None, None, ['__doc__'])
6870
if not attrname:
6971
return module
@@ -76,6 +78,7 @@ def importobj(modpath, attrname):
7678

7779

7880
class ApiModule(ModuleType):
81+
"""the magical lazy-loading module standing"""
7982
def __docget(self):
8083
try:
8184
return self.__doc

0 commit comments

Comments
 (0)