Added a separate win_requirements.txt file for handling windows requirement specifics.

This commit is contained in:
Griatch 2015-03-07 20:57:50 +01:00
parent 1c298951d6
commit 5274d111a2
3 changed files with 18 additions and 6 deletions

View file

@ -1,5 +1,4 @@
# Evennia dependencies. If using pip, this file can be used to install # Evennia dependencies, for Linux/Mac platforms
# dependencies directly, using 'pip install -r requirements.txt'.
django >= 1.7 django >= 1.7
twisted >= 12.0 twisted >= 12.0

View file

@ -5,13 +5,16 @@ from setuptools import setup, find_packages
os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir(os.path.dirname(os.path.realpath(__file__)))
VERSION_PATH = os.path.join('evennia', 'VERSION.txt') VERSION_PATH = os.path.join('evennia', 'VERSION.txt')
OS_WINDOWS = os.name == "nt"
def get_requirements(): def get_requirements():
""" """
To update the requirements for Evennia, edit the requirements.txt file. To update the requirements for Evennia, edit the requirements.txt
file, or win_requirements.txt for Windows platforms.
""" """
req_lines = open('requirements.txt', 'r').readlines() filename = 'win_requirements.txt' if OS_WINDOWS else 'requirements.txt'
with open(filename, 'r') as f:
req_lines = f.readlines()
reqs = [] reqs = []
for line in req_lines: for line in req_lines:
# Avoid adding comments. # Avoid adding comments.
@ -26,7 +29,7 @@ def get_scripts():
Determine which executable scripts should be added. For Windows, Determine which executable scripts should be added. For Windows,
this means creating a .bat file. this means creating a .bat file.
""" """
if os.name == "nt": if OS_WINDOWS:
batpath = os.path.join("bin", "windows", "evennia.bat") batpath = os.path.join("bin", "windows", "evennia.bat")
scriptpath = os.path.join(sys.prefix, "Scripts", "evennia_launcher.py") scriptpath = os.path.join(sys.prefix, "Scripts", "evennia_launcher.py")
with open(batpath, "w") as batfile: with open(batpath, "w") as batfile:

10
win_requirements.txt Normal file
View file

@ -0,0 +1,10 @@
# Evennia dependencies, for Windows platform
# windows specific
pypiwin32
psutil >= 2.2
# general
django >= 1.7
twisted >= 12.0
mock >= 1.0.1
pillow