Skip to content

Commit ed4edd6

Browse files
authored
Enable triggering PR workflow and fix tests (#168)
1 parent 1b1e118 commit ed4edd6

File tree

5 files changed

+43
-19
lines changed

5 files changed

+43
-19
lines changed

.github/workflows/pr-check.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- release*
1414
- release/*
1515
- release-*
16+
workflow_dispatch:
1617

1718
jobs:
1819
tests:
@@ -133,7 +134,7 @@ jobs:
133134
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
134135
run: |
135136
pyenv install --list
136-
pyenv install 3.12.6 3.8.19
137+
pyenv install 3.13.0 3.12.7 3.8.20
137138
shell: bash
138139

139140
# pyenv-win install list has not updated for a while
@@ -179,7 +180,7 @@ jobs:
179180

180181
- name: Find Environments
181182
if: matrix.run_cli == 'yes'
182-
run: cargo run --release --target ${{ matrix.target }}
183+
run: cargo run --release --target ${{ matrix.target }} -- find -v -l
183184
shell: bash
184185

185186
- name: Run Tests
@@ -351,7 +352,7 @@ jobs:
351352
shell: bash
352353

353354
- name: Find Environments
354-
run: cargo run --release --target ${{ matrix.target }}
355+
run: cargo run --release --target ${{ matrix.target }} -- find -v -l
355356
shell: bash
356357

357358
- name: Run Tests
@@ -409,7 +410,7 @@ jobs:
409410
shell: bash
410411

411412
- name: Find Environments
412-
run: cargo run --release --target ${{ matrix.target }}
413+
run: cargo run --release --target ${{ matrix.target }} -- find -v -l
413414
shell: bash
414415

415416
- name: Run Tests

crates/pet-homebrew/src/environments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn get_prefix(_resolved_file: &Path) -> Option<PathBuf> {
132132
// let captures = reg_ex.captures(resolved_file)?;
133133
// let version = captures.get(1).map(|m| m.as_str()).unwrap_or_default();
134134
// let full_version = captures.get(2).map(|m| m.as_str()).unwrap_or_default();
135-
// // SysPrefix- /usr/local/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8
135+
// // SysPrefix- /usr/local/Cellar/python@3.8/3.8.20/Frameworks/Python.framework/Versions/3.8
136136
// let sys_prefix = PathBuf::from(format!(
137137
// "/usr/local/Cellar/python@{}/{}/Frameworks/Python.framework/Versions/{}",
138138
// version, full_version, version

crates/pet-homebrew/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ fn from(env: &PythonEnv) -> Option<PythonEnvironment> {
112112
} else if resolved_file.starts_with("/usr/local/Cellar") {
113113
// Symlink - /usr/local/bin/python3.8
114114
// Symlink - /usr/local/opt/python@3.8/bin/python3.8
115-
// Symlink - /usr/local/Cellar/python@3.8/3.8.19/bin/python3.8
116-
// Real exe - /usr/local/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8/bin/python3.8
117-
// SysPrefix- /usr/local/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8
115+
// Symlink - /usr/local/Cellar/python@3.8/3.8.20/bin/python3.8
116+
// Real exe - /usr/local/Cellar/python@3.8/3.8.20/Frameworks/Python.framework/Versions/3.8/bin/python3.8
117+
// SysPrefix- /usr/local/Cellar/python@3.8/3.8.20/Frameworks/Python.framework/Versions/3.8
118118
get_python_info(
119119
&PathBuf::from("/usr/local/bin").join(exe_file_name),
120120
&resolved_file,

crates/pet-homebrew/src/sym_links.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ pub fn get_known_symlinks_impl(
129129
None => vec![],
130130
}
131131
} else if symlink_resolved_python_exe.starts_with("/usr/local/Cellar") {
132-
// Real exe - /usr/local/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8/bin/python3.8
132+
// Real exe - /usr/local/Cellar/python@3.8/3.8.20/Frameworks/Python.framework/Versions/3.8/bin/python3.8
133133

134134
// Known symlinks include
135135
// /usr/local/bin/python3.8
136136
// /usr/local/opt/python@3.8/bin/python3.8
137-
// /usr/local/Cellar/python@3.8/3.8.19/bin/python3.8
138-
// /usr/local/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8/bin/python3.8
137+
// /usr/local/Cellar/python@3.8/3.8.20/bin/python3.8
138+
// /usr/local/Cellar/python@3.8/3.8.20/Frameworks/Python.framework/Versions/3.8/bin/python3.8
139139
match PYTHON_VERSION.captures(symlink_resolved_python_exe.to_str().unwrap_or_default()) {
140140
Some(captures) => match captures.get(1) {
141141
Some(version) => {

crates/pet/tests/ci_homebrew_container.rs

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,41 @@ fn verify_python_in_homebrew_contaner() {
4747

4848
let environments = reporter.environments.lock().unwrap().clone();
4949

50+
// let python3_12 = PythonEnvironment {
51+
// kind: Some(PythonEnvironmentKind::Homebrew),
52+
// executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3")),
53+
// version: Some("3.13.0".to_string()), // This can change on CI, so we don't check it
54+
// symlinks: Some(vec![
55+
// // For older versions of Python, we do not have a tonne of symlinks,
56+
// // E.g. for 3.12.7 (which was the latest at some point, at a lot of symlinks)
57+
// // As soon as 3.13 was shipped, the number of symlinks in 3.12.7 was the same as 3.11 (very few)
58+
// // I.e. only the latest versions of python have a lot of symlinks, debt to take these into account and simplify the tests
59+
// PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3"),
60+
// PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.13"),
61+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python3/bin/python3"),
62+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python3/bin/python3.13"),
63+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3/bin/python3"),
64+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3/bin/python3.13"),
65+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.13/bin/python3"),
66+
// PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.13/bin/python3.13"),
67+
// // On CI the Python version can change with minor updates, so we don't check the full version.
68+
// // PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.13/3.13.0/bin/python3.13"),
69+
// ]),
70+
// ..Default::default()
71+
// };
5072
let python3_12 = PythonEnvironment {
5173
kind: Some(PythonEnvironmentKind::Homebrew),
52-
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3")),
74+
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.12")),
5375
version: Some("3.12.7".to_string()), // This can change on CI, so we don't check it
5476
symlinks: Some(vec![
55-
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3"),
77+
// For older versions of Python, we do not have a tonne of symlinks,
78+
// E.g. for 3.12.7 (which was the latest at some point, at a lot of symlinks)
79+
// As soon as 3.13 was shipped, the number of symlinks in 3.12.7 was the same as 3.11 (very few)
80+
// I.e. only the latest versions of python have a lot of symlinks, debt to take these into account and simplify the tests
5681
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.12"),
57-
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python3/bin/python3"),
58-
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python3/bin/python3.12"),
59-
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3/bin/python3"),
60-
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3/bin/python3.12"),
61-
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3"),
6282
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3.12"),
6383
// On CI the Python version can change with minor updates, so we don't check the full version.
64-
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.6/bin/python3.12"),
84+
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.7_1/bin/python3.12"),
6585
]),
6686
..Default::default()
6787
};
@@ -70,6 +90,9 @@ fn verify_python_in_homebrew_contaner() {
7090
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11")),
7191
version: Some("3.11.10".to_string()), // This can change on CI, so we don't check it
7292
symlinks: Some(vec![
93+
// For older versions of Python, we do not have a tonne of symlinks,
94+
// E.g. for 3.12.7 (which was the latest at some point, at a lot of symlinks)
95+
// As soon as 3.13 was shipped, the number of symlinks in 3.12.7 was the same as 3.11 (very few)
7396
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11"),
7497
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/python@3.11/bin/python3.11"),
7598
// On CI the Python version can change with minor updates, so we don't check the full version.

0 commit comments

Comments
 (0)