Skip to content

Refine Git action for Coverage #662

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

Open
Shaunak01 opened this issue May 5, 2025 · 5 comments
Open

Refine Git action for Coverage #662

Shaunak01 opened this issue May 5, 2025 · 5 comments
Assignees

Comments

@Shaunak01
Copy link
Collaborator

FYI @gpsaggese

@Shaunak01
Copy link
Collaborator Author

PR: #663

@gpsaggese
Copy link
Contributor

PR looks good to me.

  • Let's have also @dremdem review it as resident expert
  • Do we need to update the doc that explains what's the "design" of the coverage system?
    • I.e., the doc should be updated to represent the current status, so that if one reads the doc top to bottom, s/he understands how the entire system works
    • Does it make sense?

@gpsaggese
Copy link
Contributor

Just saw https://github.com/causify-ai/helpers/pull/624/files. Nice job!

@dremdem
Copy link
Contributor

dremdem commented May 8, 2025

@Shaunak01
I faced with the error when trying to build the quand_dashboard prod image:

  File "/app/tasks.py", line 10, in <module>
    from helpers.lib_tasks import (  # This is not an invoke target.
  File "/app/helpers_root/helpers/lib_tasks.py", line 16, in <module>
    from helpers.lib_tasks_docker_release import *  # isort:skip  # noqa: F401,F403 # pylint: disable=unused-import,unused-wildcard-import,wildcard-import
  File "/app/helpers_root/helpers/lib_tasks_docker_release.py", line 21, in <module>
    import helpers.lib_tasks_pytest as hlitapyt
  File "/app/helpers_root/helpers/lib_tasks_pytest.py", line 929, in <module>
    def run_coverage(
  File "/venv/lib/python3.8/site-packages/invoke/tasks.py", line 331, in task
    return klass(args[0], **kwargs)
  File "/venv/lib/python3.8/site-packages/invoke/tasks.py", line 76, in __init__
    self.positional = self.fill_implicit_positionals(positional)
  File "/venv/lib/python3.8/site-packages/invoke/tasks.py", line 167, in fill_implicit_positionals
    args, spec_dict = self.argspec(self.body)
  File "/venv/lib/python3.8/site-packages/invoke/tasks.py", line 153, in argspec
    spec = inspect.getargspec(func)
  File "/usr/lib/python3.8/inspect.py", line 1095, in getargspec
    raise ValueError("Function has keyword-only parameters or annotations"
ValueError: Function has keyword-only parameters or annotations, use inspect.signature() API which can support them

Probably related to:
pyinvoke/invoke#357

Here is related PR:
https://github.com/causify-ai/cmamp/pull/6435/files

This is a tiny fix, just need to get rid of all type hints in the invoke task interface, i.e.:

@task
def run_coverage(
    ctx, suite, target_dir=".", generate_html_report=False
):

If you take a look at another tasks, where is no type hints at all.

Feel free to make one more PR for this issue.

@gpsaggese
Copy link
Contributor

Yes, this is a known issue in pyinvoke. We could switch to click which is better maintained (I've heard)

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

No branches or pull requests

3 participants