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

Support for script-files #8134

Closed
petrprikryl opened this issue Oct 11, 2024 · 7 comments
Closed

Support for script-files #8134

petrprikryl opened this issue Oct 11, 2024 · 7 comments
Labels
question Asking for clarification or support

Comments

@petrprikryl
Copy link

petrprikryl commented Oct 11, 2024

Hi, are there any plans for script-files support like in setuptools tool.setuptools.script-files? E.g. for shell scripts.

Maybe useful:

@charliermarsh
Copy link
Member

@konstin -- Would this be part of the build backend work (eventually), or is it separate?

@charliermarsh charliermarsh added the question Asking for clarification or support label Oct 14, 2024
@konstin
Copy link
Member

konstin commented Oct 14, 2024

Yes, adding scripts is part of the build backend configuration (there is a dedicated scripts folder in wheels).

@BenConstable9
Copy link

Is there any plan for this?

I would like to move from Poetry to UV but this is blocking it for one of my projects.

I would like the equivalent of: tool.poetry.scripts

@my1e5
Copy link
Contributor

my1e5 commented Dec 3, 2024

@BenConstable9 - I believe [project.scripts] which is part of the official pyproject.toml specification will cover the functionality you are looking for? See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts

Also Using uv run as a task runner might be relevant?

@zanieb
Copy link
Member

zanieb commented Dec 3, 2024

Note that packages using script-files have been the cause of various bug reports already. That may affect its inclusion in our build backend? I'm not familiar with the state of the standards there though.

The [project.scripts] table is the recommended way to create cross-platform scripts. You can use that today https://docs.astral.sh/uv/concepts/projects/config/#command-line-interfaces (and you can also use setuptools and script-files with uv)

@konstin
Copy link
Member

konstin commented Dec 4, 2024

There are three different features known as "scripts":

  • project.scripts and project.gui-scripts: These are standards that should be supported by every build backend, and will also be supported by uv's build backend (Build backend: Add integration test for scripts #9635). Note that they already work with any build backend you're using: After installing the package, the scripts are installed and added to PATH by uv run or virtual environment activation. Poetry calls those tool.poetry.scripts.
  • The scripts data folder. Similar to project.scripts and project.gui-scripts, they are standards and already supported if your build backend uses them . The difference to project.scripts is that they aren't generated on installation, but just files copied to the correct target, so they are less portable.
  • A task runner, such as Using uv run as a task runner #5903

If you move from poetry to uv, you currently need to configure this for the build backend your using, not in uv itself.

@BenConstable9
Copy link

Thank you all. I had somehow missed this in the documentation. I will look to use it.

@zanieb zanieb closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

6 participants