echoing-manchester-70122
05/28/2020, 8:45 PMhundreds-father-404
05/28/2020, 8:47 PM./pants test
?
Also, what Pants version are you on? (./pants --version
)echoing-manchester-70122
05/28/2020, 8:47 PMechoing-manchester-70122
05/28/2020, 8:47 PMechoing-manchester-70122
05/28/2020, 8:48 PMechoing-manchester-70122
05/28/2020, 8:48 PMechoing-manchester-70122
05/28/2020, 8:48 PMhundreds-father-404
05/28/2020, 8:52 PMSo we’re running into the setuptools “bug”What is the bug?
hundreds-father-404
05/28/2020, 8:53 PMechoing-manchester-70122
05/28/2020, 8:58 PMException caught: (pex.resolver.Untranslateable) (backtrace omitted)
Exception message: Package SourcePackage('file:///mnt/workspace/.pants.d/python-setup/resolved_requirements/CPython-2.7.17/setuptools-47.1.0.zip') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)
echoing-manchester-70122
05/28/2020, 8:58 PMstderr:
pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
************************************************************
Encountered a version of Setuptools that no longer supports
this version of Python. Please head to
<https://bit.ly/setuptools-py2-sunset> for support.
************************************************************
echoing-manchester-70122
05/28/2020, 8:59 PMhundreds-father-404
05/28/2020, 8:59 PMsetuptools_version
in both the [python-setup]
and [pex-build-wrapper]
scopes.echoing-manchester-70122
05/28/2020, 9:00 PMechoing-manchester-70122
05/28/2020, 9:00 PMhundreds-father-404
05/28/2020, 9:02 PMhundreds-father-404
05/28/2020, 9:02 PMechoing-manchester-70122
05/28/2020, 9:02 PMhundreds-father-404
05/28/2020, 9:02 PMechoing-manchester-70122
05/28/2020, 9:03 PMhundreds-father-404
05/28/2020, 9:15 PMhundreds-father-404
05/28/2020, 9:16 PMhundreds-father-404
05/28/2020, 9:17 PM./pants test project/app.py
, rather than needing to use a target addressenough-analyst-54434
05/28/2020, 9:23 PMenough-analyst-54434
05/28/2020, 9:24 PMSetuptools is already pinned to <45What mechanism are you using to do this?
echoing-manchester-70122
05/28/2020, 9:24 PMechoing-manchester-70122
05/28/2020, 9:24 PMenough-analyst-54434
05/28/2020, 9:25 PMtest
or run
or some other goal?echoing-manchester-70122
05/28/2020, 9:25 PMenough-analyst-54434
05/28/2020, 9:26 PMechoing-manchester-70122
05/28/2020, 9:29 PMis the default,>3.6, <4
echoing-manchester-70122
05/28/2020, 9:30 PMechoing-manchester-70122
05/28/2020, 9:30 PM>2.7, <3
enough-analyst-54434
05/28/2020, 9:30 PMechoing-manchester-70122
05/28/2020, 9:30 PMechoing-manchester-70122
05/28/2020, 9:30 PMechoing-manchester-70122
05/28/2020, 9:30 PMenough-analyst-54434
05/28/2020, 9:31 PMechoing-manchester-70122
05/28/2020, 9:31 PMenough-analyst-54434
05/28/2020, 9:31 PMenough-analyst-54434
05/28/2020, 9:35 PM.pants.d/python-setup/resolved_requirements/CPython-2.7.17/setuptools-47.1.0.zip
Says the phase in the test goal is resolution of requirements for the test targets themselves. That implies none of the test targets has a direct dependency on your requirements.txt / BUILD pinning of setuptools under 45.echoing-manchester-70122
05/28/2020, 9:36 PMenough-analyst-54434
05/28/2020, 9:36 PM$ ./pants dependencies src/python/pants/base: 2>/dev/null | grep 3rdparty/
3rdparty/python:pathspec
3rdparty/python:setproctitle
3rdparty/python:pystache
3rdparty/python:typing-extensions
3rdparty/python:dataclasses
3rdparty/python/twitter/commons:twitter.common.dirutil
Here substitute the targets you pass to test for src/python/pants/base:
and change the grep to match wherever your requirements.txt / BUILD live.echoing-manchester-70122
05/28/2020, 9:37 PM./pants dependees
right?enough-analyst-54434
05/28/2020, 9:38 PMdependencies
echoing-manchester-70122
05/28/2020, 9:38 PM./pants dependencies src/test/python/.../cloudwatch_to_tsd::
Unknown goals: dependencies
enough-analyst-54434
05/28/2020, 9:43 PM./pants depmap --minimal --internal-only src/python/pants/base: | grep 3rdparty | grep setuptools
hundreds-father-404
05/28/2020, 9:45 PMdependencies
in 2014. Possibly it’s not activated?
You’ll want to add pants.backend.project_info
to the backend_packages
option in the [GLOBAL]
scope. It should be activated by default, but maybe got deactivated?echoing-manchester-70122
05/28/2020, 9:47 PM./pants dependencies src/test/python/p/cloudwatch_to_tsd::
src/test/python/p/cloudwatch_to_tsd:cloudwatch_to_tsd
3rdparty/python:moto
moto==0.4.27
3rdparty/python:requirements.txt
src/main/python/p/cloudwatch_to_tsd:cloudwatch_to_tsd
src/main/python/p/cloudwatch_to_tsd:_cloudwatch_to_tsd
3rdparty/python:boto3
boto3==1.11.3
3rdparty/python:brood
brood==0.3.2
3rdparty/python:pyknox
pyknox==0.3.4
3rdparty/python:schedule
schedule==0.4.2
3rdparty/python:pinstatsd
pinstatsd==1.4.2
3rdparty/python:metrics-agent
metrics-agent==0.4.67
3rdparty/python:setuptools
setuptools<45
echoing-manchester-70122
05/28/2020, 9:50 PMenough-analyst-54434
05/28/2020, 9:50 PMechoing-manchester-70122
05/28/2020, 9:50 PMenough-analyst-54434
05/28/2020, 9:52 PMechoing-manchester-70122
05/28/2020, 9:52 PMenough-analyst-54434
05/28/2020, 9:52 PMenough-analyst-54434
05/28/2020, 9:52 PMenough-analyst-54434
05/28/2020, 9:52 PMenough-analyst-54434
05/28/2020, 9:54 PMechoing-manchester-70122
05/28/2020, 9:54 PMechoing-manchester-70122
05/28/2020, 9:54 PMenough-analyst-54434
05/28/2020, 9:56 PMechoing-manchester-70122
05/28/2020, 9:56 PMenough-analyst-54434
05/28/2020, 10:05 PM[pytest] requirements
option instead. If you don't have that in your pants.ini, please add:
[pytest]
requirements: ["pytest>=3.0.7,<3.7", "setuptools<45"]
The remove your BUILD addition of a setuptools<45 dependency and re-run the tests. Before the re-run you'll need to clean-all unfortantely. It looks like that option is not marked to invalidate things in Pants 1.16.echoing-manchester-70122
05/28/2020, 10:06 PMechoing-manchester-70122
05/28/2020, 10:06 PMenough-analyst-54434
05/28/2020, 10:06 PM[GLOBAL]
plugins: ["pex==1.6.12"]
echoing-manchester-70122
05/28/2020, 10:08 PM$ ./pants test src/test/python/.../cloudwatch_to_tsd::
22:07:51 [INFO] Resolving new plugins...:
pex==1.6.12
pantsbuild.pants.contrib.python.checks==1.16.0
timestamp: 2020-05-28T22:07:51.701232
Exception caught: (pex.resolver.Unsatisfiable) (backtrace omitted)
Exception message: Could not satisfy all requirements for pex==1.6.12:
pex==1.6.12, pex==1.6.7(from: pantsbuild.pants.contrib.python.checks==1.16.0)
enough-analyst-54434
05/28/2020, 10:08 PMechoing-manchester-70122
05/28/2020, 10:08 PMhundreds-father-404
05/28/2020, 10:09 PMenough-analyst-54434
05/28/2020, 10:11 PMhundreds-father-404
05/28/2020, 10:11 PMechoing-manchester-70122
05/28/2020, 10:11 PMhundreds-father-404
05/28/2020, 10:12 PMhundreds-father-404
05/28/2020, 10:13 PMnow I am running into this stupid apt_pkg bugWhat’s this one?
enough-analyst-54434
05/28/2020, 10:13 PM$ git describe b720e6937a7a3cbaa5b28bbbfdb5bb4d2310ab70
release_1.22.0rc0-1-gb720e6937
enough-analyst-54434
05/28/2020, 10:14 PMenough-analyst-54434
05/28/2020, 10:14 PMechoing-manchester-70122
05/28/2020, 10:14 PMTraceback (most recent call last):
File "/home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-16.4.3/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
echoing-manchester-70122
05/28/2020, 10:14 PMechoing-manchester-70122
05/28/2020, 10:14 PMechoing-manchester-70122
05/28/2020, 10:15 PM$ ./pants
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 122 100 122 0 0 10166 0 --:--:-- --:--:-- --:--:-- 10166
100 281 100 281 0 0 5978 0 --:--:-- --:--:-- --:--:-- 5978
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3626k 100 3626k 0 0 22.9M 0 --:--:-- --:--:-- --:--:-- 49.6M
Traceback (most recent call last):
File "/home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-16.4.3/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
./pants: line 170: /home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/pants.v1BtqB/install/bin/pip: No such file or directory
./pants: line 171: /home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/pants.v1BtqB/install/bin/pip: No such file or directory
New virtual environment successfully created at /home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py38.
./pants: line 193: /home/amckenna/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py38/bin/python: No such file or directory
enough-analyst-54434
05/28/2020, 10:16 PMhundreds-father-404
05/28/2020, 10:16 PMsudo apt install python3-distutils -y
(disclosure: first thing I found on google)echoing-manchester-70122
05/28/2020, 10:16 PM$ python3
Python 3.7.5 (default, Nov 7 2019, 10:50:52)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.spawn
>>>
echoing-manchester-70122
05/28/2020, 10:16 PMechoing-manchester-70122
05/28/2020, 10:17 PMechoing-manchester-70122
05/28/2020, 10:17 PMhundreds-father-404
05/28/2020, 10:18 PM./pants
script to put Py38 behind Py37. If you use the latest ./pants
script, we do this already: https://github.com/pantsbuild/setup/blob/gh-pages/pants#L110echoing-manchester-70122
05/28/2020, 10:32 PMERROR: Invalid requirement, parse error at "'["pytest'"
echoing-manchester-70122
05/28/2020, 10:32 PM**** Failed to install configparser-5.0.0 (caused by: NonZeroExit("received exit code 1 during execution of `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpy_m190mb']` while trying to execute `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpy_m190mb']`")
):
stdout:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/configparser.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/backports
copying src/backports/__init__.py -> build/lib.linux-x86_64-2.7/backports
creating build/lib.linux-x86_64-2.7/backports/configparser
copying src/backports/configparser/helpers.py -> build/lib.linux-x86_64-2.7/backports/configparser
copying src/backports/configparser/__init__.py -> build/lib.linux-x86_64-2.7/backports/configparser
running egg_info
stderr:
error: 'egg_base' must be a directory name (got `src`)
enough-analyst-54434
05/28/2020, 10:36 PMRROR: Invalid requirement, parse error at "'["pytest'"
coming from? Can you paste the exact snippet you removed? Is that from a pants.ini entry addition described above?echoing-manchester-70122
05/28/2020, 10:37 PMechoing-manchester-70122
05/28/2020, 10:37 PM[pytest]
timeout_requirements: pytest-timeout==1.2.0
requirements: ["pytest<3.7,>=3.0.7", "setuptools<45"]
cov_requirements: pytest-cov==2.4.0
enough-analyst-54434
05/28/2020, 10:39 PMenough-analyst-54434
05/28/2020, 10:39 PMhundreds-father-404
05/28/2020, 10:40 PMunittest2
hundreds-father-404
05/28/2020, 10:40 PMenough-analyst-54434
05/28/2020, 10:40 PMechoing-manchester-70122
05/28/2020, 10:40 PMechoing-manchester-70122
05/28/2020, 10:41 PMException message: Package SourcePackage('file:///mnt/efs-home/amckenna/code/python-commons/.pants.d/python-setup/resolved_requirements/CPython-2.7.15/configparser-5.0.0.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)
hundreds-father-404
05/28/2020, 10:41 PMpytest_plugins
. https://github.com/pantsbuild/pants/blob/e162626f79020da3e4b8b3e7b9b202ff50bb7169/src/python/pants/backend/python/subsystems/pytest.py#L17-L27hundreds-father-404
05/28/2020, 10:42 PM[pytest]
pytest_plugins = +["setuptools<45"]
enough-analyst-54434
05/28/2020, 10:42 PMhundreds-father-404
05/28/2020, 10:42 PMechoing-manchester-70122
05/28/2020, 10:43 PMhundreds-father-404
05/28/2020, 10:44 PMhundreds-father-404
05/28/2020, 10:44 PM=
because that’s what TOML usesechoing-manchester-70122
05/28/2020, 10:48 PM[pytest]
version: >=3.0.7,<3.7
pytest_plugins: +["setuptools<45"]
echoing-manchester-70122
05/28/2020, 10:48 PMhundreds-father-404
05/28/2020, 10:48 PMpytest_plugins
echoing-manchester-70122
05/28/2020, 10:53 PM[pytest]
version: pytest>=4.6.6,<4.7
pytest_plugins: +["setuptools<45"]
echoing-manchester-70122
05/28/2020, 10:54 PMhundreds-father-404
05/28/2020, 10:55 PMany way to turn off the .whl dump?What do you mean?
echoing-manchester-70122
05/28/2020, 10:55 PMDumping distribution: .../moto-0.4.27-py2.py3-none-any.whl
Dumping distribution: .../boto3-1.11.3-py2.py3-none-any.whl
echoing-manchester-70122
05/28/2020, 10:58 PMechoing-manchester-70122
05/28/2020, 10:58 PM22:57:20 00:22 [run]
Failed to execute PEX file, missing linux_x86_64-cp-27-cp27mu compatible dependencies for:
importlib-metadata
zipp
22:57:23 00:25 [coverage-html]
Failed to execute PEX file, missing linux_x86_64-cp-27-cp27mu compatible dependencies for:
importlib-metadata
zipp
22:57:24 00:26 [coverage-xml]
Failed to execute PEX file, missing linux_x86_64-cp-27-cp27mu compatible dependencies for:
importlib-metadata
zipp
22:57:24 [DEBUG] pants.base.project_tree:pid=23020: ProjectTree ignore_patterns: None
echoing-manchester-70122
05/28/2020, 10:58 PMhundreds-father-404
05/28/2020, 10:59 PM[test]
block of Pants output or something like [gen]
?echoing-manchester-70122
05/28/2020, 11:02 PM-ldebug
echoing-manchester-70122
05/28/2020, 11:03 PMechoing-manchester-70122
05/28/2020, 11:03 PMechoing-manchester-70122
05/28/2020, 11:03 PM23:02:39 00:01 [cache]
No cached artifacts for 8 targets.
Invalidated 8 targets.
Dumping requirement: PythonRequirement(moto==0.4.27)
Dumping requirement: PythonRequirement(boto3==1.11.3)
Dumping requirement: PythonRequirement(brood==0.3.2)
Dumping requirement: PythonRequirement(pyknox==0.3.4)
Dumping requirement: PythonRequirement(schedule==0.4.2)
Dumping requirement: PythonRequirement(pinstatsd==1.4.2)
Dumping requirement: PythonRequirement(metrics-agent==0.4.67)
Dumping requirement: PythonRequirement(setuptools<45)
echoing-manchester-70122
05/28/2020, 11:07 PMechoing-manchester-70122
05/28/2020, 11:09 PMechoing-manchester-70122
05/28/2020, 11:09 PMhundreds-father-404
05/28/2020, 11:12 PMechoing-manchester-70122
05/28/2020, 11:17 PMechoing-manchester-70122
05/28/2020, 11:18 PM[pytest]
version: pytest>=4.6.6,<4.7
pytest_plugins: +["setuptools<45; python_version < '3'","configparser==4.0.2; python_version < '3'","zipp<2; python_version < '3'","importlib-metadata<1.6; python_version < '3'"]
echoing-manchester-70122
05/28/2020, 11:27 PMhundreds-father-404
05/28/2020, 11:32 PMpython.checks
gets deprecated in favor of Flake8. python.checks
was a weird custom version of Flake8 with fewer checks and without support for Flake8 plugins. See https://pants.readme.io/docs/python-linters-and-formatters for how to activate Flake8echoing-manchester-70122
05/28/2020, 11:33 PMechoing-manchester-70122
05/28/2020, 11:33 PMhundreds-father-404
05/28/2020, 11:34 PM--pytest-args='-v'
, or in your pants.ini, args
option in the [pytest]
scope. You can still use ./pants test blah -- -v
too, contrary to the deprecation warning. See https://pants.readme.io/docs/upgrade-tips#ignore-deprecation-messages-with-ignore_pants_warnings for how to ignore the deprecation warninghundreds-father-404
05/28/2020, 11:36 PM--pytest-args
is an improvement in that it will “shlex” the strings for you. You can do this:
./pants test project:tests --pytest-args='-vv -k test_demo'
echoing-manchester-70122
05/28/2020, 11:36 PMechoing-manchester-70122
05/28/2020, 11:36 PMhundreds-father-404
05/28/2020, 11:38 PMechoing-manchester-70122
05/28/2020, 11:39 PMhundreds-father-404
05/28/2020, 11:42 PMhundreds-father-404
05/28/2020, 11:43 PMechoing-manchester-70122
05/28/2020, 11:44 PM