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

Rendering a nested pyproject.toml file to stdout is broken #85

Closed
jameslamb opened this issue May 10, 2024 · 2 comments · Fixed by #86
Closed

Rendering a nested pyproject.toml file to stdout is broken #85

jameslamb opened this issue May 10, 2024 · 2 comments · Fixed by #86
Labels
bug Something isn't working released

Comments

@jameslamb
Copy link
Member

Discovered this today while working on rapidsai/cudf#15245.

On the latest version of dependency-file-generator (v1.13.4), rendering a nested pyproject.toml to stdout fails.

Reproducible Example

git clone [email protected]:rapidsai/cudf.git
cd cudf
git checkout b810113d

rapids-dependency-file-generator \
  --output pyproject \
  --file-key py_run_cudf \
  --matrix "cuda=12.2"

Fails like this:

Traceback (most recent call last):
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/rapids_dependency_file_generator/_rapids_dependency_file_generator.py", line 183, in make_dependency_file
    table = table[section]
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/tomlkit/container.py", line 624, in __getitem__
    item = self.item(key)
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/tomlkit/container.py", line 466, in item
    raise NonExistentKey(key)
tomlkit.exceptions.NonExistentKey: 'Key "project" does not exist.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jlamb/miniforge3/envs/rapids-dev/bin/rapids-dependency-file-generator", line 10, in <module>
    sys.exit(main())
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/rapids_dependency_file_generator/_cli.py", line 151, in main
    make_dependency_files(parsed_config, file_keys, output, matrix, args.prepend_channels, to_stdout)
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/rapids_dependency_file_generator/_rapids_dependency_file_generator.py", line 419, in make_dependency_files
    contents = make_dependency_file(
  File "/Users/jlamb/miniforge3/envs/rapids-dev/lib/python3.10/site-packages/rapids_dependency_file_generator/_rapids_dependency_file_generator.py", line 188, in make_dependency_file
    if not table.is_super_table():
AttributeError: 'TOMLDocument' object has no attribute 'is_super_table'

Notes

I believe the specific issue is right here:

output_dir = "." if to_stdout else get_output_dir(file_type, parsed_config.path, file_config)

@jameslamb jameslamb added the bug Something isn't working label May 10, 2024
@jameslamb
Copy link
Member Author

I have a fix for this, will put up a PR shortly. Just wanted to get the bug into writing.

@GPUtester
Copy link

🎉 This issue has been resolved in version 1.13.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants