-
Notifications
You must be signed in to change notification settings - Fork 297
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
Feature: Change to another layout [src] #720
Comments
If the maintainers decide to switch to the Note: I created that issue because I am currently working on the docker in docker feature. For this I wanted to simply execute a subset of all tests marked with |
if you want to execute a subset of tests, you can use standard pytest features? can you explain which functions you wanted to target and i can try to craft a pytest command for you |
Nope I had to change the file names of the tests. Simply try to run
I renamed the test files and got it working but the fact that this can be an issues shows the problems of the current layout. |
hm, I supposed in a perfect world we would be able to run ci on all projects sometimes but it was a conscious decision to cut down and isolate ci runs of the individual modules (isolation helps also with dependency management) in .NET the tooling situation is much better than python so I would say this is why the situation differs. I have reproduced the problem and am going to fix it, but I will point out that we have a makefile that species how we run tests, so you can see there how we run the tests and it is not all in a row. |
I might not understand the actions and poetry correctly but I don't see how the "isolation" is related to structure of the project. The suggested structure would be something like
You only would need to adopt the paths inside the Also in the end we build a monolithic package so I don't see that there are "different projects". ➡️ So what is advantage of the current layout? SidenoteIf you want to isolate the "core" from "community" modules it might be better to express this with a different package structure, something like
But as a monolithic package is released this make not a lot of sense. |
the hope is that one day it is no longer a monolithic package i think - lowers the barrier to parallel community efforts that does not cost testcontainers org maintainer hours |
yes, the pipeline failed because the cosmos emulator is not super reliable but i did not change any code, so if those tests passed before, its not something preventable by me today. I'll leave this open for discussion in case I am wrong about this above, the situation may have changed, etc... I have yet to look at the dotnet implementation, etc. |
Another reason why it might be nice to change to the In a source layout I could simply do git diff core/testcontainers > testcontainers.patch If there would have been changes (not only to tests) also to modules I would have needed to include each module subfolder manually. Being very careful not include changes of tests or docs etc. |
Hi @CarliJoy, thanks for initiating this discussion. I'd like to chime in from the perspective of the overarching Testcontainers Project leadership. However, I am not an experienced Python developer at all, so I can't really have a strong opinion on the details of the decision and what makes most sense for a Python project. Please note that Testcontainers for .NET is currently in the same category of official/community as is Testcontainers for Python (even if the Testcontainers org README says otherwise), since it only has community maintainers (namely Andre Hofmeister) working on it. The difference here is, that it used to be commercially supported while we were still operating through AtomicJar. The situation is different after the Docker acquisition, which leaves us only with Testcontainers for Java and Testcontainers for Go maintainers on staff. Hence, it is not useful, to further use the .NET implementation as an example for a reference implementation, Java and Go are much better suited for this. And independent of this, there is always a historic context around past decisions and the status quo of the different languages, so a 1:1 comparison is not always helpful. Ultimately, the goal for every Testcontainers project (which is based on our extensive experience developing and maintaining Testcontainers for Java) should be to have independently testable and releasable modules per technology, and in addition a minimal core module, that is free of these external technology dependencies. I have no opinion or guidance with regards to which folder structure is well suited to achieve this, since it depends on programming language and build system. However, another critical aspect we want to ensure across languages, is minimizing CI load, since CI resources are shares across the GitHub organization. There can again different technical means and language dependent mechanisms to achieve this, but the desired goal is to avoid running CI for modules, that are not affected by changes. Lastly, I leave the decision on how to proceed with this to the current maintainers and given the nature of a community supported project, I can entirely understand if there is a lack of bandwidth to currently support a bigger migration effort. |
Follow up on the discussion in #488.
The MR suggested to change to a flat layout to activate typing easily (see #305).
@totallyzen brought the argument:
However, after looking at the official .NET project, I find this argument weak. The .NET project doesn't follow this structure—there is no core or modules, only src and tests folders.
The current layout introduces several issues:
py.typed
.I propose adopting the src-layout, which has been embraced by many modern Python packages. This would:
Most importantly, this change would reduce complexity, enabling Python developers to contribute more easily with less cognitive overhead.
Lastly, it would mirror the structure of the official .NET project. :)
The text was updated successfully, but these errors were encountered: