-
Notifications
You must be signed in to change notification settings - Fork 1
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
Integrate with packaging tools to allow console_scripts-like usage #19
Comments
ProposalUse Configuration would look like: # pyproject.toml
# Current
[tools.flit.scripts]
flit = "flit:main"
# With quicken
[tools.flit.scripts]
flit = "quicken.script:flit._.main"
# Current
[tools.poetry.scripts]
poetry = 'poetry:console.run'
# With quicken
[tools.poetry.scripts]
flit = 'quicken.script:poetry._.console.run' # setup.py
# Old format
setup(
...
entry_points={
'console_scripts': [
'funniest-joke=funniest.command_line:main'
]
}
...
)
# New format
setup(
...
entry_points={
'console_scripts': [
'funniest-joke=quicken.script:funniest.command_line._.main'
]
}
...
) The
Given
The specific syntax is subject to change pending a review of PyPI package entry point naming, but shouldn't be too cumbersome to stick to. Benefits:
Drawbacks:
BackgroundFor wheels, entry points as defined above are put into Wheel files can contain scripts in AlternativesTool-specific pluginsIf the tools provide an interface, we can write a module that will generate the required file on sdist installation or to be included in any generated wheel. Rejected because:
Include quicken in "build-requires" and patch tools as needed with pth hackRejected because:
PEP-517 shimWithout impacting the build system too much we can take a page from flit and implement a shim that would delegate to the actual build system used by a user but then generate our scripts at the appropriate time. Rejected because:
PEP-517 frameworkOutside the scope of this utility, should not be a pre-requisite. Pre-generated scriptssetuptools supports a Rejected because:
Pre-generated sourcesSince every utility supports something like console scripts, we could have a step prior to executing of the tool that would generate a command-line file in the project source tree that could be referenced like anything else. Rejected because:
References |
Item still pending: mechanism for reloading on package update (must-have, otherwise this is not usable) Options:
|
Closed by #54. |
The current implementation is generic enough that it can be used in place of a setuptools-generated script and be used to run packages directly.
The solution should work for (to start):
Examples of current script designation:
setuptools
console_scripts
entry point:flit
scripts
:poetry
scripts
Usage should be about that easy and should work with both source distributions and wheels.
The text was updated successfully, but these errors were encountered: