Move game_template into evennia package. Update setup.py and bin/evennia

This commit is contained in:
Jonathan Piacenti 2015-01-16 08:19:33 -06:00
parent b95ff4e976
commit 00238275d6
130 changed files with 20 additions and 21 deletions

View file

@ -5,11 +5,15 @@ os.chdir(os.path.dirname(os.path.realpath(__file__)))
def get_requirements():
"""
To update the requirements for Evennia, edit the requirements.txt file.
"""
req_lines = open('requirements.txt', 'r').readlines()
reqs = []
for line in req_lines:
line = line.strip()
if line and not line.startswith('#'):
# Avoid adding comments.
line = line.split('#')[0].strip()
if line:
reqs.append(line)
return reqs
@ -17,41 +21,36 @@ VERSION_PATH = os.path.join('evennia', 'VERSION.txt')
def get_version():
"""
When updating the Evennia package for release, remember to increment the
version number in evennia/VERSION.txt
"""
return open(VERSION_PATH).read().strip()
def package_data():
"""
By default, the distribution tools ignore all non-python files.
Make sure we get everything.
"""
file_set = []
for root, dirs, files in os.walk('evennia'):
for f in files:
if '.git' in f.split(os.path.normpath(os.path.join(root, f))):
# Prevent the repo from bing added.
continue
file_name = os.path.relpath(os.path.join(root, f), 'evennia')
file_set.append(file_name)
return file_set
def template_data():
"""
Finds all of the static and template dirs in the project and adds
them to the package data.
By default setup.py only installs Python modules.
"""
data = []
for dirname, _, files in os.walk("game_template"):
for root, ___, current_files in os.walk(dirname):
for f in current_files:
file_name = os.path.join(root, f)
data.append((os.path.join('share', 'evennia', root), [file_name]))
return data
setup(
name='evennia',
version=get_version(),
description='A full-featured MUD building toolkit.',
packages=find_packages(exclude=['game_template', 'game_template.*']),
packages=find_packages(),
scripts=['bin/evennia', 'bin/evennia_runner.py'],
install_requires=get_requirements(),
package_data={'': package_data()},
data_files=template_data(),
zip_safe=False
)