<div dir="ltr">I don't work with the CLI, but I have seen projects declare a dependency on setuptools. That would make sense to me.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 15, 2021 at 6:12 AM Konstantin M. Khankin <<a href="mailto:khankin.konstantin@gmail.com">khankin.konstantin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Matthias!<div><br></div><div>This workaround is sufficient for me. However, I feel like the dependency should be added, yes. I don't have (and wouldn't want to have) GitHub account, so I can't file a PR or an issue, sorry. Not going to ask you to do this as I'm fine with a workaround :)</div><div><br></div><div>Thanks!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 15 дек. 2021 г. в 13:01, Matthias Dellweg <<a href="mailto:mdellweg@redhat.com" target="_blank">mdellweg@redhat.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
Thank you for verifying this. Is this workaround sufficient for you?<br>
Should we still add a dependency on setuptools (It kind of felt<br>
implicit, because you cannot use setup.py without it anyway.)? If so,<br>
can you file a PR for it?<br>
<br>
  Matthias<br>
<br>
On Wed, Dec 15, 2021 at 11:56 AM Konstantin M. Khankin<br>
<<a href="mailto:khankin.konstantin@gmail.com" target="_blank">khankin.konstantin@gmail.com</a>> wrote:<br>
><br>
> Validated PEX build fails because of missing dependency with this workaround:<br>
><br>
> $ echo setuptools > pulp_cli.req<br>
> $ pex -r pulp_cli.req -v -c pulp -o pulp.pex 'pulp-cli[pygments]'<br>
> $ deactivate<br>
> $ ./pulp.pex --version<br>
> pulp3 command line interface, version 0.12.0<br>
><br>
> ср, 15 дек. 2021 г. в 12:43, Konstantin M. Khankin <<a href="mailto:khankin.konstantin@gmail.com" target="_blank">khankin.konstantin@gmail.com</a>>:<br>
>><br>
>> Hello!<br>
>><br>
>> I wanted to make pulp-cli portable and build PEX archive out of it but the latest pex (2.1.56) fails to do so:<br>
>><br>
>> ```<br>
>> $ pex -v -c pulp 'pulp-cli[pygments]'<br>
>> ...<br>
>> Running PEX file at /tmp/tmpdy35exye with args []<br>
>> pex: PEX.run invoking /home/hc/pex/bin/python3 -s -E /tmp/tmpdy35exye<br>
>> pex: Re-executing: cmdline='/usr/bin/python3.10 /tmp/tmpdy35exye', sys.executable='/home/hc/pex/bin/python3', PEX_PYTHON=None, PEX_PYTHON_PATH=None, interpreter_constraints=[]<br>
>> pex: Found site-library: /usr/local/lib/python3.10/site-packages<br>
>> pex: Found site-library: /usr/lib/python3.10/site-packages<br>
>> pex: Found site-library: /usr/local/lib64/python3.10/site-packages<br>
>> pex: Found site-library: /usr/lib64/python3.10/site-packages<br>
>> pex: Tainted path element: /usr/lib64/python3.10/site-packages<br>
>> pex: Tainted path element: /usr/lib/python3.10/site-packages<br>
>> pex: Scrubbing from user site: /home/hc/.local/lib/python3.10/site-packages<br>
>> pex: Scrubbing from site-packages: /usr/lib64/python3.10/site-packages<br>
>> pex: Scrubbing from site-packages: /usr/lib/python3.10/site-packages<br>
>> pex: New sys.path: ['/tmp/tmpdy35exye/.bootstrap', '/tmp/tmpdy35exye', '/usr/lib64/python310.zip', '/usr/lib64/python3.10', '/usr/lib64/python3.10/lib-dynload']<br>
>> pex: Activating PEX virtual environment from /tmp/tmpdy35exye: 54.7ms<br>
>> pex: Bootstrap complete, performing final sys.path modifications...<br>
>> pex: PYTHONPATH contains:<br>
>> pex:     /tmp/tmpdy35exye<br>
>> pex:   * /usr/lib64/python310.zip<br>
>> pex:     /usr/lib64/python3.10<br>
>> pex:     /usr/lib64/python3.10/lib-dynload<br>
>> pex:     /home/hc/.pex/installed_wheels/7679cb4a5378680b93c1f33b463094a55cf8c547/pulp_cli-0.12.0-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/23fff3a23c744ec73d03f9639bec17d3745b762c/click-8.0.3-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/bc1215388f22b27f973bc1bc3d74a96373404ac9/packaging-21.3-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/33b6478f39bfd332868d887340fd44164373dfb4/pyparsing-3.0.6-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/5aa8517e7212729e4c0b95fab8b765c01e48f97c/PyYAML-5.4.1-cp310-cp310-linux_x86_64.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/cd6d3dfd86e52a31a3664cff69214a5dd94161e7/schema-0.7.4-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/c29688d87604522b7f9aa8a178a6a21b6a9fe775/contextlib2-21.6.0-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/d20e2df000dd43249c3a9eed041f08a812a93423/requests-2.26.0-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/601e0a29cd7d663eb8ea40c3ba7a52200e2544c0/urllib3-1.26.7-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/883fca1b3199ac78822a54c4af0a01c1f7a7ea74/certifi-2021.10.8-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/7e4deb9e3d26e447cfdd8c00b13805d8d2a65fca/charset_normalizer-2.0.9-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/5485a373e7aae71ef1d2c02b8b09c330b75c5248/idna-3.3-py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/a55ae166e643e6c7a28c16fe005efc32ee98ee76/toml-0.10.2-py2.py3-none-any.whl<br>
>> pex:     /home/hc/.pex/installed_wheels/8dd8170137ab3f4dc94d5006227635731b451dd1/Pygments-2.10.0-py3-none-any.whl<br>
>> pex:     /tmp/tmpdy35exye/.bootstrap<br>
>> pex:   * - paths that do not exist or will be imported via zipimport<br>
>> Traceback (most recent call last):<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 476, in execute<br>
>>     exit_value = self._wrap_coverage(self._wrap_profiling, self._execute)<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 401, in _wrap_coverage<br>
>>     return runner(*args)<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 432, in _wrap_profiling<br>
>>     return runner(*args)<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 532, in _execute<br>
>>     return self.execute_entry(self._pex_info.entry_point)<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 668, in execute_entry<br>
>>     return self.execute_pkg_resources(entry_point)<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/pex.py", line 699, in execute_pkg_resources<br>
>>     runner = entry.resolve()<br>
>>   File "/tmp/tmpdy35exye/.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/__init__.py", line 2481, in resolve<br>
>>     module = __import__(self.module_name, fromlist=['__name__'], level=0)<br>
>>   File "/home/hc/.pex/installed_wheels/7679cb4a5378680b93c1f33b463094a55cf8c547/pulp_cli-0.12.0-py3-none-any.whl/pulpcore/cli/common/__init__.py", line 7, in <module><br>
>>     import pkg_resources<br>
>> ModuleNotFoundError: No module named 'pkg_resources'<br>
>> ```<br>
>><br>
>> As I understand, this happens because setup.py does not explicitly declare a dependency on setuptools (which contains pkg_resources unlike the packaging lib). If that's correct, could you add the dependency please? If not, do you know what can be the issue here?<br>
>><br>
>> Also, it seems to me pkg_resources is only used to load CLI plugins here. However, the document which this code mentions does not include any mentions of pkg_resources. Can it be that a better fix here is to update the plugin loading function?<br>
>><br>
>> Thanks!<br>
>><br>
>> --<br>
>> Konstantin Khankin<br>
><br>
><br>
><br>
> --<br>
> Ханкин Константин<br>
> _______________________________________________<br>
> Pulp-list mailing list<br>
> <a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
> <a href="https://listman.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/pulp-list</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">Ханкин Константин<br></div>
_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
<a href="https://listman.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/pulp-list</a></blockquote></div>