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

Upgrade python version in tests action and remove pytest dependency #59

Merged
merged 5 commits into from Dec 11, 2023

Conversation

northwestwitch
Copy link
Member

@northwestwitch northwestwitch commented Dec 6, 2023

This PR adds | fixes:

How to test:

  • Tests in GitHub actions should pass

Review:

  • Code approved by HS
  • Tests executed by GitHub actions

This version is a:

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

@northwestwitch northwestwitch marked this pull request as draft December 6, 2023 13:55
@northwestwitch northwestwitch changed the title Upgrade python version in tests action and fix pytest bug Upgrade python version in tests action and fix pytest endpoints values Dec 7, 2023
@northwestwitch northwestwitch marked this pull request as ready for review December 7, 2023 07:31
@northwestwitch northwestwitch changed the title Upgrade python version in tests action and fix pytest endpoints values Upgrade python version in tests action and upgrade pytest package Dec 7, 2023
@northwestwitch northwestwitch added the Effort S Effort small label Dec 7, 2023
Copy link
Contributor

@henrikstranneheim henrikstranneheim left a comment

Choose a reason for hiding this comment

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

👍

pyproject.toml Outdated
@@ -22,12 +22,15 @@ importlib-resources = "^5.12.0"
uvicorn = "^0.21.1"
pydantic = "^2.5.2"
pydantic-settings = "^2.1.0"
pytest = "^7.4.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pytest = "^7.4.3"

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a good idea, but then I should modify the action, because as it is it installs pytest from the repo dependencies

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it wlorked!

@@ -30,7 +30,8 @@ def test_ensembl_exons(
mocker.patch("schug.endpoints.exons.stream_resource", return_value=exons_lines)

# WHEN sending a request to Biomart to retrieve exons in the given build
response: Response = client.get(f"{endpoints.ENSEMBL_EXONS}?build={build}")
response: Response = client.get(f"{endpoints.ENSEMBL_EXONS.value}?build={build}")
Copy link
Contributor

Choose a reason for hiding this comment

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

With python 3.11 and if you make the

Endpoints(str, Enum)

a StrEnum instead you do not have to coerce using .value

Copy link
Member Author

Choose a reason for hiding this comment

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

Will it work also with python 3.8?

Copy link
Contributor

Choose a reason for hiding this comment

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

Only with >=3.11 - something for the future then.

Copy link

sonarcloud bot commented Dec 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@northwestwitch northwestwitch changed the title Upgrade python version in tests action and upgrade pytest package Upgrade python version in tests action and remove pytest dependency Dec 11, 2023
@northwestwitch northwestwitch merged commit a70cc9a into main Dec 11, 2023
6 checks passed
@northwestwitch northwestwitch deleted the upgrade_tests_python branch December 11, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort S Effort small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error using python=3.11 in tests GitHub action
2 participants