Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/cli 22w39 initial prototype #39

Conversation

auphofBSF
Copy link
Contributor

Change Proposal - (WIP for review/suggestions/discussion)

Whilst I am integrating aspects of the SmartDataModels into some of our applications, I see there being great benefit to enhancing the work in various scripts particularly pysmartdatamodels . This PR is there for discussion and suggestions. Possibly the pysmartdatamodels should be its own repo within Smart-data-models rather than a folder within this repo data-models

Demonstration of functionality can be found in https://colab.research.google.com/drive/1D8jZ6-sOGCksAtJ6NUHv9yk6ONvjKJBc?usp=sharing

  1. move setup.py towards compatibility with current package managers, fix issues and moves towards PEP621 covering PEP517 and PEP518, tested against pip 21.x and poetry 1.2.1
  2. introduce a CLI that essential automatically exports functions that were available in an easy to use CLI pysmartdatamodel_cli --help
  3. setup a pytest framework

✅installing this with poetry using poetry add ...... works now as expected , including in --editable mode
✅installing this with pip install .......

breaking changes

the pysmartdatamodels.py is turned into a module with all the functions copied across into pysmartdatamodels/commands.py. Only minor alterations are the relocation of the official_list_data_models.json into a folder pysmartdatamodel/model-assets/ and the change of

def validate_data_model_schema(schemaUrl):
validate_data_model_schema(schemaUrl) to validate_data_model_schema(schema_url) for some reason the CLI auto generator does not want to recognize schemaUrl

SLLau and others added 10 commits September 25, 2022 13:14
fix: suppress unrequired

INSTALL_REQUIRES should not be builtins
validate and datetime do not appear to be required
examples
pysmartdatamodels_cli datamodels_subject dataModel.PointOfInteraction
pysmartdatamodels_cli --help
fix: validate_data_model_schema, suppress print
fix: validate_data_model_schema return native object ie dict
refactor: black format
when installed --editiable it is file reachable
when instaled without --editable  file is not available
bring into package module folder and and set as a required
chore: add to .gitignore builds and eggs

Incorrect indentation in section [options.package_data]
add a default pytest.ini until full PEP621 (only pyproject.toml)
@wistefan
Copy link
Collaborator

Hi, thanks for the contribution. The changes look go to me.
I agree, moving the pysmartdatamodels into its own repo would make sense. The lifecycle management should be easier and more clear. @albertoabellagarcia what do you think about that?

@albertoabellagarcia albertoabellagarcia merged commit c6f56c4 into smart-data-models:master Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants