From 604d698044a52438240d644df571c7a23c04dce2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Fri, 9 Aug 2024 12:19:23 -0500
Subject: [PATCH 01/31] =?UTF-8?q?=F0=9F=94=A7=20Update=20MkDocs=20previews?=
=?UTF-8?q?=20(#916)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mkdocs.insiders.yml | 2 +-
mkdocs.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdocs.insiders.yml b/mkdocs.insiders.yml
index c1568000e2..80d2d4b640 100644
--- a/mkdocs.insiders.yml
+++ b/mkdocs.insiders.yml
@@ -4,4 +4,4 @@ markdown_extensions:
material.extensions.preview:
targets:
include:
- - ./*
+ - "*"
diff --git a/mkdocs.yml b/mkdocs.yml
index 707c9a52f7..25fbba421e 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -36,7 +36,7 @@ theme:
- navigation.indexes
- navigation.instant
- navigation.instant.prefetch
- - navigation.instant.preview
+ # - navigation.instant.preview
- navigation.instant.progress
- navigation.path
# - navigation.tabs
From 788bb2570623067bea573c97192c68b604c8f7bb Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 9 Aug 2024 17:19:56 +0000
Subject: [PATCH 02/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index c6687d72df..117d3f9f7f 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
### Internal
+* π§ Update MkDocs previews. PR [#916](https://github.com/tiangolo/typer/pull/916) by [@tiangolo](https://github.com/tiangolo).
* π· Upgrade build docs configs. PR [#914](https://github.com/tiangolo/typer/pull/914) by [@tiangolo](https://github.com/tiangolo).
* π§ Update MkDocs to have titles in Markdown files instead of config. PR [#913](https://github.com/tiangolo/typer/pull/913) by [@tiangolo](https://github.com/tiangolo).
* π· Add alls-green for test-redistribute. PR [#911](https://github.com/tiangolo/typer/pull/911) by [@tiangolo](https://github.com/tiangolo).
From a06f0bc93d3c8ef610b56a1de0766e6944df7140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Fri, 9 Aug 2024 16:30:05 -0500
Subject: [PATCH 03/31] =?UTF-8?q?=F0=9F=93=9D=20Add=20docs=20for=20team=20?=
=?UTF-8?q?and=20repo=20management=20(#917)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
data/members.yml | 3 +
docs/about/index.md | 3 +
docs/css/custom.css | 40 ++++++++++++++
docs/management-tasks.md | 115 +++++++++++++++++++++++++++++++++++++++
docs/management.md | 45 +++++++++++++++
docs/resources/index.md | 3 +
docs/tutorial/index.md | 8 ++-
mkdocs.yml | 20 +++++--
8 files changed, 231 insertions(+), 6 deletions(-)
create mode 100644 data/members.yml
create mode 100644 docs/about/index.md
create mode 100644 docs/management-tasks.md
create mode 100644 docs/management.md
create mode 100644 docs/resources/index.md
diff --git a/data/members.yml b/data/members.yml
new file mode 100644
index 0000000000..2c30d19420
--- /dev/null
+++ b/data/members.yml
@@ -0,0 +1,3 @@
+members:
+- login: tiangolo
+- login: svlandeg
diff --git a/docs/about/index.md b/docs/about/index.md
new file mode 100644
index 0000000000..1688bf193d
--- /dev/null
+++ b/docs/about/index.md
@@ -0,0 +1,3 @@
+# About
+
+About **Typer**, its design, inspiration, and more. π€
diff --git a/docs/css/custom.css b/docs/css/custom.css
index 65265a5389..200ac45cd6 100644
--- a/docs/css/custom.css
+++ b/docs/css/custom.css
@@ -29,3 +29,43 @@ a.internal-link::after {
.shadow {
box-shadow: 5px 5px 10px #999;
}
+
+.user-list {
+ display: flex;
+ flex-wrap: wrap;
+ margin-bottom: 2rem;
+}
+
+.user-list-center {
+ justify-content: space-evenly;
+}
+
+.user {
+ margin: 1em;
+ min-width: 7em;
+}
+
+.user .avatar-wrapper {
+ width: 80px;
+ height: 80px;
+ margin: 10px auto;
+ overflow: hidden;
+ border-radius: 50%;
+ position: relative;
+}
+
+.user .avatar-wrapper img {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+
+.user .title {
+ text-align: center;
+}
+
+.user .count {
+ font-size: 80%;
+ text-align: center;
+}
diff --git a/docs/management-tasks.md b/docs/management-tasks.md
new file mode 100644
index 0000000000..e53bb28b6c
--- /dev/null
+++ b/docs/management-tasks.md
@@ -0,0 +1,115 @@
+# Repository Management Tasks
+
+These are the tasks that can be performed to manage the Typer repository by [team members](./management.md#team){.internal-link target=_blank}.
+
+/// tip
+
+This section is useful only to a handful of people, team members with permissions to manage the repository. You can probably skip it. π
+
+///
+
+...so, you are a [team member of Typer](./management.md#team){.internal-link target=_blank}? Wow, you are so cool! π
+
+You can help with everything on [Help Typer - Get Help](./help-typer.md){.internal-link target=_blank} the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.
+
+Here are the general instructions for the tasks you can perform.
+
+Thanks a lot for your help. π
+
+## Be Nice
+
+First of all, be nice. π
+
+You probably are super nice if you were added to the team, but it's worth mentioning it. π€
+
+### When Things are Difficult
+
+When things are great, everything is easier, so that doesn't need much instructions. But when things are difficult, here are some guidelines.
+
+Try to find the good side. In general, if people are not being unfriendly, try to thank their effort and interest, even if you disagree with the main subject (discussion, PR), just thank them for being interested in the project, or for having dedicated some time to try to do something.
+
+It's difficult to convey emotion in text, use emojis to help. π
+
+In discussions and PRs, in many cases, people bring their frustration and show it without filter, in many cases exaggerating, complaining, being entitled, etc. That's really not nice, and when it happens, it lowers our priority to solve their problems. But still, try to breath, and be gentle with your answers.
+
+Try to avoid using bitter sarcasm or potentially passive-aggressive comments. If something is wrong, it's better to be direct (try to be gentle) than sarcastic.
+
+Try to be as specific and objective as possible, avoid generalizations.
+
+For conversations that are more difficult, for example to reject a PR, you can ask me (@tiangolo) to handle it directly.
+
+## Edit PR Titles
+
+* Edit the PR title to start with an emoji from gitmoji.
+ * Use the emoji character, not the GitHub code. So, use `π` instead of `:bug:`. This is so that it shows up correctly outside of GitHub, for example in the release notes.
+* Start the title with a verb. For example `Add`, `Refactor`, `Fix`, etc. This way the title will say the action that the PR does. Like `Add support for teleporting`, instead of `Teleporting wasn't working, so this PR fixes it`.
+* Edit the text of the PR title to start in "imperative", like giving an order. So, instead of `Adding support for teleporting` use `Add support for teleporting`.
+* Try to make the title descriptive about what it achieves. If it's a feature, try to describe it, for example `Add support for teleporting` instead of `Create TeleportAdapter class`.
+* Do not finish the title with a period (`.`).
+
+Once the PR is merged, a GitHub Action (latest-changes) will use the PR title to update the latest changes automatically.
+
+So, having a nice PR title will not only look nice in GitHub, but also in the release notes. π
+
+## Add Labels to PRs
+
+The same GitHub Action latest-changes uses one label in the PR to decide the section in the release notes to put this PR in.
+
+Make sure you use a supported label from the latest-changes list of labels:
+
+* `breaking`: Breaking Changes
+ * Existing code will break if they update the version without changing their code. This rarely happens, so this label is not frequently used.
+* `security`: Security Fixes
+ * This is for security fixes, like vulnerabilities. It would almost never be used.
+* `feature`: Features
+ * New features, adding support for things that didn't exist before.
+* `bug`: Fixes
+ * Something that was supported didn't work, and this fixes it. There are many PRs that claim to be bug fixes because the user is doing something in an unexpected way that is not supported, but they considered it what should be supported by default. Many of these are actually features or refactors. But in some cases there's an actual bug.
+* `refactor`: Refactors
+ * This is normally for changes to the internal code that don't change the behavior. Normally it improves maintainability, or enables future features, etc.
+* `upgrade`: Upgrades
+ * This is for upgrades to direct dependencies from the project, or extra optional dependencies, normally in `pyproject.toml`. So, things that would affect final users, they would end up receiving the upgrade in their code base once they update. But this is not for upgrades to internal dependencies used for development, testing, docs, etc. Those internal dependencies, normally in `requirements.txt` files or GitHub Action versions should be marked as `internal`, not `upgrade`.
+* `docs`: Docs
+ * Changes in docs. This includes updating the docs, fixing typos. But it doesn't include changes to translations.
+ * You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with `docs/en/docs`. The original version of the docs is always in English, so in `docs/en/docs`.
+* `internal`: Internal
+ * Use this for changes that only affect how the repo is managed. For example upgrades to internal dependencies, changes in GitHub Actions or scripts, etc.
+
+/// tip
+
+Some tools like Dependabot, will add some labels, like `dependencies`, but have in mind that this label is not used by the `latest-changes` GitHub Action, so it won't be used in the release notes. Please make sure one of the labels above is added.
+
+///
+
+## Review PRs
+
+If a PR doesn't explain what it does or why, ask for more information.
+
+A PR should have a specific use case that it is solving.
+
+* If the PR is for a feature, it should have docs.
+ * Unless it's a feature we want to discourage, like support for a corner case that we don't want users to use.
+* The docs should include a source example file, not write Python directly in Markdown.
+* If the source example(s) file can have different syntax for Python 3.8, 3.9, 3.10, there should be different versions of the file, and they should be shown in tabs in the docs.
+* There should be tests testing the source example.
+* Before the PR is applied, the new tests should fail.
+* After applying the PR, the new tests should pass.
+* Coverage should stay at 100%.
+* If you see the PR makes sense, or we discussed it and considered it should be accepted, you can add commits on top of the PR to tweak it, to add docs, tests, format, refactor, remove extra files, etc.
+* Feel free to comment in the PR to ask for more information, to suggest changes, etc.
+* Once you think the PR is ready, move it in the internal GitHub project for me to review it.
+
+## Dependabot PRs
+
+Dependabot will create PRs to update dependencies for several things, and those PRs all look similar, but some are way more delicate than others.
+
+* If the PR is for a direct dependency, so, Dependabot is modifying `pyproject.toml`, **don't merge it**. π± Let me check it first. There's a good chance that some additional tweaks or updates are needed.
+* If the PR updates one of the internal dependencies, for example it's modifying `requirements.txt` files, or GitHub Action versions, if the tests are passing, the release notes (shown in a summary in the PR) don't show any obvious potential breaking change, you can merge it. π
+
+## Mark GitHub Discussions Answers
+
+When a question in GitHub Discussions has been answered, mark the answer by clicking "Mark as answer".
+
+Many of the current Discussion Questions were migrated from old issues. Many have the label `answered`, that means they were answered when they were issues, but now in GitHub Discussions, it's not known what is the actual response from the messages.
+
+You can filter discussions by `Questions` that are `Unanswered`.
diff --git a/docs/management.md b/docs/management.md
new file mode 100644
index 0000000000..5c1f66e90c
--- /dev/null
+++ b/docs/management.md
@@ -0,0 +1,45 @@
+# Repository Management
+
+Here's a short description of how the Typer repository is managed and maintained.
+
+## Owner
+
+I, @tiangolo, am the creator and owner of the Typer repository. π€
+
+I normally give the final review to each PR before merging them. I make the final decisions on the project, I'm the BDFL. π
+
+## Team
+
+There's a team of people that help manage and maintain the project. π
+
+They have different levels of permissions and [specific instructions](./management-tasks.md){.internal-link target=_blank}.
+
+Some of the tasks they can perform include:
+
+* Adding labels to PRs.
+* Editing PR titles.
+* Adding commits on top of PRs to tweak them.
+* Mark answers in GitHub Discussions questions, etc.
+* Merge some specific types of PRs.
+
+Joining the team is by invitation only, and I could update or remove permissions, instructions, or membership.
+
+### Team Members
+
+This is the current list of team members. π
+
+
+{% for user in members["members"] %}
+
+
+{% endfor %}
+
+
+
+Additional to them, there's a large community of people helping each other and getting involved in the projects in different ways.
+
+## External Contributions
+
+External contributions are very welcome and appreciated, including answering questions, submitting PRs, etc. πββοΈ
+
+There are many ways to [help maintain Typer](./help-typer.md){.internal-link target=_blank}.
diff --git a/docs/resources/index.md b/docs/resources/index.md
new file mode 100644
index 0000000000..d233a7833b
--- /dev/null
+++ b/docs/resources/index.md
@@ -0,0 +1,3 @@
+# Resources
+
+Additional resources, how to **help** and get help, how to **contribute**, and more. βοΈ
diff --git a/docs/tutorial/index.md b/docs/tutorial/index.md
index 8051465b10..c8ea8a1cb5 100644
--- a/docs/tutorial/index.md
+++ b/docs/tutorial/index.md
@@ -1,4 +1,10 @@
-# Tutorial - User Guide
+# Learn
+
+Learn how to use **Typer** in this step-by-step **Tutorial** - **User Guide**.
+
+It covers everything you need to know from the **simplest scripts** to **complex CLI applications**.
+
+You could consider this a **book**, a **course**, the **official** and recommended way to learn **Typer**. π
## Python types
diff --git a/mkdocs.yml b/mkdocs.yml
index 25fbba421e..4004de1556 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -39,8 +39,8 @@ theme:
# - navigation.instant.preview
- navigation.instant.progress
- navigation.path
- # - navigation.tabs
- # - navigation.tabs.sticky
+ - navigation.tabs
+ - navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
@@ -60,6 +60,9 @@ plugins:
search:
social:
# Other plugins
+ macros:
+ include_yaml:
+ - members: data/members.yml
redirects:
redirect_maps:
typer-cli.md: tutorial/typer-command.md
@@ -129,9 +132,15 @@ nav:
- tutorial/package.md
- tutorial/exceptions.md
- tutorial/typer-command.md
- - alternatives.md
- - help-typer.md
- - contributing.md
+ - Resources:
+ - resources/index.md
+ - help-typer.md
+ - contributing.md
+ - management-tasks.md
+ - About:
+ - about/index.md
+ - alternatives.md
+ - management.md
- release-notes.md
markdown_extensions:
@@ -173,6 +182,7 @@ markdown_extensions:
- warning
# Custom types
- info
+ - check
pymdownx.blocks.details:
pymdownx.blocks.tab:
alternate_style: True
From 23ed7b5af6cb4c6eacb5250e4d6ac9fd1f455723 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 9 Aug 2024 21:30:22 +0000
Subject: [PATCH 04/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 117d3f9f7f..f42eadcf61 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -6,6 +6,10 @@
* β¨ Add support for Python 3.12, tests in CI and official marker. PR [#807](https://github.com/tiangolo/typer/pull/807) by [@ivantodorovich](https://github.com/ivantodorovich).
+### Docs
+
+* π Add docs for team and repo management. PR [#917](https://github.com/tiangolo/typer/pull/917) by [@tiangolo](https://github.com/tiangolo).
+
### Internal
* π§ Update MkDocs previews. PR [#916](https://github.com/tiangolo/typer/pull/916) by [@tiangolo](https://github.com/tiangolo).
From 53ccae1902e83ebf1949e931046b382013828f3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Fri, 9 Aug 2024 16:31:24 -0500
Subject: [PATCH 05/31] =?UTF-8?q?=F0=9F=94=A8=20Update=20docs.py=20script?=
=?UTF-8?q?=20to=20enable=20dirty=20reload=20conditionally=20(#918)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scripts/docs.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/scripts/docs.py b/scripts/docs.py
index 3a3ef7f062..acd3b30fff 100644
--- a/scripts/docs.py
+++ b/scripts/docs.py
@@ -78,7 +78,7 @@ def verify_readme() -> None:
@app.command()
-def live() -> None:
+def live(dirty: bool = False) -> None:
"""
Serve with livereload a docs site for a specific language.
@@ -89,11 +89,10 @@ def live() -> None:
en.
"""
# Enable line numbers during local development to make it easier to highlight
- subprocess.run(
- ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008", "--dirty"],
- env={**os.environ, "LINENUMS": "true"},
- check=True,
- )
+ args = ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008"]
+ if dirty:
+ args.append("--dirty")
+ subprocess.run(args, env={**os.environ, "LINENUMS": "true"}, check=True)
@app.command()
From 03727bb79a1e333ae828f5ff37f80932f08c0a0c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 9 Aug 2024 21:35:34 +0000
Subject: [PATCH 06/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index f42eadcf61..f693e7d4fa 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -12,6 +12,7 @@
### Internal
+* π¨ Update docs.py script to enable dirty reload conditionally. PR [#918](https://github.com/tiangolo/typer/pull/918) by [@tiangolo](https://github.com/tiangolo).
* π§ Update MkDocs previews. PR [#916](https://github.com/tiangolo/typer/pull/916) by [@tiangolo](https://github.com/tiangolo).
* π· Upgrade build docs configs. PR [#914](https://github.com/tiangolo/typer/pull/914) by [@tiangolo](https://github.com/tiangolo).
* π§ Update MkDocs to have titles in Markdown files instead of config. PR [#913](https://github.com/tiangolo/typer/pull/913) by [@tiangolo](https://github.com/tiangolo).
From e3be56b51cf5cd17fb70e4f0c95bc66154280d88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Fri, 9 Aug 2024 17:20:13 -0500
Subject: [PATCH 07/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20links,=20f?=
=?UTF-8?q?rom=20tiangolo=20to=20new=20fastapi=20org=20(#919)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/ISSUE_TEMPLATE/config.yml | 6 +++---
.github/ISSUE_TEMPLATE/privileged.yml | 2 +-
CITATION.cff | 2 +-
README.md | 14 +++++++-------
docs/help-typer.md | 16 ++++++++--------
docs/index.md | 14 +++++++-------
docs/management-tasks.md | 2 +-
docs/tutorial/subcommands/index.md | 6 +++---
mkdocs.yml | 6 +++---
pyproject.toml | 2 +-
typer-cli/README.md | 14 +++++++-------
11 files changed, 42 insertions(+), 42 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index aede7ea1a7..8e589cd6ab 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -4,10 +4,10 @@ contact_links:
about: Please report security vulnerabilities to security@tiangolo.com
- name: Question or Problem
about: Ask a question or ask about a problem in GitHub Discussions.
- url: https://github.com/tiangolo/typer/discussions/categories/questions
+ url: https://github.com/fastapi/typer/discussions/categories/questions
- name: Feature Request
about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.
- url: https://github.com/tiangolo/typer/discussions/categories/questions
+ url: https://github.com/fastapi/typer/discussions/categories/questions
- name: Show and tell
about: Show what you built with Typer or to be used with Typer.
- url: https://github.com/tiangolo/typer/discussions/categories/show-and-tell
+ url: https://github.com/fastapi/typer/discussions/categories/show-and-tell
diff --git a/.github/ISSUE_TEMPLATE/privileged.yml b/.github/ISSUE_TEMPLATE/privileged.yml
index f8acd76f2e..8037408426 100644
--- a/.github/ISSUE_TEMPLATE/privileged.yml
+++ b/.github/ISSUE_TEMPLATE/privileged.yml
@@ -6,7 +6,7 @@ body:
value: |
Thanks for your interest in Typer! π
- If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/tiangolo/typer/discussions/categories/questions) instead.
+ If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/fastapi/typer/discussions/categories/questions) instead.
- type: checkboxes
id: privileged
attributes:
diff --git a/CITATION.cff b/CITATION.cff
index 43da1f3c89..5fe4aa2d34 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -12,7 +12,7 @@ authors:
family-names: RamΓrez
email: tiangolo@gmail.com
identifiers:
-repository-code: 'https://github.com/tiangolo/typer'
+repository-code: 'https://github.com/fastapi/typer'
url: 'https://typer.tiangolo.com'
abstract: >-
Typer, build great CLIs. Easy to code. Based on Python type hints.
diff --git a/README.md b/README.md
index 1e9077ebe4..49b441055f 100644
--- a/README.md
+++ b/README.md
@@ -6,14 +6,14 @@
Typer, build great CLIs. Easy to code. Based on Python type hints.
-
-
+
+
-
-
+
+
-
-
+
+
@@ -23,7 +23,7 @@
**Documentation**: https://typer.tiangolo.com
-**Source Code**: https://github.com/tiangolo/typer
+**Source Code**: https://github.com/fastapi/typer
---
diff --git a/docs/help-typer.md b/docs/help-typer.md
index 11596d7024..26c5cd6474 100644
--- a/docs/help-typer.md
+++ b/docs/help-typer.md
@@ -22,13 +22,13 @@ You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](/news
## Star **Typer** in GitHub
-You can "star" Typer in GitHub (clicking the star button at the top right): https://github.com/tiangolo/typer.
+You can "star" Typer in GitHub (clicking the star button at the top right): https://github.com/fastapi/typer.
By adding a star, other users will be able to find it more easily and see that it has been already useful for others.
## Watch the GitHub repository for releases
-You can "watch" Typer in GitHub (clicking the "watch" button at the top right): https://github.com/tiangolo/typer.
+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): https://github.com/fastapi/typer.
There you can select "Releases only".
@@ -54,7 +54,7 @@ You can:
## Tweet about **Typer**
-Tweet about **Typer** and let me and others know why you like it.
+Tweet about **Typer** and let me and others know why you like it.
I love to hear about how **Typer** is being used, what have you liked in it, in which project/company you are using it, etc.
@@ -62,8 +62,8 @@ I love to hear about how **Typer** is being used, what have you liked in it, in
You can try and help others with their questions in:
-* GitHub Discussions
-* GitHub Issues
+* GitHub Discussions
+* GitHub Issues
In many cases you might already know the answer for those questions. π€
@@ -112,7 +112,7 @@ If they reply, there's a high chance you would have solved their problem, congra
## Watch the GitHub repository
-You can "watch" Typer in GitHub (clicking the "watch" button at the top right): https://github.com/tiangolo/typer.
+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): https://github.com/fastapi/typer.
If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, or discussions, or PRs, etc.
@@ -120,7 +120,7 @@ Then you can try and help them solve those questions.
## Ask Questions
-You can create a new question in the GitHub repository, for example to:
+You can create a new question in the GitHub repository, for example to:
* Ask a **question** or ask about a **problem**.
* Suggest a new **feature**.
@@ -214,7 +214,7 @@ Join the π₯ GitHub Discussions, there's a much better chance you will receive help there.
+For questions, ask them in GitHub Discussions, there's a much better chance you will receive help there.
Use the chat only for other general conversations.
diff --git a/docs/index.md b/docs/index.md
index d8a6addb5f..9996f64800 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -12,14 +12,14 @@
Typer, build great CLIs. Easy to code. Based on Python type hints.
-
-
+
+
-
-
+
+
-
-
+
+
@@ -29,7 +29,7 @@
**Documentation**: https://typer.tiangolo.com
-**Source Code**: https://github.com/tiangolo/typer
+**Source Code**: https://github.com/fastapi/typer
---
diff --git a/docs/management-tasks.md b/docs/management-tasks.md
index e53bb28b6c..879e0a0c3f 100644
--- a/docs/management-tasks.md
+++ b/docs/management-tasks.md
@@ -112,4 +112,4 @@ When a question in GitHub Discussions has been answered, mark the answer by clic
Many of the current Discussion Questions were migrated from old issues. Many have the label `answered`, that means they were answered when they were issues, but now in GitHub Discussions, it's not known what is the actual response from the messages.
-You can filter discussions by `Questions` that are `Unanswered`.
+You can filter discussions by `Questions` that are `Unanswered`.
diff --git a/docs/tutorial/subcommands/index.md b/docs/tutorial/subcommands/index.md
index 86df1af904..b20e21b578 100644
--- a/docs/tutorial/subcommands/index.md
+++ b/docs/tutorial/subcommands/index.md
@@ -23,7 +23,7 @@ origin git@github.com:yourusername/typer.git (fetch)
origin git@github.com:yourusername/typer.git (push)
// git remote add takes 2 CLI arguments, a name and URL
-$ git remote add upstream https://github.com/tiangolo/typer.git
+$ git remote add upstream https://github.com/fastapi/typer.git
// Doesn't output anything, but now you have another remote repository called upstream
@@ -32,8 +32,8 @@ $ git remote -v
origin git@github.com:yourusername/typer.git (fetch)
origin git@github.com:yourusername/typer.git (push)
-upstream https://github.com/tiangolo/typer.git (fetch)
-upstream https://github.com/tiangolo/typer.git (push)
+upstream https://github.com/fastapi/typer.git (fetch)
+upstream https://github.com/fastapi/typer.git (push)
```
diff --git a/mkdocs.yml b/mkdocs.yml
index 4004de1556..cf15b162d9 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -53,8 +53,8 @@ theme:
logo: img/icon.svg
favicon: img/favicon.png
language: en
-repo_name: tiangolo/typer
-repo_url: https://github.com/tiangolo/typer
+repo_name: fastapi/typer
+repo_url: https://github.com/fastapi/typer
plugins:
# Material for MkDocs
search:
@@ -210,7 +210,7 @@ extra:
Thanks for your feedback!
social:
- icon: fontawesome/brands/github-alt
- link: https://github.com/tiangolo/typer
+ link: https://github.com/fastapi/typer
- icon: fontawesome/brands/twitter
link: https://twitter.com/tiangolo
- icon: fontawesome/brands/linkedin
diff --git a/pyproject.toml b/pyproject.toml
index c69e7c190c..4508359417 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -39,7 +39,7 @@ dependencies = [
readme = "README.md"
[project.urls]
Documentation = "https://typer.tiangolo.com/"
-homepage = "https://github.com/tiangolo/typer"
+homepage = "https://github.com/fastapi/typer"
[project.optional-dependencies]
standard = [
diff --git a/typer-cli/README.md b/typer-cli/README.md
index 0ebe65102c..d4700f743a 100644
--- a/typer-cli/README.md
+++ b/typer-cli/README.md
@@ -5,14 +5,14 @@
Typer, build great CLIs. Easy to code. Based on Python type hints.
-
-
+
+
-
-
+
+
-
-
+
+
@@ -22,7 +22,7 @@
**Documentation**: https://typer.tiangolo.com/tutorial/typer-command/
-**Source Code**: https://github.com/tiangolo/typer
+**Source Code**: https://github.com/fastapi/typer
---
From dd43e3a8d5cb62f4e70f311a5a243480745a3e99 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 9 Aug 2024 22:20:30 +0000
Subject: [PATCH 08/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index f693e7d4fa..2fb4e18404 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
### Docs
+* π Update docs links, from tiangolo to new fastapi org. PR [#919](https://github.com/fastapi/typer/pull/919) by [@tiangolo](https://github.com/tiangolo).
* π Add docs for team and repo management. PR [#917](https://github.com/tiangolo/typer/pull/917) by [@tiangolo](https://github.com/tiangolo).
### Internal
From bc7954c8962a6e0ee5c631788e8953a299aeb59e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 12 Aug 2024 21:11:50 -0500
Subject: [PATCH 09/31] =?UTF-8?q?=F0=9F=91=B7=20Add=20GitHub=20Action=20ad?=
=?UTF-8?q?d-to-project=20(#922)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/add-to-project.yml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 .github/workflows/add-to-project.yml
diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml
new file mode 100644
index 0000000000..dccea83f35
--- /dev/null
+++ b/.github/workflows/add-to-project.yml
@@ -0,0 +1,18 @@
+name: Add to Project
+
+on:
+ pull_request_target:
+ issues:
+ types:
+ - opened
+ - reopened
+
+jobs:
+ add-to-project:
+ name: Add to project
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/add-to-project@v1.0.2
+ with:
+ project-url: https://github.com/orgs/fastapi/projects/2
+ github-token: ${{ secrets.PROJECTS_TOKEN }}
From b9c7014dc79695c54410690ecc229b0956cf9ec6 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 13 Aug 2024 02:12:22 +0000
Subject: [PATCH 10/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 2fb4e18404..b33d02d23f 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Add GitHub Action add-to-project. PR [#922](https://github.com/fastapi/typer/pull/922) by [@tiangolo](https://github.com/tiangolo).
* π¨ Update docs.py script to enable dirty reload conditionally. PR [#918](https://github.com/tiangolo/typer/pull/918) by [@tiangolo](https://github.com/tiangolo).
* π§ Update MkDocs previews. PR [#916](https://github.com/tiangolo/typer/pull/916) by [@tiangolo](https://github.com/tiangolo).
* π· Upgrade build docs configs. PR [#914](https://github.com/tiangolo/typer/pull/914) by [@tiangolo](https://github.com/tiangolo).
From c72ff942d4ebb22394bdbaf7974d5d30153c0348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 12 Aug 2024 21:41:33 -0500
Subject: [PATCH 11/31] =?UTF-8?q?=F0=9F=91=B7=20Add=20GitHub=20Action=20la?=
=?UTF-8?q?beler=20(#924)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/labeler.yml | 15 +++++++++++++++
.github/workflows/labeler.yml | 12 ++++++++++++
2 files changed, 27 insertions(+)
create mode 100644 .github/labeler.yml
create mode 100644 .github/workflows/labeler.yml
diff --git a/.github/labeler.yml b/.github/labeler.yml
new file mode 100644
index 0000000000..f4ee6649db
--- /dev/null
+++ b/.github/labeler.yml
@@ -0,0 +1,15 @@
+docs:
+ - changed-files:
+ - any-glob-to-any-file:
+ - docs/**/*
+ - docs_src/**/*
+
+internal:
+ - changed-files:
+ - any-glob-to-any-file:
+ - .github/**/*
+ - scripts/**/*
+ - .gitignore
+ - .pre-commit-config.yaml
+ - pdm_build.py
+ - requirements*.txt
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
new file mode 100644
index 0000000000..9cbdfda213
--- /dev/null
+++ b/.github/workflows/labeler.yml
@@ -0,0 +1,12 @@
+name: Pull Request Labeler
+on:
+ pull_request_target:
+
+jobs:
+ labeler:
+ permissions:
+ contents: read
+ pull-requests: write
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/labeler@v5
From 42ce5a6900a62d1ca2338fecc7adb2ad2e82cdb0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 13 Aug 2024 02:41:58 +0000
Subject: [PATCH 12/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index b33d02d23f..65e0dc4b9b 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Add GitHub Action labeler. PR [#924](https://github.com/fastapi/typer/pull/924) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action add-to-project. PR [#922](https://github.com/fastapi/typer/pull/922) by [@tiangolo](https://github.com/tiangolo).
* π¨ Update docs.py script to enable dirty reload conditionally. PR [#918](https://github.com/tiangolo/typer/pull/918) by [@tiangolo](https://github.com/tiangolo).
* π§ Update MkDocs previews. PR [#916](https://github.com/tiangolo/typer/pull/916) by [@tiangolo](https://github.com/tiangolo).
From 4119879db33fb5a7526c0375f7c2b40e5c81f928 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 13 Aug 2024 00:32:15 -0500
Subject: [PATCH 13/31] =?UTF-8?q?=F0=9F=91=B7=20Add=20GitHub=20Action=20la?=
=?UTF-8?q?bel-checker=20(#925)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/labeler.yml | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 9cbdfda213..7cb88936be 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -1,6 +1,13 @@
-name: Pull Request Labeler
+name: Pull Request Labeler and Checker
on:
pull_request_target:
+ types:
+ - opened
+ - synchronize
+ - reopened
+ # For label-checker
+ - labeled
+ - unlabeled
jobs:
labeler:
@@ -10,3 +17,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
+ # Run this after labeler applied labels
+ check-labels:
+ name: Check labels
+ runs-on: ubuntu-latest
+ steps:
+ - uses: docker://agilepathway/pull-request-label-checker:latest
+ with:
+ one_of: breaking,security,feature,bug,refactor,upgrade,docs,lang-all,internal
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
From dd3ba680d3fb4f74d71fa2912cc24bffbffa8a51 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 13 Aug 2024 05:32:36 +0000
Subject: [PATCH 14/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 65e0dc4b9b..2e5691cb56 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Add GitHub Action label-checker. PR [#925](https://github.com/fastapi/typer/pull/925) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action labeler. PR [#924](https://github.com/fastapi/typer/pull/924) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action add-to-project. PR [#922](https://github.com/fastapi/typer/pull/922) by [@tiangolo](https://github.com/tiangolo).
* π¨ Update docs.py script to enable dirty reload conditionally. PR [#918](https://github.com/tiangolo/typer/pull/918) by [@tiangolo](https://github.com/tiangolo).
From 70e144d95256fca098f4449e97e3df329a9b2aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 13 Aug 2024 22:53:38 -0500
Subject: [PATCH 15/31] =?UTF-8?q?=F0=9F=91=B7=20Update=20labeler=20GitHub?=
=?UTF-8?q?=20Actions=20permissions=20and=20dependencies=20(#926)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/labeler.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 7cb88936be..7c5b4616ac 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -19,6 +19,10 @@ jobs:
- uses: actions/labeler@v5
# Run this after labeler applied labels
check-labels:
+ needs:
+ - labeler
+ permissions:
+ pull-requests: read
name: Check labels
runs-on: ubuntu-latest
steps:
From 0cca55c87f85d351f64125547f3e5073ac968807 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 14 Aug 2024 03:53:57 +0000
Subject: [PATCH 16/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 2e5691cb56..2fa3963874 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Update labeler GitHub Actions permissions and dependencies. PR [#926](https://github.com/fastapi/typer/pull/926) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action label-checker. PR [#925](https://github.com/fastapi/typer/pull/925) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action labeler. PR [#924](https://github.com/fastapi/typer/pull/924) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action add-to-project. PR [#922](https://github.com/fastapi/typer/pull/922) by [@tiangolo](https://github.com/tiangolo).
From c57f1f71a999f91f4235873aa5b8abe4ee21235c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 14 Aug 2024 13:36:33 -0500
Subject: [PATCH 17/31] =?UTF-8?q?=F0=9F=91=B7=20Update=20labeler=20GitHub?=
=?UTF-8?q?=20Action=20to=20add=20only=20one=20label=20(#927)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/labeler.yml | 33 +++++++++++++++++++++------------
.github/workflows/labeler.yml | 5 +++--
2 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/.github/labeler.yml b/.github/labeler.yml
index f4ee6649db..4290a118b9 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -1,15 +1,24 @@
docs:
- - changed-files:
- - any-glob-to-any-file:
- - docs/**/*
- - docs_src/**/*
+ - all:
+ - changed-files:
+ - any-glob-to-any-file:
+ - docs/**
+ - docs_src/**
+ - all-globs-to-all-files:
+ - '!typer/**'
+ - '!pyproject.toml'
internal:
- - changed-files:
- - any-glob-to-any-file:
- - .github/**/*
- - scripts/**/*
- - .gitignore
- - .pre-commit-config.yaml
- - pdm_build.py
- - requirements*.txt
+ - all:
+ - changed-files:
+ - any-glob-to-any-file:
+ - .github/**
+ - scripts/**
+ - .gitignore
+ - .pre-commit-config.yaml
+ - pdm_build.py
+ - requirements*.txt
+ - all-globs-to-all-files:
+ - '!docs/**'
+ - '!typer/**'
+ - '!pyproject.toml'
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 7c5b4616ac..d62f1668d5 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -1,4 +1,4 @@
-name: Pull Request Labeler and Checker
+name: Labels
on:
pull_request_target:
types:
@@ -17,13 +17,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
+ with:
+ sync-labels: true
# Run this after labeler applied labels
check-labels:
needs:
- labeler
permissions:
pull-requests: read
- name: Check labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
From adca3254f8c2adc8d9b71b5cdea65c41770bd9b9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 14 Aug 2024 18:36:52 +0000
Subject: [PATCH 18/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 2fa3963874..c1c1c6996d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Update labeler GitHub Action to add only one label. PR [#927](https://github.com/fastapi/typer/pull/927) by [@tiangolo](https://github.com/tiangolo).
* π· Update labeler GitHub Actions permissions and dependencies. PR [#926](https://github.com/fastapi/typer/pull/926) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action label-checker. PR [#925](https://github.com/fastapi/typer/pull/925) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action labeler. PR [#924](https://github.com/fastapi/typer/pull/924) by [@tiangolo](https://github.com/tiangolo).
From 20b28c8f2416811a4cbdcd8baed222638232c74a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 15 Aug 2024 13:42:11 -0500
Subject: [PATCH 19/31] =?UTF-8?q?=F0=9F=91=B7=20Do=20not=20sync=20labels?=
=?UTF-8?q?=20as=20it=20overrides=20manually=20added=20labels=20(#930)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/labeler.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index d62f1668d5..c3bb83f9a5 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -17,8 +17,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
- with:
- sync-labels: true
# Run this after labeler applied labels
check-labels:
needs:
From 7ddb7c3eb6a74797e17cd42a6f10a893bcc13498 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 15 Aug 2024 18:43:17 +0000
Subject: [PATCH 20/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index c1c1c6996d..3c3a86e1aa 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π· Do not sync labels as it overrides manually added labels. PR [#930](https://github.com/fastapi/typer/pull/930) by [@tiangolo](https://github.com/tiangolo).
* π· Update labeler GitHub Action to add only one label. PR [#927](https://github.com/fastapi/typer/pull/927) by [@tiangolo](https://github.com/tiangolo).
* π· Update labeler GitHub Actions permissions and dependencies. PR [#926](https://github.com/fastapi/typer/pull/926) by [@tiangolo](https://github.com/tiangolo).
* π· Add GitHub Action label-checker. PR [#925](https://github.com/fastapi/typer/pull/925) by [@tiangolo](https://github.com/tiangolo).
From 6e8c611be134f04dfc56ea966ae1fda11362d434 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 15 Aug 2024 15:54:17 -0500
Subject: [PATCH 21/31] =?UTF-8?q?=F0=9F=94=A7=20Add=20URLs=20to=20pyprojec?=
=?UTF-8?q?t.toml,=20show=20up=20in=20PyPI=20(#931)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 4508359417..b64b18d911 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,8 +38,11 @@ dependencies = [
]
readme = "README.md"
[project.urls]
-Documentation = "https://typer.tiangolo.com/"
-homepage = "https://github.com/fastapi/typer"
+Homepage = "https://github.com/fastapi/typer"
+Documentation = "https://typer.tiangolo.com"
+Repository = "https://github.com/fastapi/typer"
+Issues = "https://github.com/fastapi/typer/issues"
+Changelog = "https://typer.tiangolo.com/release-notes/"
[project.optional-dependencies]
standard = [
From 76ca3e3397f13993cae4a9d68cc60e51c93253d8 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 15 Aug 2024 20:54:56 +0000
Subject: [PATCH 22/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 3c3a86e1aa..78fe7c2da5 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
### Internal
+* π§ Add URLs to `pyproject.toml`, show up in PyPI. PR [#931](https://github.com/fastapi/typer/pull/931) by [@tiangolo](https://github.com/tiangolo).
* π· Do not sync labels as it overrides manually added labels. PR [#930](https://github.com/fastapi/typer/pull/930) by [@tiangolo](https://github.com/tiangolo).
* π· Update labeler GitHub Action to add only one label. PR [#927](https://github.com/fastapi/typer/pull/927) by [@tiangolo](https://github.com/tiangolo).
* π· Update labeler GitHub Actions permissions and dependencies. PR [#926](https://github.com/fastapi/typer/pull/926) by [@tiangolo](https://github.com/tiangolo).
From dcb45b1a65e80316b2b740e4f6c2968209439714 Mon Sep 17 00:00:00 2001
From: Brian Kohan
Date: Fri, 16 Aug 2024 15:20:29 -0700
Subject: [PATCH 23/31] =?UTF-8?q?=F0=9F=90=9B=20Fix=20`shell=5Fcomplete`?=
=?UTF-8?q?=20not=20working=20for=20Arguments=20(#737)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: svlandeg
---
tests/assets/completion_argument.py | 22 ++++++++++++++++++++++
tests/test_others.py | 19 +++++++++++++++++++
typer/main.py | 1 +
3 files changed, 42 insertions(+)
create mode 100644 tests/assets/completion_argument.py
diff --git a/tests/assets/completion_argument.py b/tests/assets/completion_argument.py
new file mode 100644
index 0000000000..f91e2b7cfb
--- /dev/null
+++ b/tests/assets/completion_argument.py
@@ -0,0 +1,22 @@
+import click
+import typer
+
+app = typer.Typer()
+
+
+def shell_complete(ctx: click.Context, param: click.Parameter, incomplete: str):
+ typer.echo(f"ctx: {ctx.info_name}", err=True)
+ typer.echo(f"arg is: {param.name}", err=True)
+ typer.echo(f"incomplete is: {incomplete}", err=True)
+ return ["Emma"]
+
+
+@app.command(context_settings={"auto_envvar_prefix": "TEST"})
+def main(name: str = typer.Argument(shell_complete=shell_complete)):
+ """
+ Say hello.
+ """
+
+
+if __name__ == "__main__":
+ app()
diff --git a/tests/test_others.py b/tests/test_others.py
index 8c78520029..a577369b16 100644
--- a/tests/test_others.py
+++ b/tests/test_others.py
@@ -141,6 +141,25 @@ def main(name: str = typer.Option(..., callback=name_callback)):
assert "value is: Camila" in result.stdout
+def test_completion_argument():
+ file_path = Path(__file__).parent / "assets/completion_argument.py"
+ result = subprocess.run(
+ [sys.executable, "-m", "coverage", "run", str(file_path), "E"],
+ capture_output=True,
+ encoding="utf-8",
+ env={
+ **os.environ,
+ "_COMPLETION_ARGUMENT.PY_COMPLETE": "complete_zsh",
+ "_TYPER_COMPLETE_ARGS": "completion_argument.py E",
+ "_TYPER_COMPLETE_TESTING": "True",
+ },
+ )
+ assert "Emma" in result.stdout or "_files" in result.stdout
+ assert "ctx: completion_argument" in result.stderr
+ assert "arg is: name" in result.stderr
+ assert "incomplete is: E" in result.stderr
+
+
def test_completion_untyped_parameters():
file_path = Path(__file__).parent / "assets/completion_no_types.py"
result = subprocess.run(
diff --git a/typer/main.py b/typer/main.py
index 9db26975ca..c853f1e740 100644
--- a/typer/main.py
+++ b/typer/main.py
@@ -947,6 +947,7 @@ def get_click_param(
expose_value=parameter_info.expose_value,
is_eager=parameter_info.is_eager,
envvar=parameter_info.envvar,
+ shell_complete=parameter_info.shell_complete,
autocompletion=get_param_completion(parameter_info.autocompletion),
# Rich settings
rich_help_panel=parameter_info.rich_help_panel,
From 4efe1bcffef828e79237afa39b8ff6fa7267a912 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 16 Aug 2024 22:20:48 +0000
Subject: [PATCH 24/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 78fe7c2da5..a2b052b25d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -6,6 +6,10 @@
* β¨ Add support for Python 3.12, tests in CI and official marker. PR [#807](https://github.com/tiangolo/typer/pull/807) by [@ivantodorovich](https://github.com/ivantodorovich).
+### Fixes
+
+* π Fix `shell_complete` not working for Arguments. PR [#737](https://github.com/fastapi/typer/pull/737) by [@bckohan](https://github.com/bckohan).
+
### Docs
* π Update docs links, from tiangolo to new fastapi org. PR [#919](https://github.com/fastapi/typer/pull/919) by [@tiangolo](https://github.com/tiangolo).
From ca65b366b70c170743a2e3715fb5bef8b045da09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?=
Date: Fri, 16 Aug 2024 19:54:32 -0300
Subject: [PATCH 25/31] =?UTF-8?q?=F0=9F=90=9B=20Fix=20usage=20of=20`Annota?=
=?UTF-8?q?ted`=20with=20future=20annotations=20in=20Python=203.7+=20(#814?=
=?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: svlandeg
---
tests/test_future_annotations.py | 26 ++++++++++++++++++++++++++
typer/utils.py | 4 ++--
2 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 tests/test_future_annotations.py
diff --git a/tests/test_future_annotations.py b/tests/test_future_annotations.py
new file mode 100644
index 0000000000..e820cd0923
--- /dev/null
+++ b/tests/test_future_annotations.py
@@ -0,0 +1,26 @@
+from __future__ import annotations
+
+import typer
+from typer.testing import CliRunner
+from typing_extensions import Annotated
+
+runner = CliRunner()
+
+
+def test_annotated():
+ app = typer.Typer()
+
+ @app.command()
+ def cmd(force: Annotated[bool, typer.Option("--force")] = False):
+ if force:
+ print("Forcing operation")
+ else:
+ print("Not forcing")
+
+ result = runner.invoke(app)
+ assert result.exit_code == 0, result.output
+ assert "Not forcing" in result.output
+
+ result = runner.invoke(app, ["--force"])
+ assert result.exit_code == 0, result.output
+ assert "Forcing operation" in result.output
diff --git a/typer/utils.py b/typer/utils.py
index 2ba7bace45..5c0e967a64 100644
--- a/typer/utils.py
+++ b/typer/utils.py
@@ -1,9 +1,9 @@
import inspect
import sys
from copy import copy
-from typing import Any, Callable, Dict, List, Tuple, Type, cast, get_type_hints
+from typing import Any, Callable, Dict, List, Tuple, Type, cast
-from typing_extensions import Annotated
+from typing_extensions import Annotated, get_type_hints
from ._typing import get_args, get_origin
from .models import ArgumentInfo, OptionInfo, ParameterInfo, ParamMeta
From 90f3e61d0858eb80926dbd547fcd509726e219a0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Fri, 16 Aug 2024 22:54:52 +0000
Subject: [PATCH 26/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index a2b052b25d..607875fb5f 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
### Fixes
+* π Fix usage of `Annotated` with future annotations in Python 3.7+. PR [#814](https://github.com/fastapi/typer/pull/814) by [@ivantodorovich](https://github.com/ivantodorovich).
* π Fix `shell_complete` not working for Arguments. PR [#737](https://github.com/fastapi/typer/pull/737) by [@bckohan](https://github.com/bckohan).
### Docs
From 640fb09c6de03829a51ebc8bdab49618c5083c44 Mon Sep 17 00:00:00 2001
From: Alex Jurkiewicz
Date: Sat, 17 Aug 2024 09:34:24 +0800
Subject: [PATCH 27/31] =?UTF-8?q?=F0=9F=90=9B=20Fix=20`zsh`=20autocompleti?=
=?UTF-8?q?on=20installation=20(#237)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: svlandeg
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: SebastiΓ‘n RamΓrez
---
typer/_completion_shared.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/typer/_completion_shared.py b/typer/_completion_shared.py
index 10de54420d..a5ff7b196a 100644
--- a/typer/_completion_shared.py
+++ b/typer/_completion_shared.py
@@ -128,16 +128,16 @@ def install_zsh(*, prog_name: str, complete_var: str, shell: str) -> Path:
zshrc_content = ""
if zshrc_path.is_file():
zshrc_content = zshrc_path.read_text()
- completion_init_lines = [
- "autoload -Uz compinit",
- "compinit",
- "zstyle ':completion:*' menu select",
- "fpath+=~/.zfunc",
- ]
- for line in completion_init_lines:
- if line not in zshrc_content: # pragma: no cover
- zshrc_content += f"\n{line}"
- zshrc_content += "\n"
+ completion_line = "fpath+=~/.zfunc; autoload -Uz compinit; compinit"
+ if completion_line not in zshrc_content:
+ zshrc_content += f"\n{completion_line}\n"
+ style_line = "zstyle ':completion:*' menu select"
+ # TODO: consider setting the style only for the current program
+ # style_line = f"zstyle ':completion:*:*:{prog_name}:*' menu select"
+ # Install zstyle completion config only if the user doesn't have a customization
+ if "zstyle" not in zshrc_content:
+ zshrc_content += f"\n{style_line}\n"
+ zshrc_content = f"{zshrc_content.strip()}\n"
zshrc_path.write_text(zshrc_content)
# Install completion under ~/.zfunc/
path_obj = Path.home() / f".zfunc/_{prog_name}"
From ad421bdf47deea882ac8a7ad194ce81545f47f6f Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 17 Aug 2024 01:34:46 +0000
Subject: [PATCH 28/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 607875fb5f..701f1c0a82 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
### Fixes
+* π Fix `zsh` autocompletion installation. PR [#237](https://github.com/fastapi/typer/pull/237) by [@alexjurkiewicz](https://github.com/alexjurkiewicz).
* π Fix usage of `Annotated` with future annotations in Python 3.7+. PR [#814](https://github.com/fastapi/typer/pull/814) by [@ivantodorovich](https://github.com/ivantodorovich).
* π Fix `shell_complete` not working for Arguments. PR [#737](https://github.com/fastapi/typer/pull/737) by [@bckohan](https://github.com/bckohan).
From 218bf89ab53858e2b55c292a5f8c7b2ec1b20a2b Mon Sep 17 00:00:00 2001
From: "Jonas L. B."
Date: Sat, 17 Aug 2024 04:22:43 +0200
Subject: [PATCH 29/31] =?UTF-8?q?=F0=9F=90=9B=20Fix=20support=20for=20`Uni?=
=?UTF-8?q?onType`=20(e.g.=20`str=20|=20None`)=20with=20Python=203.11=20(#?=
=?UTF-8?q?548)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: svlandeg
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
tests/test_type_conversion.py | 22 ++++++++++++++++++++++
typer/main.py | 28 +++++++++++++++-------------
2 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/tests/test_type_conversion.py b/tests/test_type_conversion.py
index 51e83314de..904a686d2e 100644
--- a/tests/test_type_conversion.py
+++ b/tests/test_type_conversion.py
@@ -7,6 +7,8 @@
import typer
from typer.testing import CliRunner
+from .utils import needs_py310
+
runner = CliRunner()
@@ -29,6 +31,26 @@ def opt(user: Optional[str] = None):
assert "User: Camila" in result.output
+@needs_py310
+def test_union_type_optional():
+ app = typer.Typer()
+
+ @app.command()
+ def opt(user: str | None = None):
+ if user:
+ print(f"User: {user}")
+ else:
+ print("No user")
+
+ result = runner.invoke(app)
+ assert result.exit_code == 0
+ assert "No user" in result.output
+
+ result = runner.invoke(app, ["--user", "Camila"])
+ assert result.exit_code == 0
+ assert "User: Camila" in result.output
+
+
def test_optional_tuple():
app = typer.Typer()
diff --git a/typer/main.py b/typer/main.py
index c853f1e740..f7d634d8bc 100644
--- a/typer/main.py
+++ b/typer/main.py
@@ -13,6 +13,7 @@
import click
+from ._typing import get_args, get_origin, is_union
from .completion import get_completion_inspect_parameters
from .core import MarkupMode, TyperArgument, TyperCommand, TyperGroup, TyperOption
from .models import (
@@ -825,30 +826,31 @@ def get_click_param(
is_tuple = False
parameter_type: Any = None
is_flag = None
- origin = getattr(main_type, "__origin__", None)
+ origin = get_origin(main_type)
+
if origin is not None:
- # Handle Optional[SomeType]
- if origin is Union:
+ # Handle SomeType | None and Optional[SomeType]
+ if is_union(origin):
types = []
- for type_ in main_type.__args__:
+ for type_ in get_args(main_type):
if type_ is NoneType:
continue
types.append(type_)
assert len(types) == 1, "Typer Currently doesn't support Union types"
main_type = types[0]
- origin = getattr(main_type, "__origin__", None)
+ origin = get_origin(main_type)
# Handle Tuples and Lists
if lenient_issubclass(origin, List):
- main_type = main_type.__args__[0]
- assert not getattr(
- main_type, "__origin__", None
+ main_type = get_args(main_type)[0]
+ assert not get_origin(
+ main_type
), "List types with complex sub-types are not currently supported"
is_list = True
elif lenient_issubclass(origin, Tuple): # type: ignore
types = []
- for type_ in main_type.__args__:
- assert not getattr(
- type_, "__origin__", None
+ for type_ in get_args(main_type):
+ assert not get_origin(
+ type_
), "Tuple types with complex sub-types are not currently supported"
types.append(
get_click_type(annotation=type_, parameter_info=parameter_info)
@@ -865,7 +867,7 @@ def get_click_param(
convertor=convertor, default_value=default_value
)
if is_tuple:
- convertor = generate_tuple_convertor(main_type.__args__)
+ convertor = generate_tuple_convertor(get_args(main_type))
if isinstance(parameter_info, OptionInfo):
if main_type is bool and parameter_info.is_flag is not False:
is_flag = True
@@ -1020,7 +1022,7 @@ def get_param_completion(
incomplete_name = None
unassigned_params = list(parameters.values())
for param_sig in unassigned_params[:]:
- origin = getattr(param_sig.annotation, "__origin__", None)
+ origin = get_origin(param_sig.annotation)
if lenient_issubclass(param_sig.annotation, click.Context):
ctx_name = param_sig.name
unassigned_params.remove(param_sig)
From 68b34156d86f20424d2d8597bdb0edd0585aca6a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sat, 17 Aug 2024 02:23:03 +0000
Subject: [PATCH 30/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 701f1c0a82..32f4e8b1d8 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
### Fixes
+* π Fix support for `UnionType` (e.g. `str | None`) with Python 3.11. PR [#548](https://github.com/fastapi/typer/pull/548) by [@jonaslb](https://github.com/jonaslb).
* π Fix `zsh` autocompletion installation. PR [#237](https://github.com/fastapi/typer/pull/237) by [@alexjurkiewicz](https://github.com/alexjurkiewicz).
* π Fix usage of `Annotated` with future annotations in Python 3.7+. PR [#814](https://github.com/fastapi/typer/pull/814) by [@ivantodorovich](https://github.com/ivantodorovich).
* π Fix `shell_complete` not working for Arguments. PR [#737](https://github.com/fastapi/typer/pull/737) by [@bckohan](https://github.com/bckohan).
From ae94d5753c60badda5afd04edafd7e381991e3f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Fri, 16 Aug 2024 21:28:41 -0500
Subject: [PATCH 31/31] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.12.4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/release-notes.md | 2 ++
typer/__init__.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 32f4e8b1d8..fcde3f894d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,6 +2,8 @@
## Latest Changes
+## 0.12.4
+
### Features
* β¨ Add support for Python 3.12, tests in CI and official marker. PR [#807](https://github.com/tiangolo/typer/pull/807) by [@ivantodorovich](https://github.com/ivantodorovich).
diff --git a/typer/__init__.py b/typer/__init__.py
index d4ac56d0ba..dd2531263d 100644
--- a/typer/__init__.py
+++ b/typer/__init__.py
@@ -1,6 +1,6 @@
"""Typer, build great CLIs. Easy to code. Based on Python type hints."""
-__version__ = "0.12.3"
+__version__ = "0.12.4"
from shutil import get_terminal_size as get_terminal_size