Skip to content

pytask-latex 0.4.2 produces many warnings when used with pytask 0.4.5 #71

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

Closed
ChristianZimpelmann opened this issue Feb 26, 2024 · 4 comments

Comments

@ChristianZimpelmann
Copy link

ChristianZimpelmann commented Feb 26, 2024

Following the steps in the documentation, I obtain several warnings.

@mark.latex(script=Path("test.tex"), document=Path("test.pdf"))
def task_compile_latex_document():
    pass
    
  • pytask-latex 0.4.2
  • pytask 0.4.5
The warnings
 C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\mark\structures.py:197                                                                         │
│     C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\mark\structures.py:197: FutureWarning: '@pytask.mark.depends_on' is deprecated starting    │
│     pytask v0.4.0 and will be removed in v0.5.0. To upgrade your project to the new syntax, read the tutorial on product and dependencies:               │
│     https://tinyurl.com/pytask-deps-prods.                                                                                                               │
│                                                                                                                                                          │
│       warnings.warn(                                                                                                                                     │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.attributes - is this a typo? You can register custom marks to   │
│     avoid this warning.                                                                                                                                  │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.execute - is this a typo? You can register custom marks to      │
│     avoid this warning.                                                                                                                                  │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1509                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1509: UserWarning: Unknown pytask.mark.execute - is this a typo? You can register custom marks to      │
│     avoid this warning.                                                                                                                                  │
│       getattr(instance, attr) is not None)                                                                                                               │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\mark\structures.py:197                                                                         │
│     C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\mark\structures.py:197: FutureWarning: '@pytask.mark.produces' is deprecated starting      │
│     pytask v0.4.0 and will be removed in v0.5.0. To upgrade your project to the new syntax, read the tutorial on product and dependencies:               │
│     https://tinyurl.com/pytask-deps-prods.                                                                                                               │
│                                                                                                                                                          │
│       warnings.warn(                                                                                                                                     │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.state - is this a typo? You can register custom marks to avoid  │
│     this warning.                                                                                                                                        │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1509                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1509: UserWarning: Unknown pytask.mark.state - is this a typo? You can register custom marks to avoid  │
│     this warning.                                                                                                                                        │
│       getattr(instance, attr) is not None)                                                                                                               │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.signature - is this a typo? You can register custom marks to    │
│     avoid this warning.                                                                                                                                  │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.function - is this a typo? You can register custom marks to     │
│     avoid this warning.                                                                                                                                  │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.markers - is this a typo? You can register custom marks to      │
│     avoid this warning.                                                                                                                                  │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.name - is this a typo? You can register custom marks to avoid   │
│     this warning.                                                                                                                                        │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\typing.py:1506                                                                                                       │
│     C:\.conda\envs\gender_childcare\lib\typing.py:1506: UserWarning: Unknown pytask.mark.report_sections - is this a typo? You can register custom marks │
│     to avoid this warning.                                                                                                                               │
│       if all(hasattr(instance, attr) and                                                                                                                 │
│                                                                                                                                                          │
│ C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\collect.py:245                                                                                 │
│     C:\.conda\envs\gender_childcare\lib\site-packages\_pytask\collect.py:245: UserWarning: Unknown pytask.mark.attr_that_definitely_does_not_exist - is  │
│     this a typo? You can register custom marks to avoid this warning.                                                                                    │
│       if hasattr(obj, attr_name) and not bool(

@tobiasraabe
Copy link
Member

Ok, the last warning is definitely on me. I'm very sorry about that. A lot of the warnings look like a MarkGenerator is being treated as a task.

Do you by any chance use from pytask import mark only in a few places? Do the warnings go away if you switch back to the old import pytask; @pytask.mark....?

@ChristianZimpelmann
Copy link
Author

Thanks!

Do you by any chance use from pytask import mark only in a few places?

Yes, only in one file (the one that defines the tasks to compile latex documents)

Do the warnings go away if you switch back to the old import pytask; @pytask.mark....?

Yes, they go away (only if I also delete from pytask import mark). Also the last warning disappears in that case.

@tobiasraabe
Copy link
Member

I believe I need to fix that in pytask.

@tobiasraabe
Copy link
Member

pytask v0.4.6 is released to PyPI and soon to conda-forge. Happy coding!

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

2 participants