-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add typing / drop Python < 3.8 support #30
Conversation
to fix the tests, I think you have to remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, awesome! thank you so much - this is fantastic.
LGTM overall, a couple smaller nits.
Once the tests pass happy to merge it in!
Made a few other changes, including the Makefile. Now waiting on CI job being unblocked :) There is a chance this will break a lot of code so consider doing a Also you'll probably want to avoid a merge commit because I have complete disregard for git history within PRs. |
Thanks! I haven't had a chance to take another pass, but I did unblock CI. I'll see if I can just give your PRs permission to run without approval. ack on RC - I was thinking the same myself, we'll ship a beta, maybe a major version too just to mark the lack of support for py2. No worries on Git history - I'll squash at the end ;) |
Based on other repositories I've created PRs for I believe this is possible; though I'm not sure what the setting is as I don't use GHA myself. |
awesome, thanks! will get a beta version out soon. |
@nhairs beta is out: https://pypi.org/project/deepmerge/2.0b0/. Would you mind testing it out? |
Tested it on a couple of projects, /seems/ okay 🙂 I didn't get any lint errors (which is kind of expected if I'm calling things correctly). Didn't get any errors. Did have to drop py37 support in one of my projects 😅 |
Hi @toumorokoshi, It's been 6 months since the 2.0 beta release. Would you be able to upload a full release to PyPI? |
done! thanks for the reminder: https://pypi.org/project/deepmerge/2.0/ |
This PR adds Python 3.8+ compatible type annotations (dropping support for <3.8 at the same time).
Fixes: #27
At a high level the following changes have been made:
f"{foo=}
notation).from __future__ import annotations
we can use "new style" annotations (e.g.str | list[int] | None
instead ofOptional[Union[str, List[int]]]
) which are normally only available in higher versions of python. However it does mean that these annotations cannot be resolved from their string representation (all type annotations are stored as strings which is why this works) into their concrete classes unless you are running a supported version of Python.pyrproject.toml
pyproject.toml
, makemake .venv
more portablevirtualenv
isn't always available so use-m venv .venv
which is just as effective, and not all systems havepython(2)
installed orpython3-is-python
so explicitly usepython3
Test Plan
make ready-pr
runs without error