mrijken / toml-cli Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
In this page there is a parameter --toml-path for the version 0.3.1
I've installed it:
Package Version
------------------ ------------
toml-cli 0.3.1
But when I tried to run it:
>toml --toml-path pyproject.toml get project.version
Usage: toml [OPTIONS] COMMAND [ARGS]...
Try 'toml --help' for help.
╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such option: --toml-path │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ add_section───────────────────── Add a section with the given key │
│ get_section───────────────────── Get a value from a toml file │
│ set_section───────────────────── Set a value to a toml file │
│ unsetection───────────────────── Unset a value from a toml file │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Problem: The Python representation of the TOML document is printed for the get
command.
Line 20 in d8b2c9c
Other CLI tools, such as jq, are unable to properly process that output.
Solution: serialize the output of get
to JSON so that it can be parsed by other CLI tools.
The flag --toml-path
to provide --toml-path pyproject.toml
can have default pyproject.toml
.
I think the flag is useful whenever the file is not in my current path.
Line 14 in f21f48b
Hello,
toml-cli is useful for pyproject configuration manipulation, such as customizing the package version of pyproject. An example is appending a string to a given pyproject.toml:
[project]
version = "1.0"
And in shell:
toml set --toml-path pyproject.toml project.version $(toml get --toml-path pyproject.toml project.version).dev12345
The change of behavior is the following
Shell command line:
$(toml get --toml-path pyproject.toml project.version)
In version 0.3.1:
returns without quotes
1.0
In version 0.4.0:
returns with quotes
"1.0"
Breaking the above command line after customization of pyproject.toml
[project]
version = "\"1.0\".dev12345"
Problem: paths are split by .
for the get
and unset
commands
Line 73 in d8b2c9c
It's however possible for keys to have .
within themselves, for example
[section."https://github.com/octokit"]
In those cases there's no way to get to the desired path due to the .
splitting.
Solution: Accept a sequence of paths parts rather than a single string. Thus instead of
$ toml get --toml-path Cargo.toml 'section["https://github.com/octokit"]'
One would do
$ toml get --toml-path Cargo.toml section https://github.com/octokit
Hi. It is possible to create a new release to include the latest changes? Thanks.
It doesnt appear possible to set a key to equal an array, i.e. foo = ["bar"]
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
I cannot seem to run this as described on Windows. Installing via pip
works fine. But you cannot run toml
as a command from Windows terminal. Typically, when this happens I would use python -m
to run the module as a script but this doesn't seem to work with toml-cli
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.