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

DM-40247: Improve webdav interface as suggested by ruff S checks #63

Merged
merged 7 commits into from Aug 21, 2023

Conversation

airnandez
Copy link
Contributor

@airnandez airnandez commented Aug 17, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@airnandez airnandez changed the title DM-40247: Improve code suggested by ruff DM-40247: Improve code as suggested by ruff Aug 17, 2023
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage: 89.18% and project coverage change: +0.05% 🎉

Comparison is base (26d352d) 85.86% compared to head (ba9e496) 85.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   85.86%   85.91%   +0.05%     
==========================================
  Files          27       27              
  Lines        3913     3927      +14     
  Branches      801      805       +4     
==========================================
+ Hits         3360     3374      +14     
  Misses        433      433              
  Partials      120      120              
Files Changed Coverage Δ
python/lsst/resources/http.py 80.87% <84.61%> (+0.27%) ⬆️
tests/test_http.py 94.95% <100.00%> (+0.06%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timj
Copy link
Member

timj commented Aug 18, 2023

To fix the mypy problem add something like to mypy.ini:

[mypy-defusedxml.*]
ignore_missing_imports = True

This PR works with both xml and defusedxml so we do not have to wait on the rubin-env RFC.

Also, there is no reason why we can't add defusedxml as a requirement in the pyproject.toml and requirements.txt now for the pypi release and GitHub actions.

@airnandez
Copy link
Contributor Author

Thanks @timj for your feedback. I added defusedxml to the appropriate files and now all the tests pass.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks.

str(path),
stream=False,
timeout=(
_timeout_from_environment("LSST_HTTP_TIMEOUT_CONNECT", 30.0),
Copy link
Member

Choose a reason for hiding this comment

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

Should we be reading the environment variables here if we are saying that OPTIONS should use a shorter timeout than other activities?

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 thought using the timeout values specified by the user via the environment variables for OPTIONS as well would be better for consistency. In addition, using the environment allows the user to configure the environment for using a potential slow server, as opposed to hardcoding a magic value.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, okay. I was concerned that people might want different values for OPTIONS and other things but if the env var is only used for testing it doesn't matter.

@timj timj changed the title DM-40247: Improve code as suggested by ruff DM-40247: Improve webdav interface as suggested by ruff S checks Aug 21, 2023
@airnandez airnandez merged commit 4bb9eea into main Aug 21, 2023
16 checks passed
@airnandez airnandez deleted the tickets/DM-40247 branch August 21, 2023 16:42
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.

None yet

2 participants