Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editable install: do not show any output in verbose mode when there is no work to do #579

Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6bc67f6
ENH: do not show any output in editable verbose mode when there is no…
lesteve Feb 22, 2024
b73ad7e
Reuse same code as in meson and add origin in comment
lesteve Feb 22, 2024
f7b3c00
Add test
lesteve Feb 23, 2024
779205f
Tweak output and test
lesteve Feb 23, 2024
804f434
Fix test on OSX
lesteve Feb 23, 2024
875eeb5
Simple quotes
lesteve Feb 23, 2024
78a5ea9
More simple quotes
lesteve Feb 23, 2024
69c0523
Only check first two lines of output
lesteve Feb 23, 2024
ab97efa
Tweak message and adapt test
lesteve Feb 23, 2024
0ae0795
Touching the file is enough to trigger compilation
lesteve Feb 23, 2024
4b67b30
Naive Windows attempt
lesteve Feb 23, 2024
d1eb4d0
Skip test on Alpine
lesteve Feb 23, 2024
e88169b
Skip test on Alpine
lesteve Feb 23, 2024
8cb12d7
Check exit code in dry-run command
lesteve Feb 23, 2024
e2177e3
Tackle comments
lesteve Feb 29, 2024
c4a60d4
Merge branch 'main' of https://github.com/mesonbuild/meson-python int…
lesteve Feb 29, 2024
2721e88
Touching the file is enough
lesteve Mar 4, 2024
89df78e
Check platform rather than first command argument
lesteve Mar 4, 2024
a6e336f
Merge branch 'main' of https://github.com/mesonbuild/meson-python int…
lesteve Mar 4, 2024
8f025a6
Debug CI
lesteve Mar 4, 2024
1e310d5
Debug CI
lesteve Mar 4, 2024
00680d0
Add test with verbose=True in main process
lesteve Mar 5, 2024
bc2f63c
Do not override existing ninja-args arguments on Windows
lesteve Mar 5, 2024
70e32ac
Fix mypy
lesteve Mar 5, 2024
674f813
Fix Windows
lesteve Mar 5, 2024
1557f58
Remove debug code
lesteve Mar 5, 2024
ee8048e
Tweak module unloading in case of import error
lesteve Mar 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Tweak module unloading in case of import error
lesteve committed Mar 5, 2024
commit ee8048eba9489d0d4815f5df18202f1048f76d0f
4 changes: 2 additions & 2 deletions tests/test_editable.py
Original file line number Diff line number Diff line change
@@ -105,9 +105,9 @@ def test_mesonpy_meta_finder(package_complex, tmp_path, make_finder):
finally:
# remove finder from the meta path
del sys.meta_path[0]
# unload complex module and all its submodules
# unload complex module and all its submodules to be able to run parametrized tests without side-effects
for module in ['complex', 'complex.test', 'complex.namespace', 'complex.namespace.foo']:
del sys.modules[module]
sys.modules.pop(module, None)


def test_mesonpy_traversable():

Unchanged files with check annotations Beta

if not ninja_index_and_arg_list:
dry_run_build_cmd = self._build_cmd + ['--ninja-args=-n']
else:
dry_run_build_cmd = self._build_cmd.copy()

Check warning on line 323 in mesonpy/_editable.py

Codecov / codecov/patch

mesonpy/_editable.py#L323

Added line #L323 was not covered by tests
# Last --ninja-args overrides all the previous ones, so need to modify only the last one to add -n
last_ninja_index, last_ninja_args = ninja_index_and_arg_list[-1]
dry_run_build_cmd[last_ninja_index] = last_ninja_args + ',-n'

Check warning on line 326 in mesonpy/_editable.py

Codecov / codecov/patch

mesonpy/_editable.py#L325-L326

Added lines #L325 - L326 were not covered by tests
p = subprocess.run(dry_run_build_cmd, cwd=self._build_path, env=env, capture_output=True, check=True)
return b'ninja: no work to do.' not in p.stdout and b'samu: nothing to do' not in p.stdout