-
-
Notifications
You must be signed in to change notification settings - Fork 86
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 .gitattributes files to prevent unneeded files from being shipped… #84
Add .gitattributes files to prevent unneeded files from being shipped… #84
Conversation
… in Composer distributions
Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it as I disagree with the notion of not shipping tests. |
Codecov Report
@@ Coverage Diff @@
## master #84 +/- ##
=========================================
Coverage 99.29% 99.29%
Complexity 211 211
=========================================
Files 12 12
Lines 566 566
=========================================
Hits 562 562
Misses 4 4 Continue to review full report at Codecov.
|
Ok, it is of course your project. I personally find it very wasteful, I have thousands of test files in my Your projects are installed a particularly high number of times, so you have the option to make a exceptionally big difference here. Could you enlighten me on your motivation? |
On the one hand, there is a technical reason that is detailed in sebastianbergmann/phpunit#2300 (comment). Not sure whether this has been addressed in Composer since then (maybe @Seldaek can provide some insight here) but I am definitely not going to change autoloading from using a On the other hand, there is a process-related reason. @remicollet (correct me if I'm wrong or if things have changed) once told me that Red Hat uses the archives created by GitHub for their continuous integration effort. And if the tests are excluded from export they will not be in these archives and that process will no longer work. |
TLDR .gitattributes is a terrible hack, to fix the lack of a nice installer for PHP (no, composer is NOT an installer, simply a dependency manager) tests, doc, license, ... are part of the project. Using
Yes, but of course we can use "git clone + tar" instead (what we already do in tons of projects). This have been discussed ad nauseam. Shame on PHP community for this. Perhaps someday, someone will start a new "Installer for PHP" project, . |
Yes it is also an installer. I also hook into it in many, many apps. Anyway, using You can also tweak the composer installer to remove |
Seriously ? you use "composer" to deploy on prod ? |
Yes, the assembled image (when using docker, larger projects) uses
Sorry, but no: each project has its own version of PHPUnit, and for good reasons (good luck pinning down a bug otherwise). This is the usual "statically compiled" vs "dynamically linked" discussion, and the Go approach clearly wins for me, since anything that has to do with dynamic linking is happily isolated into docker containers for good, these days. |
I am with @remicollet in that I do not like that Composer uses implict packages based on Git tags instead of packages created based on an explicit specification. In that regard, and only in that regard, Composer and Packagist are a step backwards from the PEAR Installer where packages were created based on the explicit information provided in That being said, though, I am open to the idea of ignoring |
What problem does it actually solve to exclude tests from the packages? I mean, I rarely work in an environment where the extra disk space consumed by the tests would actually matter. Really, no offense. I'm actually curious about the motivation behind this. |
@derrabus in the typical docker production environment, image size accounts for hosting costs, network bandwidth usage, and deployment speed. This is usually not a problem with phpunit itself, because docker containers are built with |
@willemstuursma While I wouldn't reuse the |
There actually is an old composer issue on this topic: composer/composer#5367 |
Noticed some unneeded files ending up in my new project.
Test etc. don't need to be shipped when installed through Composer.