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

Replace importcfg.json with config TOML file #56

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

Pennycook
Copy link
Contributor

Adopting Python 3.12 means that we have access to tomllib, and can replace a JSON configuration file like this:

{
  "compilers": [
    {
      "name": "nvcc",
      "options": [
        "-D __CUDACC_VER_MAJOR__=11",
        "-I /path/to/cuda/installation",
      ]
    },
    {
      "name": "gcc",
      "options": [
        "-D__GNUC__=12",
      ]
    },
  ]
}

With a much more user-friendly TOML file:

[compiler.nvcc]
options = [
  "-D__CUDACC_VER_MAJOR__=11",
  "-I /path/to/cuda/installation",
]
 
[compiler.gcc]
options = [
  "-D__GNUC__=12",
]

Related issues

Replaces functionality originally added by #27.

Proposed changes

  • Replace cbi/importcfg.json with cbi/config (assumed TOML).
  • Add functions to validate TOML against a schema for the equivalent JSON.
  • Add tests for the new TOML validation.

The name "config.schema" was already in use for the legacy configuration files.
This new configuration file uses the name "cbiconfig.schema" to reflect the
expected configuration path (.cbi/config).

Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the enhancement New feature or request label Feb 13, 2024
@Pennycook Pennycook added this to the 1.2.0 milestone Feb 13, 2024
@Pennycook Pennycook merged commit 8b8105b into intel:main Feb 13, 2024
1 check passed
@Pennycook Pennycook deleted the cbiconfig branch February 13, 2024 22:03
Pennycook added a commit to Pennycook/code-base-investigator that referenced this pull request Feb 23, 2024
Pennycook added a commit to Pennycook/code-base-investigator that referenced this pull request Feb 26, 2024
Pennycook added a commit that referenced this pull request Feb 26, 2024
Add schema file required by functionality from #56
Pennycook added a commit that referenced this pull request Feb 26, 2024
Add TOML files required by tests from #56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants