-
Notifications
You must be signed in to change notification settings - Fork 15
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
Change TransactionBase into a Protocol #472
Conversation
It looks like there is some incompatibility between CI and my local setup. Locally all tests passed. I suppose that this is because of the python 3.11 which I use locally. |
From What's new in python 3.11:
This probably explain, why tests on 3.10 fails. |
This looks like a great reason to move to 3.11. Please do so in a separate PR though. |
Yes. Update in this PR is for testing purposes. When all check pass, I will move them to separate MR. I am building now docker images with updated python. Do I need any additional permissions to upload docker images to ghcr.io or should it work without them? |
We don't have a workflow which builds Docker images. And some permissions will probably be needed, but I don't really remember how this worked. |
I have build images, but I don't have access to push them into I have found such instruction: |
Should just be a matter of declaring the right perms in the work flow file.
Happy to help if needed.
…On Sun, 8 Oct 2023 at 16:32, Marek Materzok ***@***.***> wrote:
We don't have a workflow which builds Docker images. And some permissions
will probably be needed, but I don't really remember how this worked.
—
Reply to this email directly, view it on GitHub
<#472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB4O4CJ6OIN23OTQ6IXWLDX6LBQDAVCNFSM6AAAAAA5XWMGG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGA3DQMBSHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@lekcyjna123: You got write permissions for the packages, please don't mess up stuff. |
Why did you create a new Docker package? |
amaranth-synth-ecp5 is renamed riscv-toolchain I uploaded into personal space, because I haven't had permissions to upload into |
In the newest version I had to use flag I see that all tests passed. Tomorrow I will create new PR with python update. |
Looks smelly. Why did you use it? (You seem quick to hack things, but you rarely explain why.) |
:) (This creates a virtual environment in directory Also if you ever want to run python version not available on your distro but don't want to compile from source I recommend miniconda
I noticed that somewhere around half a year ago pip started requiring installing packages into virtualenvs instead of system-wide. If you really want to do so you can pass |
Afaik there was a bug on python 3.11 where signal width would get trimmed to 1 bit in vcd dumps. I was supposed to find a minimal example and submit an issue but forgot, not sure if that bug is still present though. |
If it is, it's probably time to have it fixed. |
This was fixed 5 months ago and we updated amaranth to a version which includes that fix, so it's no longer an issue. Full details here |
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.
Looks sensible from my perspective, though I'm not an expert on python typing.
Here is a proposition of solution to problem found in #471. In
TransactionBase
we try to enforce closed set of types (TransactionOrMethod
) in place where python provide us an open set (TransactionBase
). This open set is a result of inheritance, where there is an assumption, that base class implementation should be common for all derived classes. We workarounded that by asserting if argument is aMethod
or aTransaction
. But this workaround caused cyclic dependencies in imports after split of core.py.Proposed solution use
Protocol
instead of inheritance to fully move type checking into static analysis. This change allow us to add type hintTransactionOrMethod
toself
incontext
function, which is not possible in plain base class (where type ofself
have to be superclass of its class type).