scrapinghub / shub

Scrapinghub Command Line Client
https://shub.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
125 stars 79 forks source link

Fix deps conversion #422

Closed alexandresgf closed 2 years ago

alexandresgf commented 2 years ago

Since Pipenv v2022.8.30 the function convert_deps_to_pip returns a list of strings containing all the dependencies found in the Pipfile converted to Pip format. So, I added a try/exception statement to catch the TypeError exception, when the previous code tries to open the temporary file, and write the dependencies to the requirements file.

codecov[bot] commented 2 years ago

Codecov Report

Base: 89.43% // Head: 91.01% // Increases project coverage by +1.57% :tada:

Coverage data is based on head (0fefa5e) compared to base (05e1f12). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #422 +/- ## ========================================== + Coverage 89.43% 91.01% +1.57% ========================================== Files 34 28 -6 Lines 2424 1558 -866 ========================================== - Hits 2168 1418 -750 + Misses 256 140 -116 ``` | [Impacted Files](https://codecov.io/gh/scrapinghub/shub/pull/422?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub) | Coverage Δ | | |---|---|---| | [shub/deploy.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi9kZXBsb3kucHk=) | | | | [shub/image/utils.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi9pbWFnZS91dGlscy5weQ==) | | | | [shub/\_\_init\_\_.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi9fX2luaXRfXy5weQ==) | | | | [shub/utils.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi91dGlscy5weQ==) | | | | [shub/image/\_\_init\_\_.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi9pbWFnZS9fX2luaXRfXy5weQ==) | | | | [shub/items.py](https://codecov.io/gh/scrapinghub/shub/pull/422/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c2h1Yi9pdGVtcy5weQ==) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

elacuesta commented 2 years ago

Hi, thanks for the fix. I have a few comments:

alexandresgf commented 2 years ago
  • Could this be tested? I guess it would be enough to add an environment with a different pipenv version, without actually modifying any test cases.

I can mock-up the behavior of both convert_deps_to_pip and write the tests. Is it sounds good?

elacuesta commented 2 years ago

Sounds good to me, thanks!

elacuesta commented 2 years ago

Thanks @alexandresgf :partying_face: