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 pyproject.toml as the configuration file #70

Closed
wants to merge 3 commits into from

Conversation

pmav99
Copy link
Contributor

@pmav99 pmav99 commented Sep 2, 2020

Making the pull request so that the test can run in CI

Addresses #69

This is breaking backwards compatibility since it ditches `tbump.toml` and
it replaces it with `pyproject.toml`

Addresses your-tools#69
# In order to minimize the number of changes that are needed for this switch
# we parse `pyproject.toml` and use it to create a new `tomlkit.Document()` with
# a flat structure
parsed_pyproject = tomlkit.loads(cfg_path.text())["tool"]["tbump"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty clever but it will crash with KeyError if [tool] or [[tool.tbump]] section is messing

Copy link
Contributor Author

@pmav99 pmav99 Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but let's not forget that the PR was about implementing Option 2, i.e. only support pyproject.toml. In this case, tool.tbump should always be present :)))

That being said, handling the KeyError would probably make sense anyway, since the user might make a typo or something.

.gitignore Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@dmerejkowsky
Copy link
Collaborator

Also, per my comments in #69 , I think you should keep tests running with tbump.toml, and add just one test dedicated on pyproject.toml support.

@dmerejkowsky
Copy link
Collaborator

I've created a separated PR so we can merge the unrelated fixes (thanks for those, by the way :P)

@dmerejkowsky
Copy link
Collaborator

@pmav99 : #71 has been merged with your unrelated fixes, let's continue discussing configuration files here. Feel free to rebase your branch so that we only see the last commit in the diff.

@pmav99 pmav99 marked this pull request as draft September 3, 2020 19:47
@pmav99 pmav99 closed this Sep 3, 2020
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.

2 participants