Skip to content

Bugfix: Fetch should not force use of curl to check url existence#34225

Merged
alalazo merged 2 commits intospack:developfrom
tldahlgren:bugfix-no-curl-for-exists
Dec 2, 2022
Merged

Bugfix: Fetch should not force use of curl to check url existence#34225
alalazo merged 2 commits intospack:developfrom
tldahlgren:bugfix-no-curl-for-exists

Conversation

@tldahlgren
Copy link
Copy Markdown
Contributor

This PR does not force fetch to use curl to check URL existence.

Bug was introduced in #29026 as discussed in #29026 (comment).

@spackbot-app spackbot-app bot added core PR affects Spack core functionality fetching labels Nov 30, 2022
@tldahlgren
Copy link
Copy Markdown
Contributor Author

@alalazo @trws What fun! flake8 doesn't like the typing imports:

==> Error: spack style found errors
[30](https://github.com/spack/spack/actions/runs/3587158973/jobs/6037191189#step:6:31)
lib/spack/spack/fetch_strategy.py:33: [F401] 'typing.List' imported but unused
[31](https://github.com/spack/spack/actions/runs/3587158973/jobs/6037191189#step:6:32)
lib/spack/spack/fetch_strategy.py:33: [F401] 'typing.Optional' imported but unused

@trws
Copy link
Copy Markdown
Contributor

trws commented Nov 30, 2022

Thankfully now that we don't have to deal with ancient, pre-typing, python those are a pretty easy fix. Make the type-hint a type-hint rather than a comment and it should pass.

@tldahlgren
Copy link
Copy Markdown
Contributor Author

@alalazo @trws Looks like project coverage dropped due to "indirect coverage changes".

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 1, 2022

I don't think coverage is essential here. What we may have dropped are just the lines in self.curl, or am I missing anything?

@tldahlgren
Copy link
Copy Markdown
Contributor Author

tldahlgren commented Dec 1, 2022

I don't think coverage is essential here. What we may have dropped are just the lines in self.curl, or am I missing anything?

I don't think you missed anything. The value for that arg defaults to None is not provided so I just dropped it.

I suppose I could add a test of that method -- preferably mocking which -- to see if that helps with coverage. Although I didn't look closely at all of the indirect coverage changes (once I was able to see them), I didn't quite follow how dropping that method call mattered.

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

2 for mypy and one for the bug! (Thanks Tammy!)

@alalazo alalazo enabled auto-merge (squash) December 1, 2022 17:40
@tldahlgren
Copy link
Copy Markdown
Contributor Author

2 for mypy and one for the bug! (Thanks Tammy!)

I grep'd for places where curl is used and, AFAICT, the rest were gated by the configuration parameter. So yes, a one line fix as you'd pointed out.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 2, 2022

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Dec 2, 2022

I've started that pipeline for you!

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Dec 2, 2022

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Dec 2, 2022

I've started that pipeline for you!

@alalazo alalazo merged commit 18efd81 into spack:develop Dec 2, 2022
@tldahlgren
Copy link
Copy Markdown
Contributor Author

@alalazo Thank you!

luke-dt pushed a commit to dantaslab/spack that referenced this pull request Dec 5, 2022
…ack#34225)

* Bugfix: Fetch should not force use of curl to check url existence

* Switch type hints from comments to actual hints
amd-toolchain-support pushed a commit to amd-toolchain-support/spack that referenced this pull request Feb 16, 2023
…ack#34225)

* Bugfix: Fetch should not force use of curl to check url existence

* Switch type hints from comments to actual hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality fetching

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants