📝 Update package docs with the latest versions of Typer and Poetry (#781)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kinuax · committed by GitHub · parent a1e80f3 · Browse files · 1 file·+42 added−55 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: svlandeg <svlandeg@github.com>
Diff stats
1 file+42 added−55 removed
- other:+42 added−55 removed
Provenance
- Commit
1da8e86- Tree
0b37788- Author
Kinuax <kinuax@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
a1e80f3
1 file changed+42 added−55 removed
modified:docs/tutorial/package.md+42 added-55 removed
47 unmodified lines48 </div>49 50 ## Dependencies and environment51 52-Add `typer[all]` to your dependencies:52+Add `typer` to your dependencies:53 54 <div class="termy">55 56 ```console57-$ poetry add "typer[all]"57+$ poetry add typer58 59 // It creates a virtual environment for your project60 Creating virtualenv rick-portal-gun-w31dJa0b-py3.10 in /home/rick/.cache/pypoetry/virtualenvs61-Using version ^0.1.0 for typer61+Using version ^0.12.0 for typer62 63 Updating dependencies64 Resolving dependencies... (1.2s)65 66-Writing lock file67-66 ---> 100%67 70-Package operations: 15 installs, 0 updates, 0 removals68+Package operations: 8 installs, 0 updates, 0 removals69 72- - Installing zipp (3.1.0)73- - Installing importlib-metadata (1.5.0)74- - Installing pyparsing (2.4.6)75- - Installing six (1.14.0)76- - Installing attrs (19.3.0)77- - Installing click (7.1.1)78- - Installing colorama (0.4.3)79- - Installing more-itertools (8.2.0)80- - Installing packaging (20.3)81- - Installing pluggy (0.13.1)82- - Installing py (1.8.1)83- - Installing shellingham (1.3.2)84- - Installing wcwidth (0.1.8)85- - Installing pytest (5.4.1)86- - Installing typer (0.0.11)70+ - Installing mdurl (0.1.2)71+ - Installing markdown-it-py (3.0.0)72+ - Installing pygments (2.17.2)73+ - Installing click (8.1.7)74+ - Installing rich (13.7.1)75+ - Installing shellingham (1.5.4)76+ - Installing typing-extensions (4.11.0)77+ - Installing typer (0.12.3)78 79+Writing lock file80+81 // Activate that new virtual environment82 $ poetry shell83 84 Spawning shell within /home/rick/.cache/pypoetry/virtualenvs/rick-portal-gun-w31dJa0b-py3.1013 unmodified lines98 ├── README.md99 ├── rick_portal_gun100 │ └── __init__.py101 └── tests109- ├── __init__.py110- └── test_rick_portal_gun.py102+ └── __init__.py103 ```104 105 ## Create your app106 67 unmodified lines174 rick-portal-gun = "rick_portal_gun.main:app"175 176 [tool.poetry.dependencies]177 python = "^3.10"186-typer = {extras = ["all"], version = "^0.1.0"}178+typer = "^0.12.0"179 188-[tool.poetry.dev-dependencies]189-pytest = "^5.2"190-180 [build-system]192-requires = ["poetry>=0.12"]193-build-backend = "poetry.masonry.api"181+requires = ["poetry-core"]182+build-backend = "poetry.core.masonry.api"183 ```184 185 Here's what that line means:186 40 unmodified lines227 Installing dependencies from lock file228 229 No dependencies to install or update230 242- - Installing rick-portal-gun (0.1.0)231+ - Installing the current project: rick-portal-gun (0.1.0)232 ```233 234 </div>235 10 unmodified lines246 // You get the one from your environment247 /home/rick/.cache/pypoetry/virtualenvs/rick-portal-gun-w31dJa0b-py3.10/bin/rick-portal-gun248 249 // Try it261-$ rick-portal-gun250+$ rick-portal-gun --help251 252 // You get all the standard help253 Usage: rick-portal-gun [OPTIONS] COMMAND [ARGS]...254 25 unmodified lines280 281 Building rick-portal-gun (0.1.0)282 - Building sdist283 - Built rick-portal-gun-0.1.0.tar.gz295-284 - Building wheel285 - Built rick_portal_gun-0.1.0-py3-none-any.whl286 ```287 19 unmodified lines307 308 <div class="termy">309 310 ```console323-$ pip install --user /home/rock/code/rick-portal-gun/dist/rick_portal_gun-0.1.0-py3-none-any.whl311+$ pip install --user /home/rick/rick-portal-gun/dist/rick_portal_gun-0.1.0-py3-none-any.whl312 313 ---> 100%314 ```315 32 unmodified lines348 349 ```console350 $ rick-portal-gun --install-completion351 364-zsh completion installed in /home/user/.zshrc.352+zsh completion installed in /home/rick/.zshrc.353 Completion will take effect once you restart the terminal.354 ```355 356 </div>69 unmodified lines426 │ ├── __init__.py427 │ ├── __main__.py428 │ └── main.py429 └── tests442- ├── __init__.py443- └── test_rick_portal_gun.py430+ └── __init__.py431 ```432 433 No other file has to import it, you don't have to reference it in your `pyproject.toml` or anything else, it just works by default, as it is standard Python behavior.434 8 unmodified lines443 444 <div class="termy">445 446 ```console460-$ python -m rick_portal_gun447+$ python -m rick_portal_gun --help448 449 Usage: __main__.py [OPTIONS] COMMAND [ARGS]...450 451 Awesome Portal Gun47 unmodified lines499 500 <div class="termy">501 502 ```console516-$ python -m rick_portal_gun503+$ python -m rick_portal_gun --help504 505 Usage: rick-portal-gun [OPTIONS] COMMAND [ARGS]...506 507 Awesome Portal Gun81 unmodified lines589 590 Building rick-portal-gun (0.1.0)591 - Building sdist592 - Built rick-portal-gun-0.1.0.tar.gz606-593 - Building wheel594 - Built rick_portal_gun-0.1.0-py3-none-any.whl595 596 Publishing rick-portal-gun (0.1.0) to PyPI18 unmodified lines615 616 Found existing installation: rick-portal-gun 0.1.0617 Uninstalling rick-portal-gun-0.1.0:618 Would remove:633- /home/user/.local/bin/rick-portal-gun634- /home/user/.local/lib/python3.10/site-packages/rick_portal_gun-0.1.0.dist-info/*635- /home/user/.local/lib/python3.10/site-packages/rick_portal_gun/*636-# Proceed (y/n)? $ y619+ /home/rick/.local/bin/rick-portal-gun620+ /home/rick/.local/lib/python3.10/site-packages/rick_portal_gun-0.1.0.dist-info/*621+ /home/rick/.local/lib/python3.10/site-packages/rick_portal_gun/*622+# Proceed (Y/n)? $ Y623 Successfully uninstalled rick-portal-gun-0.1.0624 ```625 626 </div>6 unmodified lines633 $ pip install --user rick-portal-gun634 635 // Notice that it says "Downloading" 🚀636 Collecting rick-portal-gun651- Downloading rick_portal_gun-0.1.0-py3-none-any.whl (1.8 kB)652-Requirement already satisfied: typer[all]<0.0.12,>=0.0.11 in ./.local/lib/python3.10/site-packages (from rick-portal-gun) (0.0.11)653-Requirement already satisfied: click<7.2.0,>=7.1.1 in ./anaconda3/lib/python3.10/site-packages (from typer[all]<0.0.12,>=0.0.11->rick-portal-gun) (7.1.1)654-Requirement already satisfied: colorama; extra == "all" in ./anaconda3/lib/python3.10/site-packages (from typer[all]<0.0.12,>=0.0.11->rick-portal-gun) (0.4.3)655-Requirement already satisfied: shellingham; extra == "all" in ./anaconda3/lib/python3.10/site-packages (from typer[all]<0.0.12,>=0.0.11->rick-portal-gun) (1.3.1)637+ Downloading rick_portal_gun-0.1.0-py3-none-any.whl.metadata (435 bytes)638+Requirement already satisfied: typer<0.13.0,>=0.12.3 in ./.local/lib/python3.10/site-packages (from rick-portal-gun==0.1.0) (0.12.3)639+Requirement already satisfied: typing-extensions>=3.7.4.3 in ./.local/lib/python3.10/site-packages (from typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (4.11.0)640+Requirement already satisfied: click>=8.0.0 in ./.local/lib/python3.10/site-packages (from typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (8.1.7)641+Requirement already satisfied: shellingham>=1.3.0 in ./.local/lib/python3.10/site-packages (from typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (1.5.4)642+Requirement already satisfied: rich>=10.11.0 in ./.local/lib/python3.10/site-packages (from typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (13.7.1)643+Requirement already satisfied: pygments<3.0.0,>=2.13.0 in ./.local/lib/python3.10/site-packages (from rich>=10.11.0->typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (2.17.2)644+Requirement already satisfied: markdown-it-py>=2.2.0 in ./.local/lib/python3.10/site-packages (from rich>=10.11.0->typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (3.0.0)645+Requirement already satisfied: mdurl~=0.1 in ./.local/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<0.13.0,>=0.12.3->rick-portal-gun==0.1.0) (0.1.2)646+Downloading rick_portal_gun-0.1.0-py3-none-any.whl (1.8 kB)647 Installing collected packages: rick-portal-gun648 Successfully installed rick-portal-gun-0.1.0649 ```650 54 unmodified lines705 rick-portal-gun = "rick_portal_gun.main:app"706 707 [tool.poetry.dependencies]708 python = "^3.10"718-typer = {extras = ["all"], version = "^0.1.0"}709+typer = "^0.12.0"710 720-[tool.poetry.dev-dependencies]721-pytest = "^5.2"722-711 [build-system]724-requires = ["poetry>=0.12"]725-build-backend = "poetry.masonry.api"712+requires = ["poetry-core"]713+build-backend = "poetry.core.masonry.api"714 ```715 716 And in the file `rick_portal_gun/__init__.py`:717 12 unmodified lines730 731 Building rick-portal-gun (0.2.0)732 - Building sdist733 - Built rick-portal-gun-0.2.0.tar.gz746-734 - Building wheel735 - Built rick_portal_gun-0.2.0-py3-none-any.whl736 737 Publishing rick-portal-gun (0.2.0) to PyPI25 unmodified lines