https://pantsbuild.org/ logo
#general
Title
# general
h

happy-kitchen-89482

10/02/2019, 11:51 PM
Under
Copy code
[pytest]
in pants.ini?
h

happy-bird-41773

10/03/2019, 5:21 PM
Yes
Copy code
[pytest]
requirements: pytest==3.4.2
h

happy-kitchen-89482

10/03/2019, 9:43 PM
Try adding this, under `[GLOBAL]`:
Copy code
plugins: [
    'attrs==19.1.0',
  ]
Does that work?
h

happy-bird-41773

10/03/2019, 9:44 PM
Lemme undo some of the change I made experimenting and try that out... one sec
That didn't work. When I added to the pants.ini file
Copy code
[GLOBAL]
plugins: [
    'attrs==19.1.0',
]
I got an exception message
Copy code
Exception message: Invalid requirement, parse error at ""'attrs==""
When I fixed that error (by removing the [] and ''), I'm still having the same issue where it's using attrs 19.2.0
h

happy-kitchen-89482

10/03/2019, 10:16 PM
Note the indentation in my post: The closing
]
must be indented two spaces from the left margin. It's an unfortunate insanity of the ini file format.
If that still doesn't work, I have another idea.
h

happy-bird-41773

10/03/2019, 10:19 PM
Heh, yeah that indent got me passed the parse error, but that still doesn't work
h

happy-kitchen-89482

10/03/2019, 11:00 PM
Unfortunately the way we currently specify pytest requirements is not very flexible. However, we can try and hijack a requirements-related option that you probably don't care about.
Just to see if it'll work, try this:
Copy code
[pytest]
requirements: pytest==3.4.2
unittest2_requirements: attrs==19.1.0
The
unittest2_requirements
option is how you could specify a version of
unittest2
, in case your python version required it. But assuming it doesn't, we can hijack it...
We should change the
[pytest]
options to take an arbitrary list of requirement strings, instead of 4x specific single strings.
h

happy-bird-41773

10/03/2019, 11:13 PM
Ahh, sniff test looks like that works! Many thanks for all your help!
h

happy-kitchen-89482

10/03/2019, 11:21 PM
Glad to hear it!
4 Views