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

Add types for packaging.version._Version #665

Merged
merged 5 commits into from Jun 16, 2023

Conversation

hauntsaninja
Copy link
Contributor

This makes interactions with the internal _version object type safe, instead of having them all resolve to Any.

I also separate out the actual types (which do not contain infinities) from the types used by _cmpkey (which could). This types things more accurately and makes the types easier to understand in the actual case.

hauntsaninja and others added 4 commits January 16, 2023 23:42
This makes interactions with the internal _version object type safe,
instead of having them all resolve to Any.

I also separate out the actual types (which do not contain infinities)
from the types used by _cmpkey (which could). This types things more
accurately and makes the types easier to understand in the actual case.
@hauntsaninja
Copy link
Contributor Author

Fixed merge conflicts! Let me know if you have any feedback :-) This change is more type safe, imo more readable, and neutral on line count.

@brettcannon brettcannon merged commit f8893d4 into pypa:main Jun 16, 2023
27 checks passed
@brettcannon
Copy link
Member

Thanks!

@hauntsaninja hauntsaninja deleted the version-type branch June 16, 2023 22:53
kodiakhq bot pushed a commit to cloudquery/plugin-sdk-python that referenced this pull request Nov 1, 2023
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [packaging](https://togithub.com/pypa/packaging) | minor | `==23.1` -> `==23.2` |

---

### Release Notes

<details>
<summary>pypa/packaging (packaging)</summary>

### [`v23.2`](https://togithub.com/pypa/packaging/releases/tag/23.2)

[Compare Source](https://togithub.com/pypa/packaging/compare/23.1...23.2)

#### What's Changed

-   parse_marker should consume the entire source string by [@&#8203;mwerschy](https://togithub.com/mwerschy) in [pypa/packaging#687
-   Create a Security Policy file  by [@&#8203;joycebrum](https://togithub.com/joycebrum) in [pypa/packaging#695
-   Add python 3.12 to CI by [@&#8203;mayeut](https://togithub.com/mayeut) in [pypa/packaging#689
-   Remove URL validation from requirement parsing by [@&#8203;uranusjr](https://togithub.com/uranusjr) in [pypa/packaging#684
-   Add types for packaging.version.\_Version by [@&#8203;hauntsaninja](https://togithub.com/hauntsaninja) in [pypa/packaging#665
-   Add PyPy 3.10 to CI by [@&#8203;mayeut](https://togithub.com/mayeut) in [pypa/packaging#699
-   Remove unused argument in `_manylinux._is_compatible` by [@&#8203;mayeut](https://togithub.com/mayeut) in [pypa/packaging#700
-   Canonicalize names for requirements comparison by [@&#8203;astrojuanlu](https://togithub.com/astrojuanlu) in [pypa/packaging#696
-   Add platform tag support for LoongArch by [@&#8203;loongson-zn](https://togithub.com/loongson-zn) in [pypa/packaging#693
-   Ability to install `armv7l manylinux/musllinux` wheels on `armv8l` by [@&#8203;mayeut](https://togithub.com/mayeut) in [pypa/packaging#690
-   Include CHANGELOG.rst in sdist by [@&#8203;astrojuanlu](https://togithub.com/astrojuanlu) in [pypa/packaging#704
-   Update pyupgrade to Python 3.7+ by [@&#8203;fangchenli](https://togithub.com/fangchenli) in [pypa/packaging#580
-   Fix version pattern pre-releases by [@&#8203;deathaxe](https://togithub.com/deathaxe) in [pypa/packaging#705
-   Fix typos found by codespell by [@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos) in [pypa/packaging#706
-   Support enriched metadata by [@&#8203;brettcannon](https://togithub.com/brettcannon) in [pypa/packaging#686
-   Correct rST syntax in CHANGELOG.rst by [@&#8203;atugushev](https://togithub.com/atugushev) in [pypa/packaging#709
-   fix: platform tag for GraalPy by [@&#8203;mayeut](https://togithub.com/mayeut) in [pypa/packaging#711
-   Document that this library uses a calendar-based versioning scheme by [@&#8203;faph](https://togithub.com/faph) in [pypa/packaging#717
-   fix: Update copyright date for docs by [@&#8203;garrypolley](https://togithub.com/garrypolley) in [pypa/packaging#713
-   Bump pip version to avoid known vulnerabilities by [@&#8203;joycebrum](https://togithub.com/joycebrum) in [pypa/packaging#720
-   Typing annotations fixed in version.py by [@&#8203;jolaf](https://togithub.com/jolaf) in [pypa/packaging#723
-   parse\_{sdist,wheel}\_filename: don't raise InvalidVersion by [@&#8203;SpecLad](https://togithub.com/SpecLad) in [pypa/packaging#721
-   Fix code blocks in CHANGELOG.md by [@&#8203;edmorley](https://togithub.com/edmorley) in [pypa/packaging#724

#### New Contributors

-   [@&#8203;mwerschy](https://togithub.com/mwerschy) made their first contribution in [pypa/packaging#687
-   [@&#8203;joycebrum](https://togithub.com/joycebrum) made their first contribution in [pypa/packaging#695
-   [@&#8203;astrojuanlu](https://togithub.com/astrojuanlu) made their first contribution in [pypa/packaging#696
-   [@&#8203;loongson-zn](https://togithub.com/loongson-zn) made their first contribution in [pypa/packaging#693
-   [@&#8203;fangchenli](https://togithub.com/fangchenli) made their first contribution in [pypa/packaging#580
-   [@&#8203;deathaxe](https://togithub.com/deathaxe) made their first contribution in [pypa/packaging#705
-   [@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos) made their first contribution in [pypa/packaging#706
-   [@&#8203;atugushev](https://togithub.com/atugushev) made their first contribution in [pypa/packaging#709
-   [@&#8203;faph](https://togithub.com/faph) made their first contribution in [pypa/packaging#717
-   [@&#8203;garrypolley](https://togithub.com/garrypolley) made their first contribution in [pypa/packaging#713
-   [@&#8203;jolaf](https://togithub.com/jolaf) made their first contribution in [pypa/packaging#723
-   [@&#8203;SpecLad](https://togithub.com/SpecLad) made their first contribution in [pypa/packaging#721
-   [@&#8203;edmorley](https://togithub.com/edmorley) made their first contribution in [pypa/packaging#724

**Full Changelog**: pypa/packaging@23.1...23.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
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