Skip to content
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

Enhancement: add "extras" example to scripts docs #1181

Merged

Conversation

bradsbrown
Copy link
Contributor

After digging around in the poetry code to figure out
how to include an extras key in a cli script,
I thought it might be a useful thing to add to the docs
for future users.

Pull Request Check List

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

  • [n/a] Added tests for changed code.
  • Updated documentation for changed code.

Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the develop branch. If it's a bug fix or only a documentation update, it should be based on the master branch.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

@brycedrennan brycedrennan added the area/docs Documentation issues/improvements label Aug 16, 2019
@@ -192,6 +192,15 @@ poetry = 'poetry:console.run'

Here, we will have the `poetry` script installed which will execute `console.run` in the `poetry` package.

To specify a script that
[depends on an extra](https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies),
Copy link
Member

Choose a reason for hiding this comment

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

I think it's preferable to point to the extras section of the Poetry documentation instead of setuptools since they are different build tools.

Copy link
Contributor

@funkyfuture funkyfuture left a comment

Choose a reason for hiding this comment

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

thanks for this addition. would you be so kind and extend the plugins section accordingly? i also suggest to refer to the document's extrassection with a hyperlink. edit: sorry, missed it, i told ya so ;-)

@@ -192,6 +192,15 @@ poetry = 'poetry:console.run'

Here, we will have the `poetry` script installed which will execute `console.run` in the `poetry` package.

To specify a script that
[depends on an extra](#extras),
you may provide an entry as a dict:
Copy link
Contributor

Choose a reason for hiding this comment

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

the proper term would be inline table for toml.

Comment on lines 195 to 234
To specify a script that
[depends on an extra](#extras),
you may provide an entry as a dict:
Copy link
Contributor

Choose a reason for hiding this comment

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

these line breaks are not necessary and visually irritating.

Copy link

@pawamoy pawamoy Nov 28, 2019

Choose a reason for hiding this comment

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

Some would argue that short, broken lines are easier to read and maintain 🙂
Smaller diffs, and sentences are well cut on meaningful parts or punctuation.
It can also help in avoiding unnecessary words that make complicated sentences and therefore bad documentation!

@funkyfuture
Copy link
Contributor

i find that these sections are ordered weirdly.


```toml
[tool.poetry.scripts]
devtest = {callable = 'mypackage:test.run_tests', extras = ['test']}
Copy link
Contributor

Choose a reason for hiding this comment

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

most other snippets in this document use ".

@abn
Copy link
Member

abn commented Mar 21, 2021

Can this be rebased and comments resolved please?

Brad Brown added 2 commits May 15, 2021 07:41
After digging around in the poetry code to figure out
how to include an `extras` key in a cli script,
I thought it might be a useful thing to add to the docs
for future users.
@bradsbrown bradsbrown force-pushed the Enhancement.scripts_extras_docs branch from ce0d7e0 to ce3ffdd Compare May 15, 2021 12:41
@bradsbrown
Copy link
Contributor Author

@abn Finally got a chance to update this. Should be all set to go now.

@bradsbrown bradsbrown requested a review from sdispater May 15, 2021 12:44
@neersighted
Copy link
Member

Hey @bradsbrown, sorry for the late reply here -- could you rebase onto current master so this can be reviewed? Thanks!

@neersighted neersighted self-assigned this Nov 15, 2021
docs/pyproject.md Outdated Show resolved Hide resolved
docs/pyproject.md Outdated Show resolved Hide resolved
@neersighted neersighted merged commit 46a3aa8 into python-poetry:master Nov 15, 2021
edvardm pushed a commit to edvardm/poetry that referenced this pull request Nov 24, 2021
After digging around in the poetry code to figure out
how to include an `extras` key in a CLI script,
I thought it might be a useful thing to add to the docs
for future users.
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants