Skip to content

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Feb 26, 2025

Description:

Enable CondaForgeYAMLCleanup migrator for v1 recipes. Since it works on conda-forge.yml only, it does not require any changes. So the most of the changes are related to extending the test.

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

Enable `CondaForgeYAMLCleanup` migrator for v1 recipes.  Since it works
on `conda-forge.yml` only, it does not require any changes.  So the most
of the changes are related to extending the test.
Fix an exception when the tested v1 recipe has no `license_file` key:

E       TypeError: 'NoneType' object is not subscriptable
@mgorny
Copy link
Contributor Author

mgorny commented Feb 26, 2025

@beckermr, the v0/v1 testing code is becoming horrible. Would you mind me if I tried converting all v0 tests to use the same tempdir approach as v1 — i.e. passed top-level tempdir rather than the recipe subdir?

I imagine it's going to be a lot of work, but it should make everything cleaner. Perhaps going in the other direction (i.e. making v1 tests use recipe subdir) would be less work, but I find the resulting backreferences kinda iffy.

@ytausch
Copy link
Contributor

ytausch commented Feb 26, 2025

If you do that, could you also migrate to tmp_path? tmpdir returns a py.path.local object, which really is outdated Python.

@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.85%. Comparing base (73b9591) to head (3ec10c9).

Files with missing lines Patch % Lines
...a_forge_tick/migrators/conda_forge_yaml_cleanup.py 66.66% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (94.03%) is below the target coverage (95.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3765      +/-   ##
==========================================
- Coverage   77.34%   75.85%   -1.49%     
==========================================
  Files         134      134              
  Lines       14851    14855       +4     
==========================================
- Hits        11487    11269     -218     
- Misses       3364     3586     +222     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mgorny
Copy link
Contributor Author

mgorny commented Feb 26, 2025

If you do that, could you also migrate to tmp_path? tmpdir returns a py.path.local object, which really is outdated Python.

Sure can do. Does that mean it's fine for me to proceed, or should I wait for more ACKs?

@beckermr
Copy link
Contributor

Yes the testing code is fiddly in general, so improvements are welcome.

Copy link
Contributor

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

You need to add 1 to the allowed schema version for the migrator as well IIRC.

@mgorny
Copy link
Contributor Author

mgorny commented Feb 27, 2025

Ah, sorry, removed it while debugging the tests, and forgot to put it back. Which means now I'm going to have to debug why the tests pass…

@mgorny
Copy link
Contributor Author

mgorny commented Feb 27, 2025

Heh, turned out we weren't checking schema version in MiniMigrator at all. Added a quick fix, now gotta run, will check if this didn't break anything later.

@beckermr
Copy link
Contributor

Shall we merge this one @mgorny?

@mgorny
Copy link
Contributor Author

mgorny commented Feb 27, 2025

Yes, please.

@mgorny
Copy link
Contributor Author

mgorny commented Feb 27, 2025

That said, tests/test_qt_qt_main.py seems to be suffering from network problems now.

It would probably be also worth looking into mocking some network interactions in the test suite too.

@beckermr beckermr enabled auto-merge February 27, 2025 16:54
@beckermr
Copy link
Contributor

I added network retries to that one to ensure it passes. We can up those maybe. I do not think that one can be mocked.

@mgorny
Copy link
Contributor Author

mgorny commented Feb 27, 2025

I added network retries to that one to ensure it passes. We can up those maybe. I do not think that one can be mocked.

Right. I suppose we could try mocking the whole logic that grabs the hash, but perhaps that'd go too far.

@beckermr beckermr disabled auto-merge February 27, 2025 16:58
@beckermr beckermr merged commit 938abfe into regro:main Feb 27, 2025
4 of 5 checks passed
@mgorny mgorny deleted the cf-cleanup-v1 branch February 27, 2025 16:58
@beckermr
Copy link
Contributor

I am so sorry! I squashed which will make for a bad conflict on your other PR.

🤦

@beckermr beckermr mentioned this pull request Feb 28, 2025
33 tasks
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.

3 participants