Skip to content

Commit

Permalink
check for required setup.py arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bretth committed Nov 18, 2010
1 parent 1058a56 commit 1eb9996
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion woven/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def mm_version(vers):
return (finalvers,stage,stage_sep)

v = version.split('.')
if len(v)==1: return v[0]
major = v[0]
minor = v[1]
maint = ''
Expand Down Expand Up @@ -243,14 +244,18 @@ def set_env(settings=None, setup_dir=''):
else:
fabfile_path = find_fabfile()
if not fabfile_path:
print 'Error: You must create a setup.py file above your project/package directory'
print 'Error: You must create a setup.py file in your distribution'
sys.exit(1)

local_working_dir = os.path.split(fabfile_path)[0]
env.fabfile = original_fabfile
os.chdir(local_working_dir)

setup = run_setup('setup.py',stop_after="init")
print setup.get_version()
if setup.get_name() == 'UNKNOWN' or setup.get_version()=='0.0.0' or not setup.packages:
print "ERROR: You must define a minimum of name, version and packages in your setup.py"
sys.exit(1)

#project env variables for deployment
env.project_name = setup.get_name() #project_name()
Expand Down

0 comments on commit 1eb9996

Please sign in to comment.