Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

Commit afc0d3f

Browse files
committed
Merge pull request #45 from aagbsn/master
automagically resolve dependencies during installation
2 parents 175a328 + 8083aad commit afc0d3f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Diff for: apaf/config.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from __future__ import with_statement
66

77
import sys
8-
import yaml
8+
try:
9+
import yaml
10+
except ImportError:
11+
yaml = None
12+
913
import os
1014
import os.path
1115
from copy import deepcopy
@@ -156,8 +160,13 @@ def reset(self):
156160
self.vars = deepcopy(self.defaults)
157161
self.commit()
158162

159-
from utils.hashing import random_bytes
160-
custom = Config(config_file='apaf.cfg',
163+
try:
164+
from utils.hashing import random_bytes
165+
except ImportError:
166+
random_bytes = None
167+
# log some error?
168+
if yaml and random_bytes:
169+
custom = Config(config_file='apaf.cfg',
161170
defaults=dict(
162171
base_port=4242,
163172
services=['staticwebserver', 'zinniablog'], # list of services to be started

Diff for: setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
options=dict(py2app=OPTIONS_PY2APP,
8787
py2exe=OPTIONS_PY2EXE,
8888
),
89+
install_requires=open('requirements.txt').readlines(),
8990
entry_points=dict(console_scripts=['apaf = apaf.main']),
9091
packages=find_packages(exclude=['test']),
9192
**PLATFORM_OPTIONS[config.platform]

0 commit comments

Comments
 (0)