equinor / komodoenv

Komodoenv is the virtualenv of the Komodo world
GNU General Public License v3.0
1 stars 3 forks source link

Refactor #14

Closed pinkwah closed 4 years ago

pinkwah commented 4 years ago

Resolves: #2 Resolves: #3 Resolves: #16

  1. There's now a __main__.py, so we can do python -m komodoenv
  2. __main__.py does: i. Argument parsing ii. Checking that the path arguments are pathlib.Path iii. --force removes the target dir iv. Constructs the Creator class and calls its only public method
  3. python.py provides the class Python which encapsulates information about the Python executable and allows executing it
  4. creator.py provides Creator that does most of the bootstrapping
  5. update.py is a Python 2.6-compatible script that will be copied to {kenv}/root/bin/komodoenv-update. i. --check checks if there is an update, prints out a message if there is ii. Calling it without arguments attempts to update. This will update the enable scripts and shims

The test_integration.py provides tests for creation of komodoenvs from scratch and updating them.

Komodoenv can only update itself automatically if the target komodo environment's komodoenv package shares the same major version. The idea is that komodoenv 2.0 might do something drastically different to komodoenv 1.0 where the update for 1.0 -> 2.0 is non-trivial and it's easier to recreate the environment from scratch.