Repository: conda-incubator/grayskull
Pull request #264 (2021-11-16 19:30:25)

generic message
Now that grayskull supports both pypi and github as sources for python packages we need more "generic messages"

I'm not sure if this is OK but I want to start the conversation. Also, it is odd to issue the command:

```
grayskull pypi gh-repo
```

Maybe we could rename that to:

```
grayskull python any-source
```

or short-circuits to `grayskull gh` and `grayskull pypi` if that makes sense.

codecov-commenter: # [Codecov](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#264](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (63c0e5b) into [main](https://codecov.io/gh/conda-incubator/grayskull/commit/9c3242e1667135f34875a6d9e44d53b83ab3d9ba?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (9c3242e) will **decrease** coverage by `0.27%`.
> The diff coverage is `87.91%`.

[![Impacted file tree graph](https://codecov.io/gh/conda-incubator/grayskull/pull/264/graphs/tree.svg?width=650&height=150&src=pr&token=ziE8y5VBkG&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

```diff
@@            Coverage Diff             @@
##             main     #264      +/-   ##
==========================================
- Coverage   91.30%   91.02%   -0.28%     
==========================================
  Files          17       17              
  Lines        1576     1672      +96     
==========================================
+ Hits         1439     1522      +83     
- Misses        137      150      +13     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `91.02% <87.91%> (-0.28%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [setup.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c2V0dXAucHk=) | `0.00% <0.00%> (ø)` | |
| [grayskull/base/base\_recipe.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL2Jhc2UvYmFzZV9yZWNpcGUucHk=) | `88.09% <83.33%> (-0.32%)` | :arrow_down: |
| [grayskull/pypi/pypi.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL3B5cGkvcHlwaS5weQ==) | `94.60% <85.96%> (-1.55%)` | :arrow_down: |
| [grayskull/\_\_main\_\_.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL19fbWFpbl9fLnB5) | `98.21% <100.00%> (+0.06%)` | :arrow_up: |
| [grayskull/cli/parser.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL2NsaS9wYXJzZXIucHk=) | `100.00% <100.00%> (ø)` | |
| [grayskull/utils.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | |
| [grayskull/license/discovery.py](https://codecov.io/gh/conda-incubator/grayskull/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z3JheXNrdWxsL2xpY2Vuc2UvZGlzY292ZXJ5LnB5) | `98.28% <0.00%> (+1.14%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Last update [dd9bb44...63c0e5b](https://codecov.io/gh/conda-incubator/grayskull/pull/264?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).

marcelotrevisani: > Now that grayskull supports both pypi and github as sources for python packages we need more "generic messages"
> 
> I'm not sure if this is OK but I want to start the conversation. Also, it is odd to issue the command:
> 
> ```
> grayskull pypi gh-repo
> ```
> 
> Maybe we could rename that to:
> 
> ```
> grayskull python any-source
> ```
> 
> or short-circuits to `grayskull gh` and `grayskull pypi` if that makes sense.

Yeah, I think would be nice indeed. But we will need to add a warning that the old way is deprecated, and we might support it for a while but after some time we can drop it
Just black failed, can you fix it please? after that we can merge it :)

Patch:
diff --git a/grayskull/__main__.py b/grayskull/__main__.py
index 3d3d148..2fb5f2d 100644
--- a/grayskull/__main__.py
+++ b/grayskull/__main__.py
@@ -128,9 +128,7 @@ def main(args=None):
                 is_strict_cf=args.is_strict_conda_forge,
             )
         except requests.exceptions.HTTPError as err:
-            print_msg(
-                f"{Fore.RED}Package seems to be missing on pypi.\nException: {err}\n\n"
-            )
+            print_msg(f"{Fore.RED}Package seems to be missing.\nException: {err}\n\n")
             continue
         recipe.generate_recipe(args.output, maintainers=args.maintainers)
         print_msg(
diff --git a/grayskull/pypi/pypi.py b/grayskull/pypi/pypi.py
index 9d71576..0191151 100644
--- a/grayskull/pypi/pypi.py
+++ b/grayskull/pypi/pypi.py
@@ -809,7 +809,7 @@ class PyPi(AbstractRecipeModel):
         metadata = requests.get(url=url_pypi, timeout=5)
         if metadata.status_code != 200:
             raise requests.HTTPError(
-                f"It was not possible to recover PyPi metadata for {name}.\n"
+                f"It was not possible to recover package metadata for {name}.\n"
                 f"Error code: {metadata.status_code}"
             )
 


Test patch:
diff --git a/tests/cli/test_cli_cmds.py b/tests/cli/test_cli_cmds.py
index 23ca096..c9f36f5 100644
--- a/tests/cli/test_cli_cmds.py
+++ b/tests/cli/test_cli_cmds.py
@@ -46,8 +46,8 @@ def test_msg_missing_pkg_pypi(capsys):
     main(["pypi", "NOT_A_PACKAGE_123123123"])
     captured = capsys.readouterr()
     assert (
-        "Package seems to be missing on pypi."
-        "\nException: It was not possible to recover PyPi metadata"
+        "Package seems to be missing."
+        "\nException: It was not possible to recover package metadata"
         " for NOT_A_PACKAGE_123123123.\n"
         "Error code: 404" in captured.out
     )