-
-
Notifications
You must be signed in to change notification settings - Fork 444
Test using setup-python directly for common packages #190
Conversation
* gcovr, conan, pip, cmake are all fully supported with pip install on all 3 platforms * using setup-python and pip3 directly removes one variable from the build process * using pip3 directly to install all 3 provides consistency across platforms
Codecov Report
@@ Coverage Diff @@
## main #190 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 20 20
=========================================
Hits 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
This partially a workaround for aminya/setup-cpp#27 but also I think it is not a bad idea, as mentioned in the commit message, it gives consistency across all platforms for the versions and mechanism that common tools are installed. |
Just for clarification: Is this meant to be permanent, or just a temporary fix until aminya/setup-cpp#27 is fixed? |
In my opinion, it would be permanent. I see it as one less potential issue while maintaining this project, and for our users in the future. I don't see any reason to use a mix of chocolatey, package managers, etc, when python gives us the same versions of the same packages across all platforms. |
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.
It is not setup-cpp's fault that the pre-installed Python broke on Windows images. In fact setup-cpp does not call "setup-python" until it actually needed. I do not approve of this, as this is like discarding all the things it was considered in setup-cpp and trying to re-implement them in bash.
cmake: false | ||
ninja: false |
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.
Cmake and Ninja do not need python. Why should they be installed with pip?
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.
Because it gives a simple consistent command that works on all 3 platforms that are supported on github. Since we are working specifically on a github workflow here.
@@ -101,22 +101,26 @@ jobs: | |||
restore-keys: | | |||
${{ runner.os }}-${{ matrix.compiler }}-${{matrix.build_type}}-${{matrix.generator}}-${{matrix.developer_mode}} | |||
|
|||
- uses: actions/setup-python@v2 | |||
|
|||
- run: pip3 install cmake ninja conan gcovr |
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.
This is incomplete. It does not put the paths that conan and gcovr are called from on the path. Have you tried this locally?
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.
It is not setup-cpp's fault that the pre-installed Python broke on Windows images. In fact setup-cpp does not call "setup-python" until it actually needed. I do not approve of this, as this is like discarding all the things it was considered in setup-cpp and trying to re-implement them in bash.
It is not discarding everything setup-cpp is used for. Setup-cpp still does all of the hard work of finding and installing compilers across compilers.
Here I specifically meant the pip installations. As I mentioned in the above comments, it is needed to check if:
* python paths are added to PATH on all platforms * if pip is installed and is up to date
It's good that setup-cpp is now fixed, but I think it's worth mentioning that all of this worked without any other path manipulations. All tests passed and even properly posted coverage reports.
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.
I think that what @aminya’s not saying here is that setup-cpp works just as well on a self-hosted runner. The setup-Python action takes a little more work for that. Some users depend on being able to build their projects with a self-hosted runner; maybe we should try to support them.
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.
We could add additional code here to make self-hosted runners work; there are directions on how to do that here: https://github.com/actions/setup-python.
Or, we could just use setup-cpp.
@@ -101,22 +101,26 @@ jobs: | |||
restore-keys: | | |||
${{ runner.os }}-${{ matrix.compiler }}-${{matrix.build_type}}-${{matrix.generator}}-${{matrix.developer_mode}} | |||
|
|||
- uses: actions/setup-python@v2 | |||
|
|||
- run: pip3 install cmake ninja conan gcovr |
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.
On the GitHub images, it happens that pip3
is on the path. But a lot of the time, it is actually called pip
, which means it is needed to check if pip
has version 3 or above.
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.
On the GitHub images, it happens that
pip3
is on the path. But a lot of the time, it is actually calledpip
, which means it is needed to check ifpip
has version 3 or above.
But isn't this yml file only used on github images?
It's specifically in .github/workflows/ci.yml
, so shouldn't that be the primary concern here?
It is not discarding everything setup-cpp is used for. Setup-cpp still does all of the hard work of finding and installing compilers across compilers. |
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.
The issue is fixed in setup-cpp. The pre-installed pip executable is broken on Windows images. The workaround is to use python -m pip install package
I don't think this is needed anymore
https://github.com/cpp-best-practices/cpp_starter_project/actions/runs/1800095489
Here I specifically meant the pip installations. As I mentioned in the above comments, it is needed to check if:
|
I'm just going to close and remove this PR, since setup-cpp's python integration is working again. |
Worth mentioning that the pip issue is a serious problem in their launchers. It is affecting many people on Windows. |
gcovr
,conan
,ninja
,cmake
are all fully supported with pip install on all 3 platforms