Games-and-Simulations / sc-docker

Multi-platform Version of StarCraft: Brood War in a Docker Container, ready to use for bot play simulations.
MIT License
230 stars 41 forks source link

Automatic install on PyPi package download #45

Closed michalsustr closed 6 years ago

michalsustr commented 6 years ago
Currently we need to run `scbw.play --install`, can it be run on package install?
kant2002 commented 6 years ago

I think would be reasonable to implement following approach:

Let's have

  1. full verification
  2. and quick verification of required dependencies.

Full verification right now is the same as scbw.play --install, and quick verification relying on file presence. For example we will add writing file 'install.touch' with magic string sitting in the file. We will have 3 scenarios

Let's name current process

Case 1: 'install.marker' file is missing. Parameter --install is not passed.

  1. Run scbw.install()
  2. Create 'install.marker' with version specific content in the ~/scbw/ folder

Case 2: 'install.marker' file is present, but content is unexpected. Parameter --install is not passed.

  1. Run scbw.install()
  2. Overwirte 'install.marker' with version specific content in the ~/scbw/ folder

Case 3: Parameter --install is passed.

  1. Run scbw.install()
  2. Create 'install.marker' with version specific content in the ~/scbw/ folder

/cc: @michalsustr

michalsustr commented 6 years ago

Case 1 & 2 are implemented via docker versioning scheme - if we have the image of the right version, it can be assumed we have installed things correctly.

Case 3 still stays there.

https://github.com/Games-and-Simulations/sc-docker/blob/master/scbw/cli.py#L157