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

update asynctest to 0.5.1 #671

Merged
merged 5 commits into from
Jan 29, 2024
Merged

update asynctest to 0.5.1 #671

merged 5 commits into from
Jan 29, 2024

Conversation

markspanbroek
Copy link
Member

No description provided.

@markspanbroek markspanbroek changed the title update asynctest to 0.5.0 update asynctest to 0.5.1 Jan 10, 2024
Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

LGTM, but why do we need to import chronos/unittest explicitly?

@markspanbroek
Copy link
Member Author

markspanbroek commented Jan 15, 2024

why do we need to import chronos/unittest explicitly

Good question. The asynctest code became rather hard to maintain, because it consisted of code that just happened to be compatible with both chronos and asyncdispatch. This already lead to unwanted warnings in some cases, and became even harder to maintain with the recent chronos changes w.r.t. exceptions. The solution was to have different code for asyncdispatch and chronos, but that requires an explicit choice when importing asynctest (codex-storage/asynctest#11).

@gmega
Copy link
Member

gmega commented Jan 22, 2024

Hey @markspanbroek I ended up folding this into my Chronos V4 branch cause there I actually cannot compile things without this in place. I'm also keeping it up-to-date with the latest master so, if we want, we can bundle this bump with the V4 update.

Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

Lets get this one merged as well, regardless of it being in #673

@gmega
Copy link
Member

gmega commented Jan 22, 2024

Yeah, that's probably wise at any rate as it will make the V4 merge smaller. I'm going to update this and ready it for merge.

@gmega
Copy link
Member

gmega commented Jan 22, 2024

Easy peasy lemon squeezy. 🙂

Copy link
Member

@gmega gmega left a comment

Choose a reason for hiding this comment

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

LGTM!

@dryajov
Copy link
Contributor

dryajov commented Jan 23, 2024

One thing that we should do, is just create a wrapper around the import and import that directly instead of explicitly importing chronos.

@gmega
Copy link
Member

gmega commented Jan 23, 2024

One thing that we should do, is just create a wrapper around the import and import that directly instead of explicitly importing chronos.

You mean to shorten the path? As in a package alias so you don't have to type import pkg/asynctest/chronos/unittest? I can do that, but not sure I prefer having to compute relative import paths in my head (as this would have to go under e.g. /tests/asynctest.nim) over typing a longer-but-always-the-same import line.

@gmega
Copy link
Member

gmega commented Jan 23, 2024

OK, I've updated it to use a wrapper, and it sort of confirms my point: it was an absolute pain to go through 40+ files and figure out the relative import path in each (and IMHO it looks uglier 🙂). I also ran into issues as Nim will import the wrong package if you do import ./asynctest but that relative path happens to be wrong (which doesn't happen when you import the package directly).

But now that it's done, the extra level of indirection will at least make it easier to swap the import in the referred package. I also don't anticipate this will be as painful when updating incrementally.

@markspanbroek
Copy link
Member Author

Github won't let me approve because I started the PR, but feel free to merge at any time @gmega.

@gmega
Copy link
Member

gmega commented Jan 29, 2024

Merging is blocked for me too, @markspanbroek! It requires reviews, perhaps cause I did changes after you. Can you approve, @dryajov or @elcritch?

Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

LGTM

@gmega gmega merged commit fd3c566 into master Jan 29, 2024
8 checks passed
@gmega gmega deleted the update-asynctest branch January 29, 2024 20:03
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.

None yet

3 participants