Fix overlapping slots, base classes without slots - #7589
ariebovenberg wants to merge 8 commits into
Conversation
|
@zzzeek yes! I'd like to keep it in draft until all slots have been fixed, but I do need full CI runs to ensure nothing gets messed up 🙏 |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision c5aacf4 of this pull request into gerrit so we can run tests and reviews and stuff
|
OK the github actions will run each time now. the gerrit review is a separate CI that I always invoke manually but the GH actions are enough for you to develop. |
|
note I have some slots related changes coming through soon so that we can use slots more easily: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3532 |
|
New Gerrit review created for change c5aacf4: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
nope, only once we merge this. since it's a new contributor we have to approve each time. @ariebovenberg ping us when you want the test to run |
|
@CaselIT thanks for your patience -- I need some time to get familiar with the CI setup. Am I correct in considering these failures/aborts unrelated? |
|
The github ones are fine, so it's probably something unrelated. Once you want to re-run the complete suite we can make to bot update the existing gerrit |
|
I tried adding Python 3.11.0a4 to gerrit / jenkins today and it was a total failure. ignore anything on gerrit for now. |
|
mike bayer (zzzeek) wrote: recheck View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
Alright, the slots fixes seem complete from my end. I've edited the top comment with a list of fixed slots and reasoning behind each of them. Questions for you:
|
|
regarding 1, no, it's fine as multiple commits since it will be squashed when importing it in gerrit (the change will be merged by gerrit, not from github) |
|
can we make this ready for review? |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 4f3f665 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 4f3f665 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
mike bayer (zzzeek) wrote: recheck View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
mike bayer (zzzeek) wrote: we were having some CI issues a week ago which are fixed, not sure of the status of this so let's see if it passes CI View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
Looks like some fresh issues that are likely caused by the slots change, like |
|
@CaselIT could you kick off a CI run -- the weakref issue should be fixed. There may be more... |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision b6f4e8b of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset b6f4e8b added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
b6f4e8b to
70a9c4d
Compare
|
I've rebased from @zzzeek I think I'm missing some of the background on Could you kick off another CI run? |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 70a9c4d of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 70a9c4d added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
mike bayer (zzzeek) wrote: this looks great! did you say that you have a tool that lints for these? if it's mature enough we can have it as part of our .pre-commit config, if it can just alert us to new slots changes that are overlapping or missing. View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3548 has been merged. Congratulations! :) |
As discussed in #7589, `slotscheck` can prevent slots-related mistakes from creeping back in. Plan for now is to have slotscheck part of the "lint" tests (renamed from pep8) that will run for CI and github actions. To support slotscheck's runtime nature, slotscheck is run twice, first with cython exts enabled and then with them disabled via new environment variable. Also added sqlalchemy[mypy] dependency to support slots checking the mypy plugin. Found and fixed one more `__slots__` issue by disabling C exts. Closes: #7670 Pull-request: #7670 Pull-request-sha: 3e77fe5 Change-Id: I90cdd284cdcee316a38856ba94d72ffc98947c5a
Some `__slots__` were not in order. Fixes sqlalchemy#7527 ### Description I'm fixing two types of slots mistakes: - [x] remove overlapping slots (i.e. slots already defined on a base class) - [x] fix broken inheritance (i.e. slots class inheriting from a non-slots class) - [x] slots added to base class `TransactionalContext`. It seemed to use two attributes, which I've added as slots. - [x] empty slots removed from `ORMOption`. Its base class explicitly makes use of `__dict__` so empty slots don't add anything. - [x] empty slots added to `PostLoader`. It doesn't appear to use any slots not already defined on its base classes. - [x] empty slots added to `IterateMappersMixin`. It doesn't appear to use any slots not already defined on its subclasses. - [x] empty slots added to `ImmutableContainer`. It doesn't use any fields. - [x] empty slots added to `OperatorType`. It's a protocol. - [x] empty slots added to `InternalTraversal`, `_HasTraversalDispatch`. They don't seem to use attributes on their own. ### Checklist This pull request is: - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. **Have a nice day!** Closes: sqlalchemy#7589 Pull-request: sqlalchemy#7589 Pull-request-sha: 70a9c4d Change-Id: I6c6e3e69c3c34d0f3bdda7f0684849834fdd1863
As discussed in sqlalchemy#7589, `slotscheck` can prevent slots-related mistakes from creeping back in. Plan for now is to have slotscheck part of the "lint" tests (renamed from pep8) that will run for CI and github actions. To support slotscheck's runtime nature, slotscheck is run twice, first with cython exts enabled and then with them disabled via new environment variable. Also added sqlalchemy[mypy] dependency to support slots checking the mypy plugin. Found and fixed one more `__slots__` issue by disabling C exts. Closes: sqlalchemy#7670 Pull-request: sqlalchemy#7670 Pull-request-sha: 3e77fe5 Change-Id: I90cdd284cdcee316a38856ba94d72ffc98947c5a

Some
__slots__were not in order.Fixes #7527
Description
I'm fixing two types of slots mistakes:
TransactionalContext. It seemed to use two attributes, which I've added as slots.ORMOption. Its base class explicitly makes use of__dict__so empty slots don't add anything.PostLoader. It doesn't appear to use any slots not already defined on its base classes.IterateMappersMixin. It doesn't appear to use any slots not already defined on its subclasses.ImmutableContainer. It doesn't use any fields.OperatorType. It's a protocol.InternalTraversal,_HasTraversalDispatch. They don't seem to use attributes on their own.Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>in the commit messageHave a nice day!