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

feat: adapting tests and code-style actions to avoid using venv when called by poetry #423

Merged
merged 3 commits into from Mar 14, 2024

Conversation

RobPasMue
Copy link
Member

Closes #348

@RobPasMue RobPasMue self-assigned this Mar 13, 2024
@RobPasMue RobPasMue requested a review from a team as a code owner March 13, 2024 09:30
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot added the enhancement New features or code improvements label Mar 13, 2024
@RobPasMue
Copy link
Member Author

@philipjusher - could you give it a try to this branch?

@RobPasMue
Copy link
Member Author

You can try it out by testing the following change on your action (for example): https://github.com/ansys/openapi-common/pull/528/files

Copy link
Contributor

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep ${{ env.ACTIVATE_VENV }} when running without poetry ?

I'm asking that because I've got the feeling that something might go wrong when the action to setup python is leveraging an already downloaded python release. Using virtual environments had me thinking that we were protected from such problems.

@RobPasMue
Copy link
Member Author

Ideally we should be running the code-style action on GitHub runners and not on self-hosted runners. So you won't be having this issue.

tests-pytest/action.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RobPasMue RobPasMue merged commit c88503b into main Mar 14, 2024
16 checks passed
@RobPasMue RobPasMue deleted the feat/tests-code-style-poetry-adapting branch March 14, 2024 10:58
Copy link

@philipjusher philipjusher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would recomend testing the code by running the script on an example project using poetry.

run: |
if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
python -m pip install poetry
python -m poetry install

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure you can call poetry from python. I think it installs as command line tool

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are completely right - my bad

@@ -135,8 +152,7 @@ runs:
if: env.EXISTS_TESTS_REQUIREMENTS == 'false'
run: |
if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
python -m pip install poetry
poetry install --with tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you see in the previous version it doesnt call with python.

@philipjusher
Copy link

hi sorry for the delay but i couldnt get this to work. https://github.com/ansys-internal/pyconceptev-core/actions/runs/8295360420/job/22702433906#step:2:257 I added a review as to what I think the issue is but I think you need to run some tests on the scripts to make sure they work as expected for the different set ups.

@RobPasMue
Copy link
Member Author

No problem - I'll look into your issues shortly :)

@RobPasMue
Copy link
Member Author

hi sorry for the delay but i couldnt get this to work. https://github.com/ansys-internal/pyconceptev-core/actions/runs/8295360420/job/22702433906#step:2:257 I added a review as to what I think the issue is but I think you need to run some tests on the scripts to make sure they work as expected for the different set ups.

We will work on this as well shortly - we need to add more testing, I agree

@RobPasMue
Copy link
Member Author

Issue fixed on main - see #426 @philipjusher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests-pytest and doc-build actions fail for pyansys-advanced with poetry template
4 participants