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

Test on more versions of Python #563

Merged
merged 8 commits into from
Sep 29, 2024
Merged

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Sep 27, 2024

Description

Dual to #562 let's check which Python versions work.

@maresb maresb requested a review from a team as a code owner September 27, 2024 19:13
@maresb
Copy link
Contributor Author

maresb commented Sep 27, 2024

Ok, conda-recipe-manager fails unless Python >=3.11

@maresb
Copy link
Contributor Author

maresb commented Sep 27, 2024

Probably the right thing to do is conditionally install conda-recipe-manager on Python >=3.11 and then conditionally run only the tests that actually need it.

@maresb maresb mentioned this pull request Sep 27, 2024
@marcelotrevisani
Copy link
Member

yeah, that is due to the fact that conda-recipe-manager constrain python
but that is a optional dependency, we can indeed run for older python versions without it

@@ -163,7 +164,7 @@
return recipe_license["licenseId"]


def _get_license(license_id: str, all_licenses: List) -> dict:
def _get_license(license_id: str, all_licenses: list) -> dict:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
@@ -41,7 +42,7 @@
PIN_PKG_COMPILER = {"numpy": "<{ pin_compatible('numpy') }}"}


def search_setup_root(path_folder: Union[Path, str]) -> Path:
def search_setup_root(path_folder: Path | str) -> Path:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
@maresb
Copy link
Contributor Author

maresb commented Sep 28, 2024

It looks like there is no coverage yet for --use-v1-format so the tests already pass without conda-recipe-manager.

@maresb
Copy link
Contributor Author

maresb commented Sep 28, 2024

Oops, seems to be hitting mamba-org/setup-micromamba#225

@maresb maresb force-pushed the patch-2 branch 3 times, most recently from e8398e8 to a078d44 Compare September 28, 2024 18:05
@maresb
Copy link
Contributor Author

maresb commented Sep 28, 2024

@marcelotrevisani, what do you think of these changes?

Tests are now passing down to Python 3.8. In order to get there I had to from __future__ import annotations to some files, tweak a context manager call, and run ruff check --fix.

I removed conda-recipe-manager from the environment.yml, but in the CI I conditionally install it when the Python version is >=3.11.

Finally, I switched from setup-miniconda to setup-micromamba.

environment.yaml Outdated
@@ -29,4 +29,4 @@ dependencies:
- libcblas
- beautifulsoup4
- semver >=3.0.0,<4.0.0
- conda-recipe-manager >=0.2.0
- micromamba
Copy link
Member

Choose a reason for hiding this comment

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

do we need micromamba here? 😬

raise ImportError(
"Please install conda-recipe-manager from conda-forge to enable "
"support for the V1 format. (Note that Python >=3.11 is required.)"
) from e
Copy link
Member

Choose a reason for hiding this comment

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

cool, thanks for that

@marcelotrevisani
Copy link
Member

hey, thanks again for this PR, I just added one comment about micromamba in the environment.yaml, do we need it there?

@maresb
Copy link
Contributor Author

maresb commented Sep 29, 2024

Ah, very good point!!! Now that I switched the CI over to setup-micromamba I don't think we need it since I needed it specifically for that CI.

I just rebased to remove the commit where I added it. (See the rebase diff with the "Compare" button or equivalently here.)

@maresb
Copy link
Contributor Author

maresb commented Sep 29, 2024

@marcelotrevisani, yep, it's working. The relevant part of CI has completed.

@marcelotrevisani marcelotrevisani merged commit 3402aa0 into conda:main Sep 29, 2024
10 checks passed
@maresb maresb deleted the patch-2 branch September 29, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants