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

Fix mypy error on bool expressions #13712

Merged
merged 2 commits into from Apr 12, 2022

Conversation

davelopez
Copy link
Contributor

This will hopefully get rid of the mypy error in test_galaxy_packages on dev.

+ make mypy
mypy galaxy tests
galaxy/util/bool_expressions.py:139: error: Incompatible types in assignment
(expression has type "ParserElement", variable has type "Forward")  [assignment]
            self.boolExpr: Forward = infixNotation(
                                     ^
Found 1 error in 1 file (checked 80 source files)
make: *** [Makefile:96: mypy] Error 1

I'm a bit confused though with which version of mypy are we using across tests. If I run tox -e mypy I don't catch this error, but a different one shows instead...

(.venv) davelopez@davelopez:~/dev/galaxy$ tox -e mypy
mypy installed: attrs==21.4.0,flake8==4.0.1,flake8-bugbear==21.11.29,flake8-import-order==0.18.1,importlib-metadata==4.2.0,mccabe==0.6.1,mypy==0.910,mypy-extensions==0.4.3,pycodestyle==2.8.0,pyflakes==2.4.0,toml==0.10.2,typed-ast==1.4.3,types-bleach==4.1.4,types-boto==2.49.5,types-contextvars==2.4.1,types-cryptography==3.3.11,types-dataclasses==0.6.3,types-docutils==0.17.3,types-enum34==1.1.2,types-ipaddress==1.0.2,types-Markdown==3.3.11,types-paramiko==2.8.7,types-pkg-resources==0.1.3,types-python-dateutil==2.8.5,types-PyYAML==6.0.2,types-requests==2.27.2,types-six==1.16.8,typing_extensions==4.0.1,zipp==3.7.0
mypy run-test-pre: PYTHONHASHSEED='3439307142'
mypy run-test: commands[0] | mypy test lib
lib/galaxy/workflow/modules.py:1901: error: "Dataset" has no attribute "element_identifier"  [attr-defined]
                                replacement.element_identifier = temp.element_identifier  # type: ignore[union-attr]
                                ^
Found 1 error in 1 file (checked 1429 source files)

How to test the changes?

  • This is a refactoring of components with existing test coverage.

License

@davelopez davelopez added the kind/refactoring cleanup or refactoring of existing code, no functional changes label Apr 12, 2022
@github-actions github-actions bot added this to the 22.05 milestone Apr 12, 2022
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
@davelopez
Copy link
Contributor Author

@nsoranzo, do you also get the error above in the description when you run tox -e mypy or is there something wrong with my local setup?

@nsoranzo
Copy link
Member

@nsoranzo nsoranzo merged commit bc0077b into galaxyproject:dev Apr 12, 2022
@davelopez davelopez deleted the fix_bool_expressions_mypy branch April 12, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/util kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants