Package: autosimulationcraft
AutoSimulationCraftA python script to runSimulationCraftreports for World of Warcraft characters when their gear/stats/level/etc. changes.What It DoesWhen run, the script will first read in its configuration file (see below).For each character in theCHARACTERSdictionary, it will use the BattleNet API
to request details about the character (currently: appearance, equipment, level,
stats and talents) and cache this information locally (in the same
directory as the configuration file). The first time a specific character is
found in the configuration file, asimcreport will be generated for the
character, and emailed to a configurable (per-character) list of email addresses.On subsequent runs, the script will compare BattleNet’s current information for
the character with what the script saved to disk during its last run. If the
information is the same, that character will be skipped. Otherwise, a report
will be generated and sent via email (and also saved to disk).This script is suitable for running via cron or another job scheduler (say, daily),
and it will automatically run SimulationCraft and email the report whenever
changes occur on the characters.StatusI got this working for myself originally as a single self-contained script.
The code - especially the tests - desperately need a refactor. If I keep using
it, or anyone else starts using it, maybe I’ll try that.RequirementsA working installation ofSimulationCraftwith (at least) the command line portion.Python2.7- The upstream library that I chose to use for the BattleNet API only works with python2. As is the case
with all of my current code, I target 2.7 through current (3.4) for development, as the effort to get code that also works withhorribly ancient2.6 isn’t worth it. I’ve cut a branch to start work on solving
this problem. Until then, 2.7 is it. Sorry.PythonVirtualEnvandpip(recommended installation method; your OS/distribution should have packages for these)InstallationIt’s recommended that you install into a virtual environment (virtualenv /
venv). See thevirtualenv usage documentationfor information on how to create a venv. If you really want to install
system-wide, you can (using sudo).pipinstallautosimulationcraftConfigurationRunningautosimc--genconfigWill generate a default configuration file at~/.autosimulationcraft/settings.py. Open this with your
favorite text editor; the comments should be enough to help you configure it.UsageI’d recommend callingautosimcfrom cron, or some other method of running it automatically
on a regular basis. If you want to, youcanrun it manually.Bugs and Feature RequestsBug reports and feature requests are happily accepted via theGitHub Issue Tracker. Pull requests are
welcome. Issues that don’t have an accompanying pull request will be worked on
as my time and priority allows.DevelopmentTo install for development:Fork theautosimulationcraftrepository on GitHubCreate a new branch off of master in your fork.$virtualenvautosimulationcraft$cdautosimulationcraft&&sourcebin/activate$pipinstall-egit+git@github.com:YOURNAME/autosimulationcraft.git@BRANCHNAME#egg=autosimulationcraft$cdsrc/autosimulationcraftThe git clone you’re now in will probably be checked out to a specific commit,
so you may want togit checkout BRANCHNAME.Guidelinespep8 compliant with some exceptions (see pytest.ini)100% test coverage with pytest (with valid tests)TestingTesting is done viapytest, driven bytox.testing is as simple as:pip install toxtoxIf you want to see code coverage:tox-ecovthis produces two coverage reports - a summary on STDOUT and a full report in thehtmlcov/directoryIf you want to pass additional arguments to pytest, add them to the tox command line after “–”. i.e., for verbose pytext output on py27 tests:tox-epy27---vRelease ChecklistOpen an issue for the release; cut a branch off master for that issue.Confirm that there are CHANGES.rst entries for all major changes.Ensure that Travis tests passing in all environments.Ensure that test coverage is no less than the last release (ideally, 100%).Increment the version number in autosimulationcraft/version.py and add version and release date to CHANGES.rst, then push to GitHub.Confirm that README.rst renders correctly on GitHub.Upload package to testpypi, confirm that README.rst renders correctly.Make sure your ~/.pypirc file is correctpython setup.py register-rhttps://testpypi.python.org/pypipython setup.py sdist bdist_wheel upload-rhttps://testpypi.python.org/pypiCheck that the README renders athttps://testpypi.python.org/pypi/autosimulationcraftCreate a pull request for the release to be merge into master. Upon successful Travis build, merge it.Tag the release in Git, push tag to GitHub:tag the release. for now the message is quite simple:git tag-aX.Y.Z-m'X.Y.Z releasedYYYY-MM-DD'push the tag to GitHub:git push origin X.Y.ZUpload package to live pypi:python setup.py sdist bdist_wheel uploadmake sure any GH issues fixed in the release were closed.