- Free software: MIT license
- Python versions: 3.8.x, 3.9.x, 3.10.x, 3.11.x, 3.12.x
- Documentation: https://toml-adapt.readthedocs.io/en/latest/
- Tested OS: Windows, Ubuntu, Debian, Fedora, Alpine, Arch, macOS. However, that does not mean it does not work on others.
Working with TOML files is becoming inevitable during the package maintenance process in different ecosystems. 🌐 Many times package maintainers must either change the version of dependency or add/remove dependencies when building their packages, due to the inconsistent base system. For example, solving this issue can be done either by using the provided patches or using sed commands. However, this may be slightly time-consuming and irritating. ⏳ A very simple yet user-friendly command line interface was developed in order to make this process easier. ⚙️📄🛠️
CLI currently supports the following operations:
- adding/removing dependencies
- changing the dependency version
- changing the dependency versions of all packages concurrently
- adding/removing/changing dev dependencies
The following packaging tools are currently supported by this software:
- poetry
- flit
- cargo
- julia (partly)
Install toml-adapt with pip:
pip install toml-adapt
To install toml-adapt on Fedora, use:
$ dnf install python-toml-adapt
To install toml-adapt on Alpine Linux, use:
$ apk add toml-adapt
To install toml-adapt on Arch Linux, please use an AUR helper:
$ yay -Syyu toml-adapt
-a
Available actions are:
- add
- remove
- change
- add-dev
- remove-dev
- change-dev
-path
Specifies the path to the TOML file you wish to edit.
-dep
This option sets the name of dependency you wish to manipulate. Reserved keyword ALL
will instead do action on all dependencies.
-ver
This option sets the version. With Python Poetry, there is reserved keyword X
, which will become *
(meaning it accepts any version of dependency).
The following are examples of usage:
toml-adapt -path pyproject.toml -a change -dep niaclass -ver 0.1.0
toml-adapt -path pyproject.toml -a add -dep niaclass -ver 0.1.0
toml-adapt -path pyproject.toml -a remove -dep niaclass -ver 0.1.0
Change all existing dependencies in toml file
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
X represents a *
%prep
...
## Make dependencies consistent with Fedora dependencies
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
Fister, Jr., I., & Strajnar, F. (2024). firefly-cpp/toml-adapt: 0.3.1 (0.3.1). Zenodo. https://doi.org/10.5281/zenodo.10467167
This package is distributed under the MIT License. This license can be found online at http://www.opensource.org/licenses/MIT.
This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!
Thanks goes to these wonderful people (emoji key):
Iztok Fister Jr. 💻 📦 💡 🤔 🧑🏫 📖 |
StrajnarFilip 💻 |
Ben Beasley 📖 📦 |
Tomasz Kłoczko 🐛 |
Oromion 📦 |
Tadej Lahovnik 📖 ✅ |
This project follows the all-contributors specification. Contributions of any kind welcome!