Skip to content

Add Typer CLI App code#217

Merged
spacerest merged 16 commits into
masterfrom
typer-cli-python
Oct 30, 2021
Merged

Add Typer CLI App code#217
spacerest merged 16 commits into
masterfrom
typer-cli-python

Conversation

@lpozo

@lpozo lpozo commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

@martin-martin martin-martin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @lpozo thanks for moving your code to the materials repo. There are a couple of leftover inconsistencies resulting from the recent changes based on the previous TR round, e.g. in Step 7 you didn't yet update the list-all command to list:

(venv) ➜  source_code_step_7 git:(typer-cli-python) ✗ python -m rptodo list
Usage: rptodo [OPTIONS] COMMAND [ARGS]...
Try 'rptodo --help' for help.

Error: No such command 'list'.
(venv) ➜  source_code_step_7 git:(typer-cli-python) ✗ python -m rptodo --help
Usage: rptodo [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --version         Show the application's version and exit.
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  --help                Show this message and exit.

Commands:
  add       Add a new to-do with a DESCRIPTION.
  clear     Remove all to-dos.
  complete  Complete a to-do by setting it as done using its TODO_ID.
  init      Initialize the to-do database.
  list-all  List all to-dos.
  remove    Remove a to-do using its TODO_ID.

And there is an issue with the tests as well related to a difference between "get" and "buy" milk 🥛 .

Please double-check each step and make sure that both the code as well as the tests work as expected in the updated tutorial.

requirements.txt File

I was also wondering what might be the best way to mention the Requirements file. You never created a requirements.txt file in the tutorial, but you're including it in the final source code. However, it's not present in any of the other source code folders.

Since you're already including a lot of empty files in all of the source code folders, which I don't find ideal, but makes sense when following your SbSP where you set up the structure at the beginning, you might want to create a requirements.txt file right after installing the dependencies. Then you could add it to the relevant folders.

Also note the comment about poetry in your requirements.txt file.

Comment thread typer-cli-python/source_code_final/requirements.txt Outdated
Comment thread typer-cli-python/source_code_step_6/tests/test_rptodo.py Outdated
@spacerest spacerest merged commit 8923a6d into master Oct 30, 2021
@spacerest spacerest deleted the typer-cli-python branch October 30, 2021 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants