TOML-ADAPT(13)

πŸ“¦ version 0.3.4, in fedora 43

πŸ’– TOML-ADAPT(13) β€” toml-adapt πŸ’–

okay bestie, welcome to the glow-up era of your toml files ✨ this is toml-adapt, a lil user command that adapts and manipulates toml files, and honestly? she ate.


🌸 NAME 🌸

toml-adapt β€” adapt/manipulate toml files πŸŽ€


✨ SYNOPSIS ✨

toml-adapt [--help] [-path TEXT] [-path TEXT] [-dep TEXT] [-ver TEXT]

(yes bestie, -path TEXT really is in there twice, that's just how she is, no notes πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

so like β€” working with TOML files is becoming inevitable during the package maintenance process in different ecosystems. it's giving unavoidable, fr fr 😭

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 😩 like, nobody has the energy.

so a very simple yet user-friendly command line interface was developed in order to make this process easier. and she's iconic for that. periodt. πŸ‘‘

πŸ”₯ FEATURES πŸ”₯

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

no cap, that's the whole roster and it's lowkey everything πŸ’–

🌈 SUPPORTED PACKAGING TOOLS 🌈

the following packaging tools are currently supported by this software:

  • poetry
  • flit
  • cargo
  • julia (partly)
ngl, julia is only partly supported β€” she's in her half-glow era, don't expect the full main character treatment 🫢

πŸ’… OPTIONS πŸ’…

  • --help β€” show a help message and exit. classic. we love a helpful queen ✨
  • -path TEXT β€” specifies the path to the TOML file you wish to edit. [required] β€” she's mandatory bestie, no skipping πŸŽ€
  • -a TEXT β€” action. any of the following: add, remove, change, add-dev, remove-dev, change-dev. [required] β€” pick your move, it's required, the vibes demand it πŸ’œ
  • -dep TEXT β€” this option sets the name of dependency you wish to manipulate. reserved keyword ALL will instead do action on all dependencies. [required] β€” yes, ALL is the "do everything" button and she's powerful πŸ‘‘
  • -ver TEXT β€” this option sets the version. with Python Poetry, there is reserved keyword X, which will become * (meaning it accepts any version of dependency). 🌟

πŸ“ EXAMPLES πŸ“

change dependency

toml-adapt -path pyproject.toml -a change -dep niaclass -ver 0.1.0

add dependency

toml-adapt -path pyproject.toml -a add -dep niaclass -ver 0.1.0

remove dependency

toml-adapt -path pyproject.toml -a remove -dep niaclass -ver 0.1.0

🧚 OTHER EXAMPLES 🧚

change all existing dependencies in toml file:

toml-adapt -path pyproject.toml -a change -dep ALL -ver X
X represents a *

X really said "any version? say less" πŸ’«


πŸŽ€ HOW TO USE IT IN SPEC FILES? πŸŽ€

%prep
...
# Make dependencies consistent with Fedora dependencies
toml-adapt -path pyproject.toml -a change -dep ALL -ver X

look at her go, matching Fedora dependencies like it's nothing πŸ”₯


and that's the whole page bestie!! πŸ’– this gem dropped in November 2023, and the manual page is TOML-ADAPT(13) β€” go forth and adapt your tomls, you absolute icon πŸ¦‹πŸ‘‘βœ¨

πŸ“¦ where this page comes from