I’ve factored out Fedora-derived distros in a fashion similar to
how Debian-based distros are handled. [Orabug: 34636427]
Differential Revision: https://phabricator.services.mozilla.com/D164218
Convert all other imports of `pytoml` within mozilla-central to imports
of `toml`.
As both libraries patterned their API on that of the Python standard-
library module `json`, this is mostly a straight replace, with two
caveats:
* pytoml's exception messages when loading a file provide the file
name; toml's do not. Some additional machinery has been added or
repurposed in a few places to ensure that the relevant filename is
printed.
* In `python_lockfile.py`, the order of arguments to `dump` needed to
be reversed. (`toml` follows `json` in this; `pytoml` differs.)
This patchset does not remove pytoml from `requirements.in`, as `pytoml`
is still used by `compare-locales`.
Differential Revision: https://phabricator.services.mozilla.com/D164155
`pytoml` could not handle single-quoted keys in table names, as these
were added in TOML v0.5.0; but `toml` has no problem with them.
Remove regex-based scraping of Cargo.toml files to find a crate's
associated license, replacing it with `toml.load`.
(This has been manually tested to ensure that dependencies with
noncompliant licenses or unrecognized license files continue to be
rejected.)
Differential Revision: https://phabricator.services.mozilla.com/D164154
The postprocessing phase that cleaned up `pytoml`'s output has little
effect on `toml`'s output, which is already largely clean. Remove the
additional code.
Differential Revision: https://phabricator.services.mozilla.com/D164153
Remove explicit sorting, as this is no longer needed to guarantee
determinism as of Python 3.6 (our minimum-supported version).
(This is a separate commit solely to make it clear that the reordering
of `.cargo/config.in` is indeed merely a reordering and contains no
hidden functional changes.)
Differential Revision: https://phabricator.services.mozilla.com/D164152
Replace `pytoml` with `toml` in `vendor_rust.py`.
This is a minimal substitution that preserves existing behavior (along
with a flake8 lint pass). Further simplification will follow in upcoming
commits.
In particular, we temporarily alter `recursive_sort` to ensure that the
output of `pytoml` and `toml` are identical, rather than merely
equivalent. (`pytoml` would reverse the ordering of keys in some
contexts.)
Differential Revision: https://phabricator.services.mozilla.com/D164151
The `pytoml` library is abandoned, and does not support TOML v0.5.0,
which Cargo uses. This prevents mach from properly parsing many
Cargo.toml files.
Include the `toml` library as a slightly more modern and currently-
maintained alternative for use in mach.
Supply-chain notes:
- toml v0.10.2 is MIT-licensed, which is an approved MPL-compatible
license.
- I have personally audited this version of `toml` and consider it
"safe-to-run", as much as any Python code can be: other than opening
and reading/writing a file when specifically requested via `load`/
`dump` respectively, it performs only string manipulation and
ordinary object creation.
Differential Revision: https://phabricator.services.mozilla.com/D164150
This utility script for l10n migrations was added six years ago in bug 1294186,
but is no longer necessary or used. For clarity, it should be removed.
Differential Revision: https://phabricator.services.mozilla.com/D164049
Changing a linter's `support-files` causes that linter to
run against the entire tree. This is to avoid introducing
a regression in files that weren't touched, which would
be confusing for developers who trusted `--outgoing` to
catch their regressions.
Turn this behaviour off when `--fix` is passed as a linter
argument so these regressions aren't also fixed tree-wide.
Move the logic for tree-wide linting into a function
`should_lint_entire_tree` and add tests for the behaviour
in `test_roller.py`.
Differential Revision: https://phabricator.services.mozilla.com/D164761