Skip to content

Commit

Permalink
[TESTING] glean_parser from git
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed Nov 22, 2024
1 parent 7a20b74 commit 79cc41c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 1 addition & 3 deletions glean-core/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ use std::{env, path::PathBuf};

use xshell_venv::{Result, Shell, VirtualEnv};

const GLEAN_PARSER_VERSION: &str = "15.2.0";

/// A Glean Rust bindings generator.
pub struct Builder {
files: Vec<String>,
Expand Down Expand Up @@ -114,7 +112,7 @@ impl Builder {
} else {
let venv = VirtualEnv::new(&sh, "py3-glean_parser")?;

let glean_parser = format!("glean_parser~={GLEAN_PARSER_VERSION}");
let glean_parser = "git+ssh://git@github.com/mozilla/glean_parser@follows-collection-enabled#egg=glean_parser".to_string();
// TODO: Remove after we switched glean_parser away from legacy setup.py
venv.pip_install("setuptools")?;
venv.pip_install(&glean_parser)?;
Expand Down
2 changes: 1 addition & 1 deletion glean-core/ios/sdk_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ VENVDIR="${SOURCE_ROOT}/.venv"
# We need at least pip 20.3 for Big Sur support, see https://pip.pypa.io/en/stable/news/#id48
# Latest pip is 21.0.1
"${VENVDIR}"/bin/pip install "pip>=20.3"
"${VENVDIR}"/bin/pip install --upgrade "glean_parser~=$GLEAN_PARSER_VERSION"
"${VENVDIR}"/bin/pip install --upgrade "git+ssh://git@github.com/mozilla/glean_parser@follows-collection-enabled#egg=glean_parser"

# Run the glinter
# Turn its warnings into warnings visible in Xcode (but don't do for the success message)
Expand Down
19 changes: 11 additions & 8 deletions glean-core/python/glean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@
parser_version_next_major = parser_version.bump_major()


current_parser = VersionInfo.parse(glean_parser.__version__)
if current_parser < parser_version or current_parser >= parser_version_next_major:
warnings.warn(
f"glean_sdk expected glean_parser ~= v{GLEAN_PARSER_VERSION}, "
f"found v{glean_parser.__version__}",
Warning,
stacklevel=1,
)
try:
current_parser = VersionInfo.parse(glean_parser.__version__)
if current_parser < parser_version or current_parser >= parser_version_next_major:
warnings.warn(
f"glean_sdk expected glean_parser ~= v{GLEAN_PARSER_VERSION}, "
f"found v{glean_parser.__version__}",
Warning,
stacklevel=1,
)
except Exception:
pass


__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ except:
if (parserVersion.matches("git.+")) {
conda "Miniconda3", "Miniconda3-py311_${MINICONDA_VERSION}", "64", [parserVersion]
} else {
conda "Miniconda3", "Miniconda3-py311_${MINICONDA_VERSION}", "64", ["glean_parser~=${parserVersion}"]
conda "Miniconda3", "Miniconda3-py311_${MINICONDA_VERSION}", "64", ["git+ssh://git@github.com/mozilla/glean_parser@follows-collection-enabled#egg=glean_parser"]
}
}
File envDir = new File(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers = [

dependencies = [
"semver>=2.13.0",
"glean_parser~=15.2",
"glean_parser @ git+ssh://git@github.com/mozilla/glean_parser@follows-collection-enabled#egg=glean_parser",
"importlib_resources>=1.3; python_version=='3.8'"
]

Expand Down

0 comments on commit 79cc41c

Please sign in to comment.