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

Add a tutorial/guide for creating a command line tool #615

Open
bhrutledge opened this issue May 6, 2019 · 8 comments
Open

Add a tutorial/guide for creating a command line tool #615

bhrutledge opened this issue May 6, 2019 · 8 comments
Assignees
Labels
component: guides component: tutorials type: enhancement A self-contained enhancement or new feature

Comments

@bhrutledge
Copy link
Contributor

Related to #614.

As a companion to the packaging tutorial and installing command line tools guide, it'd be nice to have a walkthrough of transforming a command-line utility from running python my_utility.py in the script's directory to running my_utility in an arbitrary location (maybe via pipx?).

@ncoghlan
Copy link
Member

ncoghlan commented May 8, 2019

@theacodes Something that occurred to me while talking to Brian about this is that we have a potentially interesting opportunity here around the following structure:

  • how to package a utility to make it installable with pipx (tutorial, perhaps?)
  • how to use briefcase to take a utility installable with pipx, and create platform native installers for it

(cc @freakboy3742)

@theacodes
Copy link
Member

theacodes commented May 8, 2019 via email

@freakboy3742
Copy link

Briefcase doesn't currently have any tooling for supporting command line scripts - it's focused on packaging traditional "app" bundles (i.e., icons on a launcher that create a window). However, I don't have any objection to adding a mode for adding command line scripts.

@bhrutledge
Copy link
Contributor Author

I did what I think is the minimum amount of work to convert a standalone script to an installable utility in the first release of a personal utility. The next release added a README and LICENSE.

I know this doesn't follow a lot of best practices (package instead of module, __main__, tests, ...), but I was aiming for the shortest path to pipx install.

@bhrutledge
Copy link
Contributor Author

@chrysle
Copy link
Contributor

chrysle commented May 26, 2024

A guide on PyApp usage, which emerged just recently but is already quite successful, should be useful, too.

@freakboy3742
Copy link

Updating the status of Briefcase on this: we are nearing completion of a PR that will add support for packaging command line apps. We anticipate this will be merged very soon, with a release soon after (probably by mid June).

@chrysle
Copy link
Contributor

chrysle commented May 27, 2024

Happy to package that into a guide once it's ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: guides component: tutorials type: enhancement A self-contained enhancement or new feature
Projects
None yet
Development

No branches or pull requests

7 participants
@freakboy3742 @theacodes @ncoghlan @bhrutledge @pradyunsg @chrysle and others