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

Existence(?) of [tool.poetry.extra-scripts] is undocumented #7925

Closed
1 task done
raxod502 opened this issue May 15, 2023 · 7 comments
Closed
1 task done

Existence(?) of [tool.poetry.extra-scripts] is undocumented #7925

raxod502 opened this issue May 15, 2023 · 7 comments
Labels
area/docs Documentation issues/improvements status/triage This issue needs to be triaged

Comments

@raxod502
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I've been trying for quite some time to understand how to get Poetry to copy a binary into my built package (i.e., to the bin directory of the virtualenv).

This feature was supposedly added in python-poetry/poetry-core#40 to address #241, but there is no mention of the capability in documentation at https://python-poetry.org/docs/pyproject#scripts, and I have been unable to make it work no matter what I do. See python-poetry/poetry-core#40 (comment).

Does this feature exist? If so, what is the correct usage? It seems to have changed many times (source versus reference, scripts versus extra-scripts versus script-table versus script-legacy versus extra-script-legacy, tools versus tool), yet no documentation on any of the variations appears anywhere that I can find. And then there is #2310 which is saying maybe poetry and poetry-core are different from each other and it works in one but not the other? And maybe some subcommands of Poetry are broken but not others?

If my Python package needs to have a binary am I able to use Poetry or do I need to use setuptools exclusively instead?

@raxod502 raxod502 added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels May 15, 2023
@dimbleby
Copy link
Contributor

extra-scripts is not and so far as I can see never has been a valid key.

If you've found python-poetry/poetry-core#40 then you can see that the code all is still there, and that there are testcases demonstrating both how to use the function that was added and what it does

All that's left is that this was undocumented and should have follow up in poetry proper - which duplicates #2310. Please close.

@raxod502
Copy link
Author

I see that there are unit tests, but when I tested it myself, it didn't work, hence this issue.

Here's an example pyproject.toml that I just created:

[tool.poetry]
name = "poetry-repro"
version = "0.1.0"
description = "https://github.com/python-poetry/poetry/issues/7925"
authors = ["Radon Rosborough <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.10"

[tool.poetry.scripts]
foo = {reference = "foo.bash", type = "file"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

With the following executable file foo.bash in the same directory:

#!/usr/bin/env

echo Foo

When running poetry install, no file called foo is created in the bin directory of the virtualenv. Did I misunderstand?

@dimbleby
Copy link
Contributor

Yes, no part of the poetry-core MR would do that. The test cases show what it does do.

You are just duplicating #2310, discussion is much better happening in that issue - you are more likely to catch the attention of people who care about this, and will leave a more useful trail for future travellers.

Please close

@raxod502
Copy link
Author

Sure, I filed #2310 (comment) to copy this question into that thread.

@dimbleby
Copy link
Contributor

You forgot to close this one.

@Secrus Secrus closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2023
@raxod502
Copy link
Author

The answer to this ticket is available in #2310 (comment).

Copy link

This issue 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 status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants