ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
3 stars 3 forks source link

Automated default environment for python 2 & 3. #44

Closed albu-diku closed 1 month ago

albu-diku commented 2 months ago

This commit implements all the glue necessary to support the automated creation of python virtual environments including any necessary project dependencies across both python version 3 and 2. This is done to aid both in development but also support a unit-level test suite.

Add a Makefile whose default target will discover and run tests placed in a top-level tests/ folder. This target depends on an environment creation target which will only be rebuilt if changes are made to requirements.txt dependencies. A trivial "test" is included to allow exercising this stuff.

Of note is that this work functions across both python 3 and also python 2 - in the latter case a docker container is used to execute the tests. The selection of python 2 is done simply by specifying a variable when invoking make which causes the execution of script wrapping a docker container to be executed as the make PYTHON_BIN.

Examples:

Python 3: $ make

Python 2: $ make PY=2

jonasbardino commented 2 months ago

Thanks for the contribution @albu-diku and welcome to the team :-) As discussed off-list I've started merging manually in the upstream migrid svn repo as currently required. For now just the tests unit test dir and requirements.txt . Don't worry about the merge conflicts it causes here. I'll take another look at the recently updated Makefile.

jonasbardino commented 2 months ago

Manually merged the .gitignore additions into the edge and experimental branches. The file is a bit out of scope for the svn repo and the pristine clone of it in master.

jonasbardino commented 1 month ago

manually merged the core test helpers and tests to finish the venv branch merge. Thanks!