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

Exclude unassigned type-annotated class attributes from enum __members__ container #2263

Conversation

mbyrnepr2
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

Exclude type-annotated class attributes, which have no assigned value, from the __members__ container of an Enum class.

pylint-dev/pylint#7402

mbyrnepr2 and others added 3 commits July 31, 2023 12:33
…, from the ``__members__`` container of an ``Enum`` class.

Refs pylint-dev/pylint#7402
The value if now `Uninferable` in the case of
an annotated attribute of an `enum.Enum` class with no assigned value.
astroid/brain/brain_namedtuple_enum.py Outdated Show resolved Hide resolved
tests/brain/test_enum.py Outdated Show resolved Hide resolved
tests/brain/test_enum.py Show resolved Hide resolved
mbyrnepr2 and others added 8 commits July 31, 2023 14:27
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
These attributes cannot be none in real-world situations,
see python/cpython#106145.
Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](sphinx-doc/sphinx@v7.0.0...v7.1.1)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #2263 (3684440) into main (44c1ebb) will increase coverage by 0.00%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2263   +/-   ##
=======================================
  Coverage   92.78%   92.78%           
=======================================
  Files          94       94           
  Lines       10951    10953    +2     
=======================================
+ Hits        10161    10163    +2     
  Misses        790      790           
Flag Coverage Ξ”
linux 92.59% <100.00%> (+<0.01%) ⬆️
pypy 90.89% <100.00%> (+<0.01%) ⬆️
windows 92.37% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Ξ”
astroid/brain/brain_namedtuple_enum.py 92.95% <100.00%> (+0.04%) ⬆️

@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review August 2, 2023 11:21
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.

Let's backport this :)

@Pierre-Sassoulas Pierre-Sassoulas merged commit 63cd8a1 into pylint-dev:main Aug 5, 2023
20 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

The backport to maintenance/2.15.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/2.15.x maintenance/2.15.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/2.15.x
# Create a new branch
git switch --create backport-2263-to-maintenance/2.15.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 63cd8a1752f01391956f94cfde0c49de44f3726f
# Push it to GitHub
git push --set-upstream origin backport-2263-to-maintenance/2.15.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/2.15.x

Then, create a pull request where the base branch is maintenance/2.15.x and the compare/head branch is backport-2263-to-maintenance/2.15.x.

@Pierre-Sassoulas Pierre-Sassoulas added Needs backport Needs to be cherry-picked on the current patch version by an astroid's maintainer and removed backport maintenance/2.15.x labels Aug 5, 2023
@mbyrnepr2 mbyrnepr2 deleted the pylint_7402_exclude_unassigned_annassigns_from_enum_members branch August 5, 2023 20:13
@jacobtylerwalls jacobtylerwalls removed the Needs backport Needs to be cherry-picked on the current patch version by an astroid's maintainer label Sep 23, 2023
@jacobtylerwalls jacobtylerwalls modified the milestones: 2.15.7, 3.1 Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants