Skip to content

Commit

Permalink
Pip and setup.py runs bootstrap; dependencies to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnamespace committed Feb 24, 2016
1 parent 0aee59e commit 211fa97
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ cache:
directories:
- $HOME/.pip-cache/
- $HOME/virtualenv/python3.5
script:
# Travis will automatically detect requirements.txt and run pip install
- fireplace/bootstrap
- ./setup.py install
- py.test
install:
- pip install -r requirements.txt
- pip install .
script: py.test
notifications:
email:
on_failure: always
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
-e git+https://github.com/HearthSim/python-hearthstone.git#egg=hearthstone
pytest
git+https://github.com/HearthSim/python-hearthstone.git#egg=hearthstone
37 changes: 34 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import os.path
import fireplace
from setuptools import setup, find_packages

from setuptools.command.develop import develop
from setuptools.command.install import install
from subprocess import call

README = open(os.path.join(os.path.dirname(__file__), "README.md")).read()

Expand All @@ -17,13 +19,42 @@
"Topic :: Games/Entertainment :: Simulation",
]


def post_install(install_dir):
call(os.path.join(os.path.curdir, "bootstrap"),
cwd=os.path.join(install_dir, "fireplace"),
shell=True)


class custom_install(install):
def run(self):
super(custom_install, self).run()
self.execute(post_install, [self.install_lib],
msg="Running card definition bootstrap")


class custom_develop(develop):
def run(self):
super(custom_develop, self).run()
self.execute(post_install, [self.setup_path],
msg="Running card definition bootstrap")


tests_require=["pytest"]
setup(
name="fireplace",
version=fireplace.__version__,
packages=find_packages(exclude="tests"),
package_data={"": ["CardDefs.xml"]},
package_data={"fireplace":["bootstrap", "scripts/bootstrap.*"]},
include_package_data=True,
tests_require=["pytest"],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
install_requires=["hearthstone"],
dependency_links=["git+https://github.com/HearthSim/python-hearthstone.git#egg=hearthstone-0"],
cmdclass={"develop":custom_develop,
"install":custom_install},
author=fireplace.__author__,
author_email=fireplace.__email__,
description="Pure-python Hearthstone re-implementation and simulator",
Expand Down

0 comments on commit 211fa97

Please sign in to comment.