-
Notifications
You must be signed in to change notification settings - Fork 16
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
MacOS and Windows support #397
Conversation
ca281ac
to
d551f11
Compare
52c2291
to
3904f1a
Compare
d529d90
to
4deb134
Compare
0bfbdef
to
92ddf45
Compare
On Windows pip and Python executable are located under venv_dir\Scripts\. `pip_path` depends now on OS.
On Windows, Python virtual environment keeps the 3rd partiies libraries under `{venv_dir}\Lib\site-packages`. Python version is not mentioned anywhere in the directories names.
On windows, a CI runner does not have admin premissions, which are needed to delete the temporary file constructed with `NamedTemporaryFile`.
In this commit, we use Ptrhon standard library to provide sys.executable and os.devnull.
Some of the tests are irrelevant to Windows. These were mearked to be skipped when run on Windows machine. Added one test for Windows, wchich is skipped for a non-Windows run.
This issue originates from the way we run real project tests. I included more details in the PR description.
Make all paths in the code system-agnostic. They are either build with os.path.join() or with operations on `Path` object.
…on a system For Windows, there is several differences like remove command, creation of an empty file. We make sure that packages are installed in the new virtual environment by running python from this virtual environment with `-m pip install`
…ptions execution time.
On Windows only administrator can create symlinks. We will skip this test on windows as one of a low impact.
For Python Algorithms project
This confuses Windows...
On Windows the ordering of logs is different.
For tests and format. For other workflows ubuntu with fixed version is changed to `ubuntu-latest`.
139a3a7
to
091abe9
Compare
Than you @jherland for your review and insights. I fixed two main things you asked for - using I would leave the real-project related challenges to another PR. I tested the Python Algorithms project that was failing in the real project tests on a Windows machine and it works. For Windows users, I think that the most important is that when FawltyDeps looks for a mapping, it checks also virtual environment available in Windows. That is the most significant improvement in my opinion for a regular user. For a developer, we made it possible with this PR to contribute to FawltyDeps when writing code on Windows thanks to the tests refactor 🎉 |
9e41731
to
dadf267
Compare
dadf267
to
d0fb833
Compare
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.
Still a few comments here and there, but I am happy for this to be merged after you've had a look. Feel free to push back if you feel I'm getting too nitpicky. You can always tell me to fix things myself in a later PR 😅
There's one unresolved comment from the previous round, about the delete
flag to NamedTemporaryFile
where I think we need to be careful to get things right. Otherwise, my comments and suggestions are mostly just matters of taste, and I'm happy to get this merged with or without addressing those.
… the system requires it
Co-authored-by: Johan Herland <johan.herland@tweag.io>
0eb7945
to
b62885f
Compare
b62885f
to
f4b2a0a
Compare
Reorder package search conditions and simplify one for Windows to resemble one for POSIX more.
31d3ba2
to
fb17603
Compare
fb17603
to
e16b180
Compare
This commit adds 'path_sets_equal' function that checks if <Paths> created of provided strings are equal or not
Support for MacOS
To support MacOS it is enough to add
macos-latest
to the test matrix and allow for longer runs for tests that use--install-deps
option.Support for Windows
To support Windows we needed to:
Issues
In the process of adjusting the code to support Windows, we discovered, that the
real_projects
tests setup is not suited for Windows. The fact that we use a separate virtual environment, which we construct from the command line makes it hard to work with Windows.You may see example of such problem in this CI run. In this case, project The Algorithms-Python uses conditional requirement:
This falls into undeclared dependencies on Windows for Python <=3.10. This behavior should be investigated in a separate ticket.