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

Document minimum python version #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bmispelon
Copy link

Hi,

I was trying to use this plugin for a Python 3.7 project and ran into an issue because of the use of functools.cached_property (which is new in 3.8).

Here is a PR that adds a small note in the install section of the README, plus a setting in setup.py to prevent installing the plugin on incompatible python versions (see https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires).

A better fix might be to remove the dependency on cached_property but that might require more effort whereas this seems like a quick and easy fix.

Thanks ✨

@meanmail meanmail self-assigned this Oct 28, 2021
@bmispelon
Copy link
Author

I did a bit of digging around and from what I understand the config attribute is set when Visitor is instanciated: https://github.com/afonasev/flake8-plugin-utils/blob/master/flake8_plugin_utils/plugin.py#L42

And the Visitor is instanciated only once when the plugin is run: https://github.com/afonasev/flake8-plugin-utils/blob/master/flake8_plugin_utils/plugin.py#L70

This means that replacing cached_property with a plain property shouldn't be too expensive performance-wise since we're only accessing existing attributes, not doing any extra computation.

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.

2 participants