Remove jean85/pretty-package-versions dependency#1607
Remove jean85/pretty-package-versions dependency#1607ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
Conversation
|
I grabbed the phar artifact and could verify this which is good I guess php phpstan.phar --version
PHPStan - PHP Static Analysis Tool 1.8.x-dev |
|
I tried this before and it's not good enough. In current 1.8.x-dev the version says: So it includes the commit. So I guess the "pretty" part still does something extra besides calling Composer API. |
|
However, we can always copy the few lines of code to make this work without any dependencies, so feel free to get inspired :) |
|
ah and now I got you I think. yeah, the pretty part checks if a tagged version is used or not and still shows the commit then or not. I'll check this out. |
1ebd2c3 to
de2e361
Compare
c72a8bb to
e38fcd9
Compare
|
hmm this was looking promising, but |
|
I think this is looking good now, even better than before this PR since it also works on my local machine :) I hope it also still works on tags 😅 php ~/Downloads/phpstan.phar --version
PHPStan - PHP Static Analysis Tool 1.8.x-dev@094b3ac |
e14ed24 to
8350e9c
Compare
|
Thank you! |
|
hmm weird, did you change the lockfile for a specific reason? there are now some packages still inside that are not required by anything. |
|
I had to change it to rebase the branch. I probably ran the wrong command instead of what you did. IIRC this was just a prerequisite to be able to update paratest? |
|
yep, it's not a problem. I'll just open a PR to update paratest and there e.g. |
|
Oh no, I found another thing. I was completely ignoring the composer integration test already because it's red and missed that this PR most likely made it worse: |
|
Nice, I didn't have time to debug it yet unfortunately |
in favor of direct usage of
composer/package-versions-deprecatedit was using internally already. See also https://github.com/Jean85/pretty-package-versions/blob/1.6.0/src/PrettyVersions.php#L13 and https://github.com/Jean85/pretty-package-versions/blob/1.6.0/src/Version.php#L25the even nicer alternative would be to bump the composer API to v2 and use it's features as mentioned by @staabm phpstan/phpstan#7768 (comment)
this is the precondition to update paratest without having to care about
jean85/pretty-package-versionswhich is not compatible with PHP 7 in version 2.I could somewhat test this by running e.g.
bin/phpstan --versionandbin/phpstan analyse --fixand partly dumping the version and modifying the package it looks for (because for local phpstan it will always be an empty string as it was before as well).