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

feat: compat with python3.7 #87

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

Aleksi44
Copy link
Contributor

@Aleksi44 Aleksi44 commented Jun 21, 2023

Hello,

I'm the author of django-admin-tailwind (a django admin theme with TailwindCSS and AlpineJS too).
Congratulations for this great work (much better than my theme).
I'd like to add compatibility with python3.7 and I'm ready to make the effort to make it happen if it's okay with you.

Copy link
Contributor

@lukasvinclav lukasvinclav left a comment

Choose a reason for hiding this comment

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

in pyproject.toml we have to change target-version as well

tox.ini Outdated Show resolved Hide resolved
@lukasvinclav
Copy link
Contributor

Hey Aleksi, thanks for kind words, always nice to meet fellow Django developer :-P I left few comments in your PR but then I checked for how long 3.7 is going to be officially supported and after quick look I noticed that support is planned for another 6 days :-D I'm not sure if it makes sense to put an energy into this topic. What do you think?

https://endoflife.date/python

@Aleksi44 Aleksi44 force-pushed the compat-python-3.7 branch 2 times, most recently from 6fc3c05 to ca9d7a3 Compare June 23, 2023 09:56
@Aleksi44
Copy link
Contributor Author

Hey @lukasvinclav, thanks for your feedback. I've just fixed your comments.

I work for a company that can't upgrade to python3.8 right now. They want an advanced Django Admin (django-unfold is perfect for what they want). I'd like to contribute directly to this repository rather than maintain a fork if you agree.

I could also bring in some new features later :)

@lukasvinclav
Copy link
Contributor

Just tested python 3.7 support and it seems that Poetry requires at least 3.8.

Copy link
Contributor Author

@Aleksi44 Aleksi44 left a comment

Choose a reason for hiding this comment

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

details of my changes

pyproject.toml Show resolved Hide resolved
@@ -39,7 +39,7 @@
}


@lru_cache
@lru_cache(maxsize=None)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to declare maxsize=None for Python3.7 to avoid this error :

src/unfold/settings.py:43: in <module>
    def get_config(settings_name=None):
/usr/lib/python3.7/functools.py:490: in lru_cache
    raise TypeError('Expected maxsize to be an integer or None')
TypeError: Expected maxsize to be an integer or None

poetry.lock Outdated Show resolved Hide resolved
@lukasvinclav
Copy link
Contributor

lukasvinclav commented Jun 30, 2023

@Aleksi44 Regarding the lru_cache, I did some investigation and maybe I would prefer to use it without explicitly setting default values. You can read more here:

https://stackoverflow.com/questions/47218313/use-functools-lru-cache-without-specifying-maxsize-parameter

I think this is the last thing which we are missing and then we are good to go.

@Aleksi44
Copy link
Contributor Author

@lukasvinclav

I've just made the change : @lru_cache(max_size=None) -> @lru_cache()

@lukasvinclav lukasvinclav merged commit d000623 into unfoldadmin:main Jun 30, 2023
@Aleksi44
Copy link
Contributor Author

Aleksi44 commented Jul 3, 2023

Hey @lukasvinclav

I see that the commit you merged is no longer on main. Did you have any problems?

@lukasvinclav
Copy link
Contributor

@Aleksi44 I sent you an email last Friday. I used address from your profile.

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

2 participants