Under ```[pytest]``` in pants.ini?
# general
h
Under
Copy code
[pytest]
in pants.ini?
h
Yes
Copy code
[pytest]
requirements: pytest==3.4.2
h
Try adding this, under `[GLOBAL]`:
Copy code
plugins: [
    'attrs==19.1.0',
  ]
Does that work?
h
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
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
Heh, yeah that indent got me passed the parse error, but that still doesn't work
h
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
Ahh, sniff test looks like that works! Many thanks for all your help!
h
Glad to hear it!