Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pylint 3.x #407

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Support for pylint 3.x #407

merged 1 commit into from
Oct 22, 2023

Conversation

matejsp
Copy link
Contributor

@matejsp matejsp commented Oct 6, 2023

Fixing #405

@matejsp matejsp force-pushed the master branch 2 times, most recently from d2fbda0 to bab5428 Compare October 6, 2023 09:19
jbpenrath added a commit to openfun/richie that referenced this pull request Oct 10, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo. It will be compatible once merged and
a new release made.

pylint-dev/pylint-django#407
jbpenrath added a commit to openfun/richie that referenced this pull request Oct 10, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo. It will be compatible once merged and
a new release made.

pylint-dev/pylint-django#407
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You went out of your way to support both pylint 2 and 3 👌

@carlio
Copy link
Collaborator

carlio commented Oct 11, 2023

You went out of your way to support both pylint 2 and 3 👌

This is something I have been clinging onto for a long time : new dependencies break the library, but dropping support for old dependencies breaks so many peoples' CI pipelines because they've pinned older versions. It has to be a careful mix of both or people will just drop pylint-django (and prospector has this philosophy too).

I'm reluctant to say "this only supports the latest and greatest mix of Python+Django+Pylint" even though that's easier for me, because that rules out the majority of people and companies who don't have the time to upgrade their dependencies, and honestly they're the ones who need CI static analysis the most in my opinion, to prevent building up too much technical debt since they don't have the capacity to go back and deal with it later.

I'm probably biased because a lot of my work is in helping people deal with technical debt caused by prioritizing new features and growth at the expense of maintenance.

Anyway that's my answer to your question on #405 @matejsp : "I didn't prepare PR because I don't know if you want to preserve backwards compatibility or just support pylint 3.x"

Sorry for being slow about this but I don't have much time right now, I'll get to it!

@carlio
Copy link
Collaborator

carlio commented Oct 11, 2023

I agree though that this PR is excellent and thank you for it :-) I will definitely merge it once I fix up the CI pipeline to validate things (#400 and similar) which I am half way though...

@Pierre-Sassoulas
Copy link
Member

I'm reluctant to say "this only supports the latest and greatest mix of Python+Django+Pylint" even though that's easier for me, because that rules out the majority of people and companies who don't have the time to upgrade their dependencies, and honestly they're the ones who need CI static analysis the most in my opinion, to prevent building up too much technical debt since they don't have the capacity to go back and deal with it later.

Personally, I'm following the system, the language, or the framework's EOL guidelines (debian/python/django) witohut feeling guilty about it. If upgrading would be very costly for a company, then they can pay you a fraction of the upgrade cost so you'll maintain your code for longer than the EOL (never seen that done for a lib, but I guess Ubuntu can do it with financial success with their Expanded Security Maintenance). Everyone can use the existing old version from 4 year ago that is compatible with their old stack (and ignore the CVEs the same way they ignore the OS/language/framework CVEs). For this reason it's even arguably not that problematic to support for less than the EOL as long as one version of your lib is compatible with interpreters that are still not EOL (i.e. pylint-django could drop support for python 3.8 / pylint 2.17.7 right now, there's still usable versions for python 3.8 / pylint 2.17.7). To be frank, if deploying prod code on an OS that is affected by heart-bleed in 2020+ is not enough of a reason for a company to stop prioritizing business above all else and finally upgrade, then I don't know why this company should survive on your back. There's no reason you in particular should suffer to allow them to survive without ripping any of the benefits.

That said it's nice to stay compatible when the cost is low or if (hypothetically) you're compensated for your work.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested locally and I confirm it works for me.

pylint --version

pylint 3.0.1
astroid 3.0.0
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
pip3 freeze|grep pylint-django
pylint-django @ git+https://github.com/matejsp/pylint-django.git@bab54286b0d6d5a06ffec28198a61d7ebf6a38b4

After fixing an unrelated hack I did before based on a stackoverflow answer that "just worked":

-init-hook="import sys; import os; from pylint.config import find_pylintrc; sys.path.append(os.path.dirname(find_pylintrc()))"
+init-hook="import os;os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')"

kernicPanel added a commit to openfun/marsha that referenced this pull request Oct 16, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo.
pylint-dev/pylint-django#407
It will be compatible once merged and
a new release made.
jbpenrath added a commit to openfun/joanie that referenced this pull request Oct 17, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo. It will be compatible once merged and
a new release made.

pylint-dev/pylint-django#407
jbpenrath added a commit to openfun/joanie that referenced this pull request Oct 18, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo. It will be compatible once merged and
a new release made.

pylint-dev/pylint-django#407
lunika pushed a commit to openfun/marsha that referenced this pull request Oct 18, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo.
pylint-dev/pylint-django#407
It will be compatible once merged and
a new release made.
lunika pushed a commit to openfun/marsha that referenced this pull request Oct 18, 2023
Pylint 3 has been released but django-pylint is not yet compatible. A PR
is open on the django-pylint repo.
pylint-dev/pylint-django#407
It will be compatible once merged and
a new release made.
@carlio
Copy link
Collaborator

carlio commented Oct 22, 2023

I have been trying to get the CI working (see #400 (comment)) but it's a bit of a pain so I'm going to merge this and make a bugfix release first to free up peoples' own CI builds.

@carlio carlio merged commit 3b760ed into pylint-dev:master Oct 22, 2023
1 of 32 checks passed
@carlio
Copy link
Collaborator

carlio commented Oct 22, 2023

Finally managed to make a bugfix release to include this. 2.5.4 is on PyPI. Thanks again @matejsp :-)

I'll get on to cleaning up the pylint-django CI process next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants