You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For convenience we have included two batch scripts which build either the entire project for the .NET 6 framework (`build-net6.bat`) or the .NET 7 framework (`build-net7.bat`)
114
114
115
+
## Installing python dependencies
116
+
117
+
The unit tests and auto-extractor scripts are written in python.
118
+
The easiest way to set up the correct environment to run the tests is to install [uv](https://github.com/astral-sh/uv). You can do this by running `python -m pip install -U uv`.
119
+
Once run, you can run `uv sync` to install all the required dependencies.
115
120
116
121
## TESTING INSTRUCTIONS
117
122
118
123
For anyone helping to develop MBINCompiler, if you are contributing new structs or updating existing ones, it is good to ensure that the tests that are run on the CI service that builds and tests MBINCompiler will pass.
119
124
120
125
### Requirements
121
126
122
-
To run the tests you will need python installed and on the path. It is recommended you get a recent version (3.9 or above).
123
-
The required dependencies are `pytest` and `requests`. These can be installed by entering `python -m pip install -U pytest requests` in your favorite command line program.
124
127
Before running the tests, you need to have built a `Release` version of MBINCompiler locally.
128
+
You can do this by running `dotnet publish --no-self-contained -c Release -f net6.0 -r win-x64 /nowarn:cs0618 /nowarn:cs0169 /nowarn:cs0414` (change dotnet and framework version as required).
129
+
See section above about building for more details.
125
130
126
131
### Running the tests
127
132
128
-
Open a command line window in the root MBINCompiler directory and enter `python -m pytest`.
133
+
Open a command line window in the root MBINCompiler directory and enter `uv run python -m pytest`.
129
134
This will pull the latest test data into the directory `./tests/data`.
130
135
131
136
#### Command line arguments:
@@ -149,5 +154,12 @@ Use of `--use_cache=True` should only be done if you are 100% sure that the loca
149
154
150
155
`--datapath` is primarily used for running tests on folder of data files to test which files pass or fail for the updating of the `MBINCompiler-test-data` repository. This option can however be used to point the tests at any other directory (such as an unpacked PCBANKS directory or sub-folder to run the tests on any of the games' files.)
151
156
157
+
## Running the auto-extractor
158
+
159
+
MBINCompiler has a script which can be used to automatically extract the latest .cs files for the current game version.
160
+
To run this simply run `uv run python ./Tools/auto_extract/extractor.py`
161
+
This will run the game and extract all the files as required.
162
+
Note that this will overwrite the files in the local folder, so it's recommended to either back up your local files or create a new branch if you have cloned this repo.
163
+
152
164
## CREDITS
153
165
Original project thanks to Emoose: https://github.com/emoose/MBINCompiler
0 commit comments