generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Prepare test suite for traversing Python environments #325
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5f59760
to
6caf6cb
Compare
626aa6c
to
b3d8bef
Compare
6caf6cb
to
c56e3fc
Compare
b3d8bef
to
598c293
Compare
59090a9
to
b6a5b32
Compare
🎉 All dependencies have been resolved ! |
Until now, all sample experiments have been run with a cached venv that is populated with the packages listed in the 'requirements' directive (empty by default). This commit allows experiments to declare a `pyenvs` list of directories (relative to the sample project) to be passed (via settings.pyenvs) instead of the cached venv. This will allow sample projects to embed Python environments within their project, which can then be used e.g. to test the traversal of the project directories. When given, the `pyenvs` directive will _override_ the `requirements` directive, meaning that the cached venv will no longer be used to resolve packages, only the paths passed to 'pyenvs' will be used.
This is not a real project, but merely a collection of different kinds of Python environments that we should support. In a future commit, the project traversal code in FawltyDeps will learn to auto-detect Python environments, and ignore code/deps sources otherwise found within these. When that is in place, this sample project's expected.toml will become considerably simpler, as everything should be correctly detected with default settings. For now, though, we need to pass very explicit code/deps/pyenvs options in order to compensate for FawltyDeps' lack of smarts.
One of the test vector passed a nonsense TraverseProjectVector.project member that did not point to an actual project under tests/sample_projects. Fix that, and add an assert to the test logic below to ensure this does not happen again.
We are about to introduce Python environments into the traverse_project logic. When testing the new logic we will - in addition to passing in code + deps via settings and expecting corresponding CodeSource and DepsSource objects to be created - also do the same for settings.pyenvs, resulting in the creation of PyEnvSource objects. The default mode of operation will be to auto-detect Python environments under the current project dir (as we currently do for code + deps). In order for the new logic not to interfere with the existing code/deps tests, we must therefore explicitly pass an empty pyenvs set to the existing tests. This commit does exactly that. A lot of diff noise to ensure that a future change does not change how these existing tests will work.
598c293
to
36a78ab
Compare
Nour-Mws
approved these changes
Jun 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Depends on #324)
There are more preparatory steps on the way to integrating Python environments logic into the
traverse_project
module.Commits:
test_sample_projects
: Accept new 'pyenvs' directive inexpected.toml
sample_projects
: Addpyenv_galore
'project'test_traverse_project
: Fix incorrect.project
member for a test vectortest_traverse_project
: Prepare for testing with 'pyenvs'