agritheory / test_utils

Common Test Utilities and Fixtures for AgriTheory Projects
2 stars 3 forks source link

feat: added customize.py to migrate customizations #28

Closed MyuddinKhatri closed 2 months ago

MyuddinKhatri commented 2 months ago

Added customize.py to migrate customizations. Issue - https://github.com/agritheory/test_utils/issues/17

MyuddinKhatri commented 2 months ago

This seems mostly right, a few questions. This doesn't seem like something we need write formal documentation for, but I think it could benefit from some inline comments.

Sure, will add some comments.

MyuddinKhatri commented 2 months ago

@agritheory I made some changes, this code computes hash by combining data from standard doctype json and custom doctype json and sets in customization_hash, and on next migrate it checks for both concatenated data hash and the existing hash if same then skip syncing customizations.

agritheory commented 2 months ago

@MyuddinKhatri Can you rebase this? I'd like to test it in context

MyuddinKhatri commented 2 months ago

@MyuddinKhatri Can you rebase this? I'd like to test it in context

Done

agritheory commented 2 months ago

OK, I think we need to restructure the folders here to provide a better DX and reduce confusion. I'll open another PR with the structural changes and we can discuss there.


In [1]: import test_utils
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File <ipython-input-1-6b06e7a867be>:1
----> 1 import test_utils

ModuleNotFoundError: No module named 'test_utils'

In [2]: import utils

In [3]: dir(utils)
Out[3]:
['__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__']
agritheory commented 2 months ago

Included but moved in #30