Last set of `pylint` differences: I'm seeing `./pa...
# general
b
Last set of
pylint
differences: I'm seeing
./pants lint
and
pylint
(in my
ve
) disagree.
pylint
in ve is fine,
./pants
says
[E1101(no-member), AClass.delete] Instance of 'scoped_session' has no 'commit' member
The code in question is essentially:
Copy code
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()
...
db.session.commit()
I've set my
pants.toml
to match the
ve
's deps (I think it's a representative set)
Copy code
[pylint]
version = "pylint==2.6.0"
lockfile = "3rdparty/pylint_lockfile.txt"
extra_requirements.add = [
    "astroid==2.4.2",
    "flask==1.1.2",
    "flask-sqlalchemy==2.4.4",
    "mccabe==0.6.1",
    "pylint-flask-sqlalchemy==0.2.0",
]
h
are you using a pylint config file perhaps?
b
👀 I am
It contains:
load-plugins=pylint_flask_sqlalchemy
h
Would be good to double check it's being picked up by Pants's config discovery. Can run with
--no-process-execution-local-cleanup
and inspect the chroot to make sure the config file is there
b
Y'all need a short option name 😂
1
💯 1
🙈 1
h
I've proposed
--no-local-cleanup
in the past
🙌 1
b
--leak-chroot
💯 1
pylintrc
is there
👍 1
The plugin is installed in
pylint.pex
h
and the versions in your lockfile == your non-Pants install? could maybe try creating a venv using
pip -r lockfile.txt
and see if you can get Pylint passing that way still
👀 1
b
Oddly I don't see
flask-sqlachemy
in
requirements.pex
(but I DO see it in
pylint.pex
) 🤔
h
oh hm
pip -r lockfile.txt
wouldn't include your third-party requirements tho
b
I mean, it should have enough to look for this one specific error though. Worth a shot
h
Oddly I don't see flask-sqlachemy in requirements.pex
Probably shouldn't matter. We use a PEX feature to merge
requirements.pex
and
pylint.pex
into a single
pylint_runner.pex
b
Makes sense
So running with just the
pylint
lockfile I see the error. We're probably on to something
👍 1
Oh crazy, it was the version of
sqlalchemy
in the
pylint
reqs. I pinned it to the `ve`'s (must've missed this) and now it works
1
So, my mistake. Sorry for the noise. But now
pylint
is clean on our monorepo. One step closer to adoption
🚀 1
h
That's okay, glad you were able to figure this out! This also feels rewarding that we added tool lockfiles to Pants 2.7 so that hopefully issues like this don't creep in over time, where your build breaks over night 🙂
One step closer to adoption
Yay! Although I'll point out that you already have adopted Pants! Pants is meant to be useful even if you're only using it for things like installing and running your linters/formatters. It's not all-or-nothing
💯 1
b
Well I'm just getting everything set up for adoption at the company I work at 🙂
true adoption
Oh and yay for tool lockfiles too. Eventually the versions won't need to be so exact of every dep, and the lockfile can take over on it's own