From f358a641c596837e8cd3067f63f5e6464647531c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 14 Oct 2018 12:55:07 -0400 Subject: [PATCH] Get rid of separate extra dependencies --- README.md | 51 ++++++++++++------------------------------------ requirements.txt | 14 ++++++++++++- setup.py | 16 --------------- 3 files changed, 26 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 57d9788..15019fb 100644 --- a/README.md +++ b/README.md @@ -7,47 +7,25 @@ TextWorld requires __Python 3__ and only supports __Linux__ and __Mac__ systems ### Requirements -The following system libraries are required to install and run TextWorld: -``` -sudo apt-get -y install uuid-dev libffi-dev build-essential curl gcc make python3-dev -``` -as well as some Python libraries that can be installed separately using -``` -pip install -r requirements.txt -``` +TextWorld requires some system libraries for its native components. +On a Debian/Ubuntu-based system, these can be installed with + + sudo apt install build-essential uuid-dev libffi-dev python3-dev curl ### Installing TextWorld The easiest way to install TextWorld is via `pip`. After cloning the repo, go inside the root folder of the project (i.e. alongside `setup.py`) and run -``` -pip install . -``` -If you prefer a remote installation: -``` -pip install https://github.com/Microsoft/TextWorld/archive/master.zip -``` -_** In any case, make sure `pip` is associated with your Python 3 installation_ + + pip install . ### Extras -If desired, one can install one or several extra functionalities for TextWorld. To do so, install TextWorld using -``` -pip install .[prompt,vis] -``` -where -- `[prompt]`: enables commands autocompletion (available for generated games only). To activate it, use the `--hint` option when running the `tw-play` script, and press TAB-TAB at the prompt. -- `[vis]`: - enables the game states viewer (available for generated games only). - To activate it, use the `--html-render` option when running the `tw-play` script, - and the current state of the game will be displayed in your browser. - - In order to use the `take_screenshot` or `visualize` functions in `textworld.render`, - you'll need to install either the [Chrome](https://sites.google.com/a/chromium.org/chromedriver/) - or [Firefox](https://github.com/mozilla/geckodriver) webdriver (depending on whichever - browser you have installed). If you have Chrome already installed you can use the following command to - install chromedriver: `pip install chromedriver_installer`. +In order to use the `take_screenshot` or `visualize` functions in `textworld.render`, you'll need to install either the [Chrome](https://sites.google.com/a/chromium.org/chromedriver/) or [Firefox](https://github.com/mozilla/geckodriver) webdriver (depending on which browser you have installed). +If you have Chrome already installed you can use the following command to install chromedriver + + pip install chromedriver_installer ## Usage @@ -56,9 +34,8 @@ where TextWorld provide an easy way of generating simple text-based games via the `tw-make` script. For instance, -``` -tw-make custom --world-size 5 --nb-objects 10 --quest-length 5 --seed 1234 --output gen_games/ -``` + tw-make custom --world-size 5 --nb-objects 10 --quest-length 5 --seed 1234 --output gen_games/ + where `custom` indicates we want to customize the game using the following options: `--world-size` controls the number of rooms in the world, `--nb-objects` controls the number of objects that can be interacted with (excluding doors) and `--quest-length` controls the minimum number of commands that is required to type in order to win the game. Once done, the game `game_1234.ulx` will be saved in the `gen_games/` folder. @@ -66,9 +43,7 @@ where `custom` indicates we want to customize the game using the following optio To play a game, one can use the `tw-play` script. For instance, the command to play the game generated in the previous section would be -``` -tw-play gen_games/simple_game.ulx -``` + tw-play gen_games/simple_game.ulx _* Only Z-machine's games (*.z1 through *.z8) and Glulx's games (*.ulx) are supported._ diff --git a/requirements.txt b/requirements.txt index 1a347e4..eabddbc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +# Main dependencies numpy>=1.13.1 tqdm>=4.17.1 cffi>=1.0.0 @@ -7,4 +8,15 @@ urwid>=2.0.1 more_itertools tatsu>=4.2.5 hashids>=1.2.0 -jericho>=1.1.0 \ No newline at end of file +jericho>=1.1.0 + +# For visualization +pybars3>=0.9.3 +flask>=1.0.2 +selenium>=3.12.0 +greenlet==0.4.13 +gevent==1.3.5 +pillow>=5.1.0 + +# For advanced prompt +prompt-toolkit<2.0.0,>=1.0.15 diff --git a/setup.py b/setup.py index f4c4c5c..b67f06d 100644 --- a/setup.py +++ b/setup.py @@ -65,20 +65,4 @@ setup( tests_require=[ 'nose==1.3.7', ], - extras_require={ - 'vis': [ - 'pybars3>=0.9.3', - 'flask>=1.0.2', - 'selenium>=3.12.0', - 'greenlet==0.4.13', - 'gevent==1.3.5', - 'pillow>=5.1.0', - ], - 'prompt': [ - 'prompt-toolkit<2.0.0,>=1.0.15', - ], - 'gym': [ - 'gym_textworld', - ], - }, )