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
manifest.json has character limits for name (45) and description (132).
Language packs now use:
name: Language: {native_name} ({english_name})
description: {app} Language Pack for {native_name} ({locale_code}) – {english_name}
The English name is omitted if identical to the native name, and it's omitted from the name if the resulting name exceeds the character limit.
Longer name or description are always truncated.
Differential Revision: https://phabricator.services.mozilla.com/D164535
If we want to use individual-files for a lot of files, all
of which are going the same place, it is very verbose and
repetitive. Create an alternate, mutually-exclusive way of
specifying individual-files in a moz.yaml
Differential Revision: https://phabricator.services.mozilla.com/D163969
- make sure the patch files are sorted before we apply them
- strip trailing slashes from the repo url before we add more
- Allow the individual-files action to be used by individual-files
Differential Revision: https://phabricator.services.mozilla.com/D163968
Switches from `buildconfig.substs` to `bootstrap_toolchain` for the repackage job
Refactors mozpack/dmg to not depend on the environment; Moves path resolution of tools up to `mozbuild.action.{make_dmg|unpack_dmg}`
Update syntax to python 3.7+
Differential Revision: https://phabricator.services.mozilla.com/D163129
The JSON data added here is derived from mozIntl.sys.mjs for the native names,
and Intl.DisplayNames for the English names. Once it becomes possible to
synchronously import JSON from JS code, this data should be merged with that
used by mozIntl.sys.mjs.
Differential Revision: https://phabricator.services.mozilla.com/D163049