Skip to content

Commit

Permalink
Exclude tests from the composer archive
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Dec 7, 2022
1 parent 7b9016a commit 4e987ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
/.gitignore export-ignore
/.github export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/CHANGELOG.md export-ignore
/Dockerfile export-ignore
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,11 @@
"allow-plugins": {
"ocramius/package-versions": true
}
},
"archive": {
"exclude": [
"/test",
"/phpunit.xml.dist"
]
}
}

4 comments on commit 4e987ba

@cedric-anne
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamdes

This does not prevent files from being present in archives fetched by composer. See composer/packagist#1364 (comment)

@williamdes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamdes

This does not prevent files from being present in archives fetched by composer. See composer/packagist#1364 (comment)

Thank you for the hint, I am sure there is a scenario where this works
What was it ?

@cedric-anne
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamdes
This does not prevent files from being present in archives fetched by composer. See composer/packagist#1364 (comment)

Thank you for the hint, I am sure there is a scenario where this works What was it ?

If you run composer archive, it will work, but if you fetch package using composer install/update/require --prefer-dist, these ruls will not apply.

@williamdes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think upstream composer should implement re-packing the zip to exclude the files listed

Please sign in to comment.