-
Notifications
You must be signed in to change notification settings - Fork 53
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
Accept additional options to pass to poetry #60
Conversation
I added 2 tests, one for each "branch" of the if statement block (version specified vs version unspecified by the user). I would like your feedback to know if this is the right approach. If it is, I would add this feature to the docs. Even though the tests passed, I got the following message for the 2 tests added: This is expected until the changes are merged or am I missing something? |
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.
The warning output you're seeing is likely due to the fact that you've specified additional-options
in your tests, but called it other-options
in the action.yml
. You also passed in other_options
which I think is incorrect. I think this issue should be resolved by the suggestions I've added.
Otherwise good job, I think this is the way to go!
In terms of finalizing the PR now, I have one request: would you mind fixing the tests and making them fail before applying the suggestions I added? The fact that tests are currently passing indicates to me that we're not actually testing anything useful yet. Ideally we want tests to fail now, then when we fix the argument errors the tests should pass. Does that make sense?
.github/workflows/test.yml
Outdated
- uses: ./ | ||
with: | ||
version: 1.1.7 | ||
additional-options: --force |
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.
additional-options: --force | |
installation-arguments: --force |
.github/workflows/test.yml
Outdated
# If you're submitting a PR and this fails because Poetry release a new version | ||
# feel free to update it | ||
with: | ||
additional-options: --git https://github.com/python-poetry/poetry.git@master |
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.
additional-options: --git https://github.com/python-poetry/poetry.git@master | |
installation-arguments: --git https://github.com/python-poetry/poetry.git@master |
.github/workflows/test.yml
Outdated
source .github/scripts/assert.sh | ||
assert_in "1.1.7" "$(poetry --version)" |
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.
I think the easiest way to make the tests fail here is to use the --git
argument in both tests to install a specific version, then check the version installed. For the test to have value though, we cannot specify 1.1.7 and check that 1.1.7 is installed.
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.
It makes complete sense, @sondrelg. Sorry for the naming mistakes. That was sloppy of me.
I checked and the —git argument takes precedence over —version in the poetry installer. We can pass both and make sure it installs the version that corresponds to the git hash specified with the —git command.
I’m going to work in this soon and report back.
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.
One more thing btw: would it make sense to cut this whitespace for these tests? The whitespace for the final test seems OK, but here it's a little confusing 🙂
We will test installing from https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b35 which install version 1.1.9 and will cause the test to fail.
f688365
to
86067c6
Compare
Suggestions from code review Co-authored-by: Sondre Lillebø Gundersen <sondrelg@live.no>
Suggestions from code review Co-authored-by: Sondre Lillebø Gundersen <sondrelg@live.no>
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.
Think we might be able to remove these comments now, but otherwise looks very good!
If tests pass I'll release a new version later tonight 🎉
.github/workflows/test.yml
Outdated
# This test will need to change every time poetry releases a new version | ||
# If you're submitting a PR and this fails because Poetry release a new version | ||
# feel free to update it |
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.
Is this still true?
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.
Not anymore. Cleaned!
I had to submit these changes that just continue to rename the additional-options to installation-arguments in a different commit (dded203) because I made changes to these lines and the suggestions were flagged as outdated. |
I am going to need guidance with the documentation. How would you suggest this feature be documented, @sondrelg? |
I think we could add the option in the first two code blocks in the Readme, then add a sentence and an example about how to specify installer arguments at the end of the 'Defaults' section - just below (or above if you think it's better) the stuff about experimental settings 👏 |
I pushed final small edit to the readme, but really happy with this feature @mario-bermonti. Thanks a lot 👏 |
Thank you for a great experience, @sondrelg. |
Accept additional options from the user that are directly passed to poetry when installing it.
This will allow to install directly from github or use any of the other options accepted by poetry's installer script.
This closes #59.