Skip to content

Update pre commit hooks #124

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 2 commits into from
Nov 30, 2022
Merged

Conversation

kurtmckee
Copy link
Contributor

Description:

This upgrades the black and mypy hook versions.

Note that flake8 is upgraded separately in #123.

The mypy change introduced the following errors, which are now addressed by adding the --explicit-package-bases argument to the mypy invocation:

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/datetime_utils.py: error: Source file found twice under different module names: "elasticsearch.datetime_utils" and "stac_fastapi.elasticsearch.datetime_utils"
stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/datetime_utils.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/datetime_utils.py: note: Common resolutions include: a) adding `__init__.py` somewhere, b) using `--explicit-package-bases` or adjusting MYPYPATH

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the changelog

@jonhealy1 jonhealy1 self-requested a review November 30, 2022 07:19
Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

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

Hi Kurt. Looks great. Can you merge main into this branch so that the test pass? It's probably just the gitlab -> github thing. Thank you

@kurtmckee kurtmckee force-pushed the update-pre-commit-hooks branch from 0527bae to c6b3869 Compare November 30, 2022 14:36
@kurtmckee
Copy link
Contributor Author

kurtmckee commented Nov 30, 2022

I rebased on main so the git history is clean.

...it looks like there was an HTTPS error in the test suite while attempting to connect to elastic.co, sigh. I'll try to force the tests to re-run by force pushing again.

Update: The elastic.co HTTPS error was transient, and the tests are now passing.

The `--explicit-package-bases` is one of two solutions.
The other is to add `__init__.py` files to various directories,
but longer term it might be better to change the repo directory structure.
@kurtmckee kurtmckee force-pushed the update-pre-commit-hooks branch from c6b3869 to ad8de4b Compare November 30, 2022 14:40
@jonhealy1 jonhealy1 self-requested a review November 30, 2022 14:52
@jonhealy1 jonhealy1 merged commit b8f7f72 into stac-utils:main Nov 30, 2022
@kurtmckee kurtmckee deleted the update-pre-commit-hooks branch November 30, 2022 15:23
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