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

Use lattice package to run all the schema-205 jobs #65

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove outdated information from readme.
tanaya-mankad committed Feb 17, 2025
commit ed3a6f548a3f51a944982f5dbf14b51ae995885b
100 changes: 12 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,11 +16,12 @@ This repository ships with the [DoIt!](https://pydoit.org/) task automation tool

The following DoIt! tasks are available:

- `doc`: Generates Markdown tables from common-schema
- `render_template`: Demonstrate how to render a template
- `schema`: Generates JSON schema from common-schema
- `test`: Performs unit tests and example file validation tests
- `validate`: Validates common-schema against meta-schema
- `generate_markdown`: Generates Markdown tables from common-schema
- `generate_web_docs`: Generates web documentation from templates
- `generate_meta_schemas`: Generates validation files for common-schema
- `generate_json_schemas`: Generates JSON schema from common-schema
- `validate_schemas`: Validates common-schema against meta-schema
- `generate_cpp_project`: Generates header and source files, with basic CMake build integration


Development Workflow
@@ -32,96 +33,19 @@ For those who wish to develop the Schema205 repository directly, we are using th

Following are some considerations you should go through to configure your environment correctly for development and exploration.

1. **Install Poetry**

Be sure to install [Poetry](https://python-poetry.org/docs/#installation) per the instructions from the Poetry website.

2. **Install Python and support multiple Python versions on one machine**

If you don't desire to support multiple versions of Python, then you need only ensure that you have at least one version of Python installed. This project requires Python 3.7 or higher. Please see the [Python Website](https://www.python.org/) for installation instructions for your operating system.

If you wish to support multiple versions of Python during development, there are several options. One simple option is to just ensure you start up your command prompt (i.e., shell) with the Python version you wish to develop with.

For something more sophisticated, we recommend [mini-conda](https://docs.conda.io/en/latest/miniconda.html), a free minimal installer for Conda. Conda is an open-source package and environment management system that runs on Windows, macOS, and Linux. Use the following steps:

a) [install mini-conda](https://docs.conda.io/en/latest/miniconda.html).

b) [start conda](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#starting-conda). This will bring up a shell window that "knows" about conda capabilities. Windows note: be sure to follow the recommended start procedure -- generally conda *cannot* be started from a native shell prompt (due to path issues).

c) Create an environment for the version of Python you would like to use with Poetry and this project by typing the following at the conda shell:

> (base) conda create -n py37 python=3.7

Note: these environments persist between usage so you only need to create the environment once.

This will create a conda environment named "py37" that only has Python 3.7 (and its dependencies) installed.
If you want to use Python 3.9, you could type `conda create -n py39 python=3.9`, for example.
The `-n` flag is short for the `--name` of the new conda environment.
You have a lot of freedom for the names provided there are no spaces or exotic characters.
The `python=3.7` part specifies that the new conda environment will use Python version 3.7.
You can create as many environments with differing versions of Python as you desire.

Once the desired environments are created, you can activate an environment by typing:

> (base) conda activate py37

When you are done with the environment, type:

> (py37) conda deactivate

... or simply close your command shell when done.

Once you've created the environment you desire, on subsequent use, you just need to start conda and activate the environment you want.

Select the desired Python environment and activate it before proceeding to the next step.

3. **Install dependencies**

To install dependencies, go to the root folder of this repository and type:

> poetry install

This will install all of the normal and developer dependencies.
If you have done this previously and there are no changes to the library versions being used, nothing will happen.

4. **Using an editor**
1. **WIP: Using uv to install the package and dependencies**
1. **Using an editor**

You can use any editor you desire to edit or explore the Python code and schema documents in our repository.

We recommend [Visual Studio Code](https://code.visualstudio.com/) because of its strong Python integration.

To get Visual Studio Code to work with Poetry, first follow steps 1-3 above.

macOS: a) if you do not have command-line integration, [follow these instructions](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), and restart your shell. b) follow steps 1-3.

Windows: Follow steps 1-3 above. The `code` command (see below) is already integrated into your shell.

From within your running Python environment, type:

> poetry shell

This activates the virtual environment for Poetry. Then enter:

```
> cd toolkit-205/schema-205
> code .
```

This launches Visual Studio Code from within your Poetry environment.
At the bottom left, choose the Python version you wish to use with the given environment.

Open a terminal window TODO

You're now ready to develop using Visual Studio Code!

5. **Use the project**

To run the various scripts and commands of the project, you can use the [DoIt!](https://pydoit.org/) file as follows:
1. From a command shell
1. From inside VS Code

> poetry run doit
1. **Use the project**

The first part of the command, `poetry run`, uses Poetry to place the remaining part of the command within a Python virtual environment with all dependencies setup.
The second part of the command, `doit`, runs all of the tasks available in the `dodo.py` file.
WIP: doit instructions


### Developing with Toolkit 205
2 changes: 1 addition & 1 deletion dodo.py
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ def task_generate_markdown():


def task_generate_web_docs():
"""Generate markdown documentation from templates"""
"""Generate web documentation from templates"""
return {
"task_dep": [f"validate_schemas", f"generate_json_schemas", f"validate_example_files"],
"file_dep": [schema.file_path for schema in data_model_205.schemas]