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

Upgrade to toml v0.5.11 #2040

Merged
merged 1 commit into from Jan 20, 2023
Merged

Upgrade to toml v0.5.11 #2040

merged 1 commit into from Jan 20, 2023

Conversation

charliermarsh
Copy link
Member

In #1680, we moved over to toml_edit. But it looks like toml now uses toml_edit, and has implemented some improvements (e.g., this closes #1894).

@charliermarsh
Copy link
Member Author

\cc @messense

@charliermarsh charliermarsh merged commit 20a9252 into main Jan 20, 2023
@charliermarsh charliermarsh deleted the charlie/toml branch January 20, 2023 22:20
@messense
Copy link
Contributor

Looks like the released version on crates.io doesn’t use toml_edit currently: https://crates.io/crates/toml/0.5.11/dependencies

@charliermarsh
Copy link
Member Author

Oh, strange. Any idea what the state of the crate is? Should I revert this?

@messense
Copy link
Contributor

messense commented Jan 21, 2023

Only toml released a new version without any noticeable behavior changes, toml_edit is still on 0.17.1 which doesn't resolve the issue.

Should I revert this?

For now you can revert it to be more compliant with TOML 1.0. At least a new toml_edit release a required for #1894.

Or we can just depends on toml main branch using git dependency?

@charliermarsh
Copy link
Member Author

Interesting, I did run through the example described in that issue and it seemed to work with the new crate. Is that unexpected?

@charliermarsh
Copy link
Member Author

@messense - It looks like v0.5.11 was mostly about deprecations in advance of the toml-edit migration. I am confused though why this now works:

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

So, I might leave it as-is for now? Is that bad? What did we lose by not supporting TOML 1.0?

@messense
Copy link
Contributor

It still fails for me?

cargo run
   Compiling toml-test v0.1.0 (/private/tmp/toml-test)
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/toml-test`
Err(
    Error {
        inner: ErrorInner {
            kind: Custom,
            line: Some(
                5,
            ),
            col: 0,
            at: Some(
                55,
            ),
            message: "duplicate key: `version`",
            key: [
                "tool",
                "hatch",
            ],
        },
    },
)

Cargo.toml

[package]
name = "toml-test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
toml = "0.5.11"

src/main.rs

fn main() {
    let content = r#"# pyproject.toml

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version""#;
    println!("{:#?}", toml::from_str::<toml::Value>(content));
}

@charliermarsh
Copy link
Member Author

Interesting, let me try again in the morning.

@charliermarsh
Copy link
Member Author

charliermarsh commented Jan 21, 2023

Yeah I can reproduce that, but interestingly, this works fine:

let content = r#"# pyproject.toml

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version""#;

println!("{:#?}", toml::from_str::<Pyproject>(content));

charliermarsh added a commit that referenced this pull request Jan 21, 2023
charliermarsh added a commit that referenced this pull request Jan 21, 2023
This _did_ fix #1894, but was a little premature. `toml` doesn't actually depend on `toml-edit` yet, and `v0.5.11` was mostly about deprecations AFAICT. So upgrading might solve that issue, but could introduce other incompatibilities, and I'd like to minimize churn. I expect that `toml` will have a new release soon, so we can revert this revert.

Reverts #2040.
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Jan 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.228` ->
`^0.0.229` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.229/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.229/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.229/compatibility-slim/0.0.228)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.229/confidence-slim/0.0.228)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.229`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.229)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.228...v0.0.229)

##### What's Changed

- README: `--force-exclude` is already set by
[@&#8203;hugovk](https://togithub.com/hugovk) in
[astral-sh/ruff#2042
- Upgrade to toml v0.5.11 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2040
- Add support for pycodestyle E101 by
[@&#8203;ericroberts](https://togithub.com/ericroberts) in
[astral-sh/ruff#2038
- \[`flake8-executable`] EXE003-005 by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2023
- perf: Reduce allocations by
[@&#8203;Stranger6667](https://togithub.com/Stranger6667) in
[astral-sh/ruff#2045
- refactor: RuleOrigin, RuleCodePrefix and Rule::origin by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2029
- Add scaffolding for `flake8-type-checking` extension by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2048
- De-duplicate SIM102 by [@&#8203;harupy](https://togithub.com/harupy)
in
[astral-sh/ruff#2050
- Fix S101 range to only highlight `assert` by
[@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#2052
- Avoid removing comments in RUF005 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2057
- Revert "Upgrade to toml v0.5.11" by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2058
- Pyupgrade: Printf string formatting by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#1803
- \[`flake8-builtins`] Add `builtins-ignorelist` Option by
[@&#8203;saadmk11](https://togithub.com/saadmk11) in
[astral-sh/ruff#2061
- feat: plugin scaffold for tryceratops with TRY300 by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2055
- Avoid flagging redefined imports as unused in same-scope by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2065

##### New Contributors

- [@&#8203;hugovk](https://togithub.com/hugovk) made their first
contribution in
[astral-sh/ruff#2042
- [@&#8203;ericroberts](https://togithub.com/ericroberts) made their
first contribution in
[astral-sh/ruff#2038
- [@&#8203;sbrugman](https://togithub.com/sbrugman) made their first
contribution in
[astral-sh/ruff#2023

**Full Changelog**:
astral-sh/ruff@v0.0.228...v0.0.229

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDguMSIsInVwZGF0ZWRJblZlciI6IjM0LjEwOC4xIn0=-->

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

TOML parse error: Invalid table header: Duplicate key version
2 participants