Hi! I encountered this error when upgrading pants:...
# general
f
Hi! I encountered this error when upgrading pants:
Copy code
[WARN] /home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py36/lib/python3.6/site-packages/pex/pep425tags.py:274: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

**** Failed to install importlib_metadata-4.11.3 (caused by: NonZeroExit("received exit code 1 during execution of `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpwfro9psz']` while trying to execute `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpwfro9psz']`",)
):
stdout:

stderr:
Traceback (most recent call last):
  File "<stdin>", line 13, in <module>
IOError: [Errno 2] No such file or directory: 'setup.py'
Thanks @happy-kitchen-89482 for pointing out I should fix the
importlib-metadata
version to
2.1.3
. But I don’t know which package depends on it. How do I pin the version? I added
importlib-metadata==2.1.3
in requirement.txt, but it did not work.
h
What command are you running?
Does Pants bootstrap successfully? (e.g., does
./pants --version
work?)
f
I was running ./pants test …
Yep ./pants --version works
h
OK
Can you run with
--print-exception-stacktrace
and
-ldebug
, to get more debugging info?
f
I cannot tell what is the root cause
h
you're running ./pants binary? what version was it before vs now? i wonder if the version of setuptools changed
h
@freezing-area-97131 what does your `pants.ini`'s
[pytest]
section look like?
I think that might be where we need to pin
importlib_metadata==2.1.3
but that version of Pants is so old I don't really remember the details, would have to look at the code
I'm not sure what is pulling
importlib_metadata-4.11.3
in here, but it's related to installing pytest, looks like
👍 1
f
right now the
[pytest]
in
[pants.ini]
is like this:
Copy code
[pytest]
requirements: pytest>=4.6.6,<4.7
unittest2_requirements = coverage==5.2.1
@hundreds-father-404 I was upgrading one version in a time. Right now is
1.23.0
, previously it was
1.22.0
and it was working fine.
h
Try adding
pytest_plugins = "+['importlib_metadata==2.1.3']"
(I know it's not a plugin, but that is one way to set requirements for pytest, I think)
👍 1
f
oh Great! I changed it to this:
Copy code
[pytest]
pytest_plugins = +["importlib_metadata==2.1.3", "pytest>=4.6.6,<4.7", "coverage==5.2.1"]
And I got a different error message now. I will try figure it out by myself first.
🤞 1
I fixed a few error after that. And I got this but don’t know how to fix. Seems like another python3 syntax issue.
Oh~ I got it. It’s still the same kind of error. I know how to fix that.
🙌 2