Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dylan/publish to pypi #939

Open
wants to merge 132 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
9d160c7
Initial blueprint mod
Nov 23, 2022
362caec
Remove extra committed files
cassidylaidlaw Dec 8, 2022
f7c5ecd
Revert more unnecessary changes
cassidylaidlaw Dec 8, 2022
5d62e29
Fix accidentally removed file
cassidylaidlaw Dec 8, 2022
26a9e81
Revert a couple more files
cassidylaidlaw Dec 8, 2022
3d5be5b
Including ghost blocks source repository
Dec 8, 2022
5b64986
Implement blueprints as part of Malmo
cassidylaidlaw Dec 9, 2022
7be3e75
Remove ghost blocks mod as it's not needed any more
cassidylaidlaw Dec 9, 2022
65e0945
Revert changes to XML schema (not needed any more)
cassidylaidlaw Dec 9, 2022
2bd487e
Revert another change that's no longer needed
cassidylaidlaw Dec 9, 2022
1c321b7
Fixing dirt blocks not dropping
Dec 16, 2022
90b61a1
Removing DS Store
Dec 16, 2022
5c91050
Fixing lower level not being generated
Dylan102938 Dec 25, 2022
52e416f
Configure compilation of C++ MalmoPython module from setup.py
cassidylaidlaw Jan 31, 2023
23cfd04
Add workflow for building wheels
cassidylaidlaw Jan 31, 2023
68d1995
Remove macOS build for wheels for now
cassidylaidlaw Jan 31, 2023
b10b14b
Forgot to add install_boost script
cassidylaidlaw Jan 31, 2023
703aa0c
Fix missing import error
cassidylaidlaw Jan 31, 2023
f2803ea
Match code formatting
cassidylaidlaw Jan 31, 2023
a2cddf5
Use self-hosted action runners for now
cassidylaidlaw Jan 31, 2023
7a9387f
Add workflow_dispatch trigger for wheel build
cassidylaidlaw Jan 31, 2023
523a963
Fix runs-on syntax in wheels workflow
cassidylaidlaw Jan 31, 2023
74a496d
Try again to fix runs-on syntax
cassidylaidlaw Jan 31, 2023
d5e96cb
Trigger CI
cassidylaidlaw Jan 31, 2023
93578f5
Switch to macOS for testing wheel builds
cassidylaidlaw Jan 31, 2023
9a95af8
Try to configure wheel building on macOS
cassidylaidlaw Jan 31, 2023
295a33d
Fix some macOS wheel issues
cassidylaidlaw Jan 31, 2023
17b9670
Fix issues with building wheels on macOS
cassidylaidlaw Feb 1, 2023
062f3bc
Fix Boost not finding python headers in macOS
cassidylaidlaw Feb 1, 2023
c955238
Cache downloads in wheel building
cassidylaidlaw Feb 1, 2023
a7e74a4
Fix caching and test wheels in non-local runner
cassidylaidlaw Feb 1, 2023
4fe8265
Fix runs-on spec for macOS
cassidylaidlaw Feb 1, 2023
ab55a2a
Try cp39 on local runner
cassidylaidlaw Feb 1, 2023
49d2bcd
Fix self-hosted runner syntax
cassidylaidlaw Feb 1, 2023
281ce4a
Fix issue with caching in wheels workflow
cassidylaidlaw Feb 1, 2023
67abb93
Build all library dependencies on macOS to work on both arm64 and x86_64
cassidylaidlaw Feb 1, 2023
455027e
Fix issue with macOS wheels script
cassidylaidlaw Feb 1, 2023
fa01624
Forgot to uncomment deps installation and flag changes
cassidylaidlaw Feb 1, 2023
21712e0
Add Minecraft directory to wheels and build for python up to 3.11
cassidylaidlaw Feb 1, 2023
ca0f389
Fix absolute paths in setup.py
cassidylaidlaw Feb 1, 2023
fb0e6f9
Try building macOS wheels on GitHub hosted runner
cassidylaidlaw Feb 1, 2023
b3489a5
Fix runner spec
cassidylaidlaw Feb 1, 2023
0a0b01e
Build linux wheels
cassidylaidlaw Feb 1, 2023
2c9da2e
Build all Python version linux wheels
cassidylaidlaw Feb 1, 2023
99e6cd6
Fix install_boost_linux.sh
cassidylaidlaw Feb 1, 2023
e6d8667
Only use -headerpad_max_install_names on macOS
cassidylaidlaw Feb 1, 2023
84db4d5
Include all Minecraft files in wheel and implement launching from python
cassidylaidlaw Feb 1, 2023
564e276
Configure testing in cibuildwheel
cassidylaidlaw Feb 2, 2023
ce33d4b
Fix some issues with tests in cibuildwheel
cassidylaidlaw Feb 2, 2023
921d01d
Increase timeout for Minecraft launch during testing
cassidylaidlaw Feb 2, 2023
4ee4988
Forgot to include actual test scripts in repo
cassidylaidlaw Feb 2, 2023
29878aa
Fix http URL in GradleForge causing issues during Minecraft build
cassidylaidlaw Feb 2, 2023
070bf8b
Try adding additional options to Xvfb to see if it helps in linux
cassidylaidlaw Feb 2, 2023
c1cb7e7
Stop delocate from looking in .class files
cassidylaidlaw Feb 2, 2023
05dbc27
Import malmo package in test to make sure MALMO_XSD_PATH is set
cassidylaidlaw Feb 2, 2023
22ce38d
Install zip in linux for testing
cassidylaidlaw Feb 2, 2023
390af8d
Hopefully make killing child processes in test.sh more cross-platform…
cassidylaidlaw Feb 2, 2023
90507b8
Use fail-fast = false in wheels workflow
cassidylaidlaw Feb 2, 2023
ab2d2ec
Try to make test.sh exit code 0 on success
cassidylaidlaw Feb 2, 2023
42327ef
Add debugging output to look into linux issues
cassidylaidlaw Feb 2, 2023
264d2b9
Try another method to not make macOS jobs crash
cassidylaidlaw Feb 2, 2023
bd62b34
Try testing wheels separately on linux to avoid X server issues
cassidylaidlaw Feb 2, 2023
30fc1fe
Try building both python 3.8 and 3.9 wheels
cassidylaidlaw Feb 2, 2023
c54fdb2
Avoid endless loops in test.sh
cassidylaidlaw Feb 2, 2023
0b58f33
Exclude macOS for now to test linux testing
cassidylaidlaw Feb 2, 2023
ce3753b
Fix crash in linux testing
cassidylaidlaw Feb 2, 2023
f802503
Remove test script and just run python test script directly
cassidylaidlaw Feb 2, 2023
f6e42e7
Try running new test script on macOS
cassidylaidlaw Feb 2, 2023
f0611fb
Oops, forgot to add macOS to build matrix
cassidylaidlaw Feb 2, 2023
bbd374a
Build all python versions 3.8-3.11
cassidylaidlaw Feb 2, 2023
ae71813
Don't build for Python 3.11 since it has errors in boost
cassidylaidlaw Feb 2, 2023
b45fa19
Switch to just workflow dispatch trigger
cassidylaidlaw Feb 3, 2023
b7ae23f
Merge pull request #2 from cassidylaidlaw/cassidy/build_wheels
cassidylaidlaw Feb 8, 2023
938c792
Remove __main__.py from malmo package
cassidylaidlaw Feb 8, 2023
9737a6b
Better selection of default ports for launching Minecraft from Python
cassidylaidlaw Feb 8, 2023
41c1af2
Merge pull request #3 from cassidylaidlaw/cassidy/build_wheels
cassidylaidlaw Feb 8, 2023
b4aeea5
Merge branch 'master' into dylan/blueprint
cassidylaidlaw Feb 8, 2023
cb4efeb
Expose MissionInitSpec to Python
cassidylaidlaw Feb 10, 2023
d094a84
Fixed Malmo base level error
Dylan102938 Feb 20, 2023
3f20737
Choose client commands port deterministically to avoid networking issues
cassidylaidlaw Feb 22, 2023
c70e791
Merge branch 'master' into dylan/blueprint
cassidylaidlaw Mar 7, 2023
65c8a3b
Updated the transparency of the blueprint blocks
cassidylaidlaw Mar 7, 2023
24c7bd7
adding blockblueprint changes and en_us.lang
Dylan102938 Apr 17, 2023
f6b6b8b
Make blueprint block names show up correctly
cassidylaidlaw Apr 18, 2023
835d9e6
Add option not to render blueprint blocks
cassidylaidlaw Apr 18, 2023
7c216e1
Remove extraneous files
cassidylaidlaw Apr 18, 2023
d3fd317
Changing localized name to reflect real block names
Dylan102938 Apr 24, 2023
8798a49
Added temporary wrong block mappings
Dylan102938 Apr 24, 2023
9f51bfe
Revert unnecessary changes
cassidylaidlaw Apr 25, 2023
6aaa257
Remove collision checking with blueprint blocks to allow humans to pl…
cassidylaidlaw Apr 25, 2023
f036285
Error block changes
Dylan102938 May 9, 2023
e2c12cc
Adding error blocks for ground
Dylan102938 May 16, 2023
4883fc3
Implement (buggy) toggle for blueprint blocks
cassidylaidlaw May 23, 2023
5d50bda
Fixing bottom level all errors + placing in air results in no error b…
Dylan102938 May 30, 2023
48984a6
Fix full/partial blueprint toggle and various blueprint issues
cassidylaidlaw May 30, 2023
ff0bcc4
Adjust transparency of blueprint block textures
cassidylaidlaw May 30, 2023
64d8ff3
Fixed double block drop issue
Dylan102938 Jun 8, 2023
65f036e
Merge branch 'cassidy/toggle_full_blueprint' of https://github.com/ca…
Dylan102938 Jun 8, 2023
b45a3c4
Change runner tag for wheels workflow to just ubuntu
cassidylaidlaw Jun 8, 2023
ce8afbd
Adjust glass blueprint transparency to 30%
cassidylaidlaw Jun 8, 2023
91f569f
Fixing block break speeds,glass transparency
Dylan102938 Jun 15, 2023
013b7b8
Merge branch 'cassidy/toggle_full_blueprint' of https://github.com/ca…
Dylan102938 Jun 15, 2023
81a92c5
Adding Grass Error Block
Dylan102938 Jun 20, 2023
d04caec
Allow cycling between full, partial, and no blueprint
cassidylaidlaw Jun 20, 2023
758a644
Remove unnecessary changes
cassidylaidlaw Jun 20, 2023
ca74240
Change wool to yellow and add blue tint to blueprint blocks
cassidylaidlaw Jun 20, 2023
67cb3c3
Fix issue where blueprint blocks that should be dirt show up as logs
cassidylaidlaw Jun 20, 2023
8cfbf8c
Fix issues with error blocks in ObservationFromRay
cassidylaidlaw Jul 18, 2023
e36140e
Merge pull request #4 from cassidylaidlaw/cassidy/toggle_full_blueprint
cassidylaidlaw Jul 18, 2023
1317256
Adding upload wheels
Dylan102938 Sep 19, 2023
69b72ee
switching twine with pypa
Dylan102938 Oct 9, 2023
f2d977e
Disable wheel testing on macOS for now
cassidylaidlaw Oct 9, 2023
30e4974
Downgrade host Python version for cibuildwheel to avoid pip issues
cassidylaidlaw Oct 9, 2023
6aa4b29
Quote Python version in YAML
cassidylaidlaw Oct 9, 2023
2d30c50
Switch test_wheels to use ubuntu tag instead of ubuntu-20.04
cassidylaidlaw Oct 9, 2023
d2539c0
Updating workflow to use version control
Dylan102938 Oct 10, 2023
f0e5d3c
Testing pypi yaml file
Dylan102938 Oct 12, 2023
b50da34
Editing workflow to retry
Dylan102938 Oct 12, 2023
c5ce472
Making slight edits
Dylan102938 Oct 12, 2023
baa2f68
Ignoring workflow conclusion
Dylan102938 Oct 12, 2023
b524ce7
Making workflow conclusion empty string
Dylan102938 Oct 12, 2023
eea32a7
Copying files to dist folder
Dylan102938 Oct 12, 2023
aa4aadd
Adding pypa publish
Dylan102938 Oct 12, 2023
b3a2458
Trying to publish to mbag-malmo
Dylan102938 Oct 12, 2023
a380751
Reverting back to original cp
Dylan102938 Oct 12, 2023
cead08c
Change publish workflow to use test PyPI and be activated by workflow
cassidylaidlaw Oct 16, 2023
3ff6df1
Activate pypi workflow on push to development branch
cassidylaidlaw Oct 16, 2023
8298ce1
Disable tag check for publish step for now
cassidylaidlaw Oct 16, 2023
e73115d
Merge branch 'master' into dylan/publish-to-pypi
cassidylaidlaw Oct 16, 2023
95a8348
Empty commit to trigger publish workflow
cassidylaidlaw Oct 16, 2023
bcc3d76
Removing branch master to use wheels on all branches
Dylan102938 Oct 31, 2023
56fa38e
Adding normal pypi workflow
Dylan102938 Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to PyPI

