Can I `import glean_parser` without having to change `sys.path`?
Categories
(Firefox Build System :: General, enhancement)
Tracking
(firefox81 fixed)
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: chutten, Assigned: rstewart)
Details
Attachments
(1 file)
After bug 1654663 we can no longer just import glean_parser
at the top of a file during the build or test. I'd like to be able to do that again as we'll be using the vendored glean_parser
to check geckoview's metrics.yaml for lint (toolkit/components/telemetry/build_scripts/run_glean_parser.yaml), run some FOG tests (toolkit/components/glean/pytest/), and to generate a variety of metrics APIs for Firefox Desktop (toolkit/components/glean/build_scripts).
Right now the current plan is to add the vendored glean_parser to sys.path
just before importing it, either at file level or inline. I would appreciate any tips, tricks, or small tweaks to make this more ergonomic. glean_parser
's role will only increase as Project FOG picks up steam.
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
Oh, and to be clear, import glean_parser
never worked in tests. Probably due to python-test
's use of pipenv or something
Assignee | ||
Comment 2•4 years ago
|
||
What's project FOG, ooc? Is there a website or doc or something I can peek at?
Assignee | ||
Comment 3•4 years ago
|
||
This solves the same problem we attempted to solve in bug 1654663. That was a low-cost, sensible solution when there was only one in-build reference to glean_parser
, but with project FOG we're about to drastically increase the in-build reliance on the library, so the ad-hoc sys.path
manipulation is an increasingly insensible solution. Here we address this in a first-class way by specifying that glean_parser
should be imported in virtualenv
s, but NOT by mach
when bootstrapping.
Assignee | ||
Comment 5•4 years ago
|
||
(seems like i should've been able to guess that one, huh)
Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3cf9282868b9 Allow specifying that certain packages should only be included in a `virtualenv` when parsing `virtualenv_packages.txt` r=chutten,nalexander
Comment 7•4 years ago
|
||
bugherder |
Description
•