8000 Meg interest calculator by pauleveritt · Pull Request #31 · pyscript/pyscript-collective · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Meg interest calculator #31

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

Merged
merged 12 commits into from
Nov 19, 2022
Merged

Meg interest calculator #31

merged 12 commits into from
Nov 19, 2022

Conversation

pauleveritt
Copy link
Contributor

Here's is a draft of the work I've done while processing the first PR for an example. It also includes a few of the examples in PyScript main.

It currently fails in my mocking of document. It's a good place for Fabio Rosado and I to start talking.

Copy link
Collaborator
@FabioRosado FabioRosado left a comment

Choose a reason for hiding this comment

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

Thanks for pushing this Paul! I had a quick look in the morning and finally got some time to go through it.

I've added a bunch of comments/suggestions, not sure if you want to add them all or if we should do it as a follow up? 🤔 I can also push them if you would like

TODO.md Outdated
## Eventually

- Get nox to work with downloaded pyodide/pyscript
- Get rid of Poetry
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most just asking - are you planning on using something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm up for listening to your POV. We can stick to Poetry. We can go back to just pip, perhaps with some pip extras. Or something else, as long as it doesn't put up a barrier for contribution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to have users create a single env for this, personally I enjoy using conda with poetry but that might be too confusing for someone just starting. Simple pip could work and it would lower the entry barrier since folks won't need to learn a new tool that they might not know about

codecov.yaml Outdated
status:
project:
default:
target: "100"
Copy link
Collaborator

Choose a reason for hiding this comment

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

In another project I maintain we aim for 100% but sometimes this can be a bit hard to achieve, any opinions about going for maybe 98-99?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is going to be a good conversation, perhaps in a ticket or discussions. There's coverage in the PSC itself, then there's coverage in examples. So my first question: do you want the same number for both? Or do you view them as different vis a vis coverage goals?

@@ -1,8 +1,8 @@
"""Provide a web server to browse the examples."""
import contextlib
from collections.abc import Iterator
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a really good catch. I always get this wrong. I probably should write some flake8 extension that complains. 😀

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is specifically to latest python versions right?
I was used to do from typings import blah haha

@@ -90,7 +90,7 @@ def test_html_page() -> None:
"""Make an instance of a .html Page resource and test it."""
this_page = Page(path=PurePath("contributing"))
assert this_page.title == "Contributing"
assert this_page.subtitle == "How to get involved in the PyCharm Collective."
assert this_page.subtitle == "How to get involved in the PyScript Collective."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New rule: Every time I do this, I owe you $20.



def test_fake_element_find_element(fake_document, fake_element) -> None:
def test_fake_element_find_element(fake_document: FakeDocument, fake_element: function) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's your feeling on my commitment to typing? Too much?

My plan is: actual examples don't have to use typing. Perhaps even - never use typing. But the PSC itself does aim for good typing coverage.

Copy link
Collaborator

Choose a reason for hiding this comment

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

These are the type of issues I still need to see if I can make mypy happy.
In general I am in favor of typing, but I think in a lot of cases we will have mypy break for examples when we do Element it complains that its not defined.

Your idea is great, keeping the examples easy to follow for new folks is great and enforcing typing there will make things more complicated 😄

Element # noqa


def test_fake_element_installed(fake_element: function) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You annotated with function. Perhaps you meant Callable with the right params?

from psc.here import STATIC


Element = cast("Unknown", "Element")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The addition of this line causes some tests to fail, as Element should only exist in tests that ask for the fake_element fixture.

@pauleveritt pauleveritt marked this pull request as ready for review November 19, 2022 14:04
@pauleveritt pauleveritt merged commit 6e31573 into main Nov 19, 2022
@pauleveritt pauleveritt deleted the meg-interest-calculator branch November 19, 2022 14:05
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
0