on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Download wheels
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: wheels.yml
workflow_conclusion: ''

- name: Copy wheels to dist
run: |
mkdir -p dist;
find . -type d -name 'wheels-*' -exec sh -c 'cp -v "$1"/* dist/' _ {} \;

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Publish to PyPI

on:
workflow_dispatch:
push:
tags:
- v*
branches-ignore:
- main

jobs:
publish:
runs-on: ubuntu
steps:
- name: Download wheels
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: wheels.yml
workflow_conclusion: ''

- name: Copy wheels to dist
run: |
mkdir -p dist;
find . -type d -name 'wheels-*' -exec sh -c 'cp -v "$1"/* dist/' _ {} \;

- name: Display output
run: |
ls -l dist

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
115 changes: 115 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Build wheels

on: [workflow_dispatch]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: [self-hosted, "${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macOS]

steps:
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.0

- name: Cache downloads
uses: actions/cache@v3
with:
path: downloads
key: ${{ runner.os }}-downloads-boost-xz-zstd
restore-keys: |
${{ runner.os }}-downloads

- name: Download dependencies
run: |
mkdir -p downloads
cd downloads
for DEP in \
'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2' \
'https://tukaani.org/xz/xz-5.4.1.tar.bz2' \
'https://github.com/facebook/zstd/archive/v1.5.2.tar.gz' \
; do
if [ ! -e "$(basename "$DEP")" ]; then
wget --no-verbose --no-check-certificate "$DEP"
fi
done

- name: Build wheels
env:
CIBW_BUILD: cp38-* cp39-* cp310-*
CIBW_SKIP: "*_i686 *-musllinux_*"
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD_LINUX: ./install_boost_linux.sh
CIBW_BEFORE_BUILD_MACOS: ./install_deps_macos.sh
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --dylibs-only
# CIBW_TEST_COMMAND_MACOS: "python {project}/tests/run_mission.py"
run: |
cp VERSION scripts/python-wheel/package/
VERSION=$(cat VERSION)
echo "malmomod.version=${VERSION}" > Minecraft/src/main/resources/version.properties
cp -r Malmo/src scripts/python-wheel/package/src
cp -r Minecraft scripts/python-wheel/package/malmo/Minecraft
cp -r Schemas scripts/python-wheel/package/malmo/Schemas
cd scripts/python-wheel/package
mkdir deps
cd deps
tar xf ../../../../downloads/xz-5.4.1.tar.bz2
tar xf ../../../../downloads/boost_1_76_0.tar.bz2
tar xf ../../../../downloads/v1.5.2.tar.gz
cd ..
CIBW_ENVIRONMENT="REPAIR_LIBRARY_PATH=$(pwd)/deps/lib" python -m cibuildwheel --output-dir wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.os }}
path: scripts/python-wheel/package/wheelhouse/*.whl

test_wheels:
name: Test wheels on ${{ matrix.os }} Python ${{ matrix.pyversion }}
needs: build_wheels
runs-on: [self-hosted, "${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu]
pyversion: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels-${{ matrix.os }}
path: wheelhouse

- name: Install wheel
run: |
# Kind of janky, but loop through until we find the right wheel.
for WHEEL in wheelhouse/*.whl; do pip install "$WHEEL" || true; done

- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: python scripts/python-wheel/package/tests/run_mission.py
17 changes: 17 additions & 0 deletions Malmo/src/MissionInitSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,21 @@ namespace malmo
this->mission_init.minecraft_server.connection_address = boost::algorithm::trim_copy(address);
this->mission_init.minecraft_server.connection_port = port;
}

boost::optional<int> MissionInitSpec::getMinecraftServerConnectionPort()
{
return this->mission_init.minecraft_server.connection_port;
}

boost::optional<std::string> MissionInitSpec::getMinecraftServerConnectionAddress()
{
return this->mission_init.minecraft_server.connection_address;
}

std::ostream& operator<<(std::ostream& os, const MissionInitSpec& mis)
{
os << "MissionInitSpec:\n";
os << mis.getAsXML(true);
return os;
}
}
5 changes: 5 additions & 0 deletions Malmo/src/MissionInitSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ namespace malmo
//! \param port The Minecraft server port.
void setMinecraftServerInformation(const std::string& address, int port);

boost::optional<int> getMinecraftServerConnectionPort();
boost::optional<std::string> getMinecraftServerConnectionAddress();

friend std::ostream& operator<<(std::ostream& os, const MissionInitSpec& mis);

private:
MissionInitXML mission_init;
};
Expand Down
3 changes: 3 additions & 0 deletions Malmo/src/PosixFrameWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
// Local:
#include "VideoFrameWriter.h"

// STL:
#include <stack>

namespace malmo
{
class PosixFrameWriter : public VideoFrameWriter
Expand Down
92 changes: 92 additions & 0 deletions Malmo/src/PythonWrapper/python_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// --------------------------------------------------------------------------------------------------

// Boost:
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/python.hpp>
#include <boost/python/exception_translator.hpp>
#include <boost/python/register_ptr_to_python.hpp>
Expand All @@ -26,6 +28,7 @@

// Malmo:
#include <AgentHost.h>
#include <MissionInitSpec.h>
#include <Logger.h>
#ifdef WRAP_ALE
#include <ALEAgentHost.h>
Expand All @@ -38,6 +41,7 @@ using namespace malmo;
// STL:
#include <sstream>
#include <cstdint>
#include <string>

// Python:
#include <datetime.h>
Expand Down Expand Up @@ -65,6 +69,54 @@ void translateXMLStdException(std::exception const& e)
PyErr_SetString(PyExc_RuntimeError, oss.str().c_str() );
}

// From https://stackoverflow.com/a/28604575/200508
template<typename T>
struct python_optional : private boost::noncopyable {
struct conversion : public boost::python::converter::expected_from_python_type<T>
{
static PyObject* convert(boost::optional<T> const& value)
{
using namespace boost::python;
return incref((value ? object(*value) : object()).ptr());
}
};

static void* convertible(PyObject *obj) {
using namespace boost::python;
return obj == Py_None || extract<T>(obj).check() ? obj : NULL;
}

static void constructor(
PyObject *obj,
boost::python::converter::rvalue_from_python_stage1_data *data
) {
using namespace boost::python;
void *const storage =
reinterpret_cast<
converter::rvalue_from_python_storage<boost::optional<T> >*
>(data)->storage.bytes;
if(obj == Py_None) {
new (storage) boost::optional<T>();
} else {
new (storage) boost::optional<T>(extract<T>(obj));
}
data->convertible = storage;
}

explicit python_optional() {
using namespace boost::python;
if(!extract<boost::optional<T> >(object()).check()) {
to_python_converter<boost::optional<T>, conversion, true>();
converter::registry::push_back(
&convertible,
&constructor,
type_id<boost::optional<T> >(),
&conversion::get_pytype
);
}
}
};

PyObject* missionExceptionType = NULL;

PyObject* createExceptionClass(const char* name, PyObject* baseTypeObj = PyExc_Exception)
Expand Down Expand Up @@ -97,6 +149,9 @@ void (AgentHost::*sendCommandWithKey)(std::string, std::string) = &AgentHost::se
void (MissionRecordSpec::*recordMP4General)(int, int64_t bit_rate) = &MissionRecordSpec::recordMP4;
void (MissionRecordSpec::*recordMP4Specific)(TimestampedVideoFrame::FrameType, int, int64_t, bool) = &MissionRecordSpec::recordMP4;


boost::shared_ptr<MissionInitSpec> (AgentHost::*getMissionInit)() = &AgentHost::getMissionInit;

#ifdef WRAP_ALE
void (ALEAgentHost::*startALEMissionSimple)(const MissionSpec&, const MissionRecordSpec&) = &ALEAgentHost::startMission;
void (ALEAgentHost::*startALEMissionComplex)(const MissionSpec&, const ClientPool&, const MissionRecordSpec&, int, std::string) = &ALEAgentHost::startMission;
Expand Down Expand Up @@ -137,6 +192,9 @@ BOOST_PYTHON_MODULE(MalmoPython)
to_python_converter<boost::posix_time::ptime, ptime_to_python_datetime>();
to_python_converter<std::vector<unsigned char>, unsigned_char_vec_to_python_array>();

python_optional<int>();
python_optional<std::string>();

enum_< MissionException::MissionErrorCode >("MissionErrorCode")
.value("MISSION_BAD_ROLE_REQUEST", MissionException::MISSION_BAD_ROLE_REQUEST)
.value("MISSION_BAD_VIDEO_REQUEST", MissionException::MISSION_BAD_VIDEO_REQUEST)
Expand Down Expand Up @@ -216,6 +274,39 @@ BOOST_PYTHON_MODULE(MalmoPython)
.value( "KEEP_ALL_OBSERVATIONS", AgentHost::KEEP_ALL_OBSERVATIONS )
;

register_ptr_to_python< boost::shared_ptr< MissionInitSpec > >();
class_< MissionInitSpec >("MissionInitSpec", no_init)
.def("getAsXML", &MissionInitSpec::getAsXML)
.def("getExperimentID", &MissionInitSpec::getExperimentID)
.def("getClientAddress", &MissionInitSpec::getClientAddress)
.def("setClientAddress", &MissionInitSpec::setClientAddress)
.def("getClientMissionControlPort", &MissionInitSpec::getClientMissionControlPort)
.def("setClientMissionControlPort", &MissionInitSpec::setClientMissionControlPort)
.def("getClientCommandsPort", &MissionInitSpec::getClientCommandsPort)
.def("setClientCommandsPort", &MissionInitSpec::setClientCommandsPort)
.def("getAgentAddress", &MissionInitSpec::getAgentAddress)
.def("setAgentAddress", &MissionInitSpec::setAgentAddress)
.def("getAgentMissionControlPort", &MissionInitSpec::getAgentMissionControlPort)
.def("setAgentMissionControlPort", &MissionInitSpec::setAgentMissionControlPort)
.def("getAgentVideoPort", &MissionInitSpec::getAgentVideoPort)
.def("getAgentDepthPort", &MissionInitSpec::getAgentDepthPort)
.def("getAgentLuminancePort", &MissionInitSpec::getAgentLuminancePort)
.def("getAgentColourMapPort", &MissionInitSpec::getAgentColourMapPort)
.def("setAgentVideoPort", &MissionInitSpec::setAgentVideoPort)
.def("setAgentDepthPort", &MissionInitSpec::setAgentDepthPort)
.def("setAgentLuminancePort", &MissionInitSpec::setAgentLuminancePort)
.def("setAgentColourMapPort", &MissionInitSpec::setAgentColourMapPort)
.def("getAgentObservationsPort", &MissionInitSpec::getAgentObservationsPort)
.def("setAgentObservationsPort", &MissionInitSpec::setAgentObservationsPort)
.def("getAgentRewardsPort", &MissionInitSpec::getAgentRewardsPort)
.def("setAgentRewardsPort", &MissionInitSpec::setAgentRewardsPort)
.def("hasMinecraftServerInformation", &MissionInitSpec::hasMinecraftServerInformation)
.def("setMinecraftServerInformation", &MissionInitSpec::setMinecraftServerInformation)
.def("getMinecraftServerConnectionPort", &MissionInitSpec::getMinecraftServerConnectionPort)
.def("getMinecraftServerConnectionAddress", &MissionInitSpec::getMinecraftServerConnectionAddress)
.def(self_ns::str(self_ns::self))
;

class_< AgentHost, bases< ArgumentParser >, boost::noncopyable >("AgentHost", init<>())
.def( "startMission", startMissionSimple )
.def( "startMission", startMissionComplex )
Expand All @@ -228,6 +319,7 @@ BOOST_PYTHON_MODULE(MalmoPython)
.def( "sendCommand", sendCommand )
.def( "sendCommand", sendCommandWithKey )
.def("getRecordingTemporaryDirectory", &AgentHost::getRecordingTemporaryDirectory)
.def( "getMissionInit", getMissionInit )
.def( "setDebugOutput", &AgentHost::setDebugOutput )
.def(self_ns::str(self_ns::self))
;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions Minecraft/run/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ key_key.hotbar.8:9
key_key.hotbar.9:10
key_key.toggleMalmo:28
key_key.handyTestHook:22
key_key.toggleFullBlueprint:19
key_key.toggleLiquids:38
key_key.toggleVisible:0
soundCategory_master:0.0
soundCategory_music:1.0
soundCategory_record:1.0
Expand Down
Loading