Skip to content

Commit

Permalink
Replace toml with tomllib
Browse files Browse the repository at this point in the history
The Python 3.11 standard library provides tomllib for parsing TOML
files.  As even Debian stable ships Python 3.11, we should be fine with
using it instead of the third-party toml dependency.
  • Loading branch information
robin-nitrokey committed Apr 12, 2024
1 parent 287b314 commit ab04d0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:

steps:
- uses: actions/checkout@master
- name: Install Python dependencies
run: |
python -m pip install toml
- name: Install rust
run: |
rustup show
Expand Down
5 changes: 3 additions & 2 deletions generate_commands.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (C) 2023 Nitrokey GmbH
# SPDX-License-Identifier: LGPL-3.0-only

import toml
import sys
import tomllib

def capitilize_first(name):
name
Expand Down Expand Up @@ -84,7 +84,8 @@ def flatten(items):
exit(1)

outfile = open(sys.argv[2], "w")
data = toml.load(sys.argv[1])
with open(sys.argv[1], "rb") as infile:
data = tomllib.load(infile)

# REUSE-IgnoreStart
outfile.write("// Copyright (C) 2023 Nitrokey GmbH\n")
Expand Down
2 changes: 1 addition & 1 deletion src/se05x/commands.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ p2 = "P2_DEFAULT"

[scp_external_authenticate.payload]
then = [
{ name = "host_cryptogram", type = "[u8; 8]" }
{ name = "host_cryptogram", type = "[u8; 8]" },
{ name = "mac", type = "[u8; 8]" }
]

Expand Down

0 comments on commit ab04d0d

Please sign in to comment.