typer-cli 0.0.13__tar.gz → 0.12.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {typer_cli-0.0.13 → typer_cli-0.12.dev1}/LICENSE +1 -1
- typer_cli-0.12.dev1/PKG-INFO +80 -0
- typer_cli-0.12.dev1/README.md +49 -0
- typer_cli-0.12.dev1/pdm_build.py +40 -0
- {typer_cli-0.0.13 → typer_cli-0.12.dev1}/pyproject.toml +36 -33
- typer_cli-0.0.13/.coveragerc +0 -8
- typer_cli-0.0.13/.github/FUNDING.yml +0 -1
- typer_cli-0.0.13/.github/dependabot.yml +0 -16
- typer_cli-0.0.13/.github/workflows/issue-manager.yml +0 -27
- typer_cli-0.0.13/.github/workflows/latest-changes.yml +0 -30
- typer_cli-0.0.13/.github/workflows/publish.yml +0 -36
- typer_cli-0.0.13/.github/workflows/smokeshow.yml +0 -35
- typer_cli-0.0.13/.github/workflows/test.yml +0 -110
- typer_cli-0.0.13/.gitignore +0 -8
- typer_cli-0.0.13/PKG-INFO +0 -532
- typer_cli-0.0.13/README.md +0 -493
- typer_cli-0.0.13/mypy.ini +0 -4
- typer_cli-0.0.13/release-notes.md +0 -80
- typer_cli-0.0.13/requirements.txt +0 -15
- typer_cli-0.0.13/scripts/format-imports.sh +0 -6
- typer_cli-0.0.13/scripts/format.sh +0 -6
- typer_cli-0.0.13/scripts/lint.sh +0 -8
- typer_cli-0.0.13/scripts/publish.sh +0 -5
- typer_cli-0.0.13/scripts/test-cov-html.sh +0 -6
- typer_cli-0.0.13/scripts/test.sh +0 -7
- typer_cli-0.0.13/tests/__init__.py +0 -0
- typer_cli-0.0.13/tests/assets/__init__.py +0 -0
- typer_cli-0.0.13/tests/assets/app_other_name.py +0 -8
- typer_cli-0.0.13/tests/assets/empty_script.py +0 -0
- typer_cli-0.0.13/tests/assets/func_other_name.py +0 -2
- typer_cli-0.0.13/tests/assets/multi_app.py +0 -40
- typer_cli-0.0.13/tests/assets/multi_app_cli.py +0 -22
- typer_cli-0.0.13/tests/assets/multi_func.py +0 -12
- typer_cli-0.0.13/tests/assets/multiapp-docs.md +0 -102
- typer_cli-0.0.13/tests/assets/not_python.txt +0 -1
- typer_cli-0.0.13/tests/assets/sample.py +0 -25
- typer_cli-0.0.13/tests/test_app_other_name.py +0 -38
- typer_cli-0.0.13/tests/test_completion_run.py +0 -20
- typer_cli-0.0.13/tests/test_doc.py +0 -98
- typer_cli-0.0.13/tests/test_empty_script.py +0 -18
- typer_cli-0.0.13/tests/test_func_other_name.py +0 -20
- typer_cli-0.0.13/tests/test_help.py +0 -21
- typer_cli-0.0.13/tests/test_multi_app.py +0 -116
- typer_cli-0.0.13/tests/test_multi_app_cli.py +0 -96
- typer_cli-0.0.13/tests/test_multi_app_sub.py +0 -43
- typer_cli-0.0.13/tests/test_multi_func.py +0 -100
- typer_cli-0.0.13/tests/test_not_python.py +0 -11
- typer_cli-0.0.13/tests/test_sub.py +0 -109
- typer_cli-0.0.13/tests/test_sub_completion.py +0 -20
- typer_cli-0.0.13/tests/test_sub_help.py +0 -22
- typer_cli-0.0.13/tests/test_version.py +0 -11
- typer_cli-0.0.13/typer_cli/__init__.py +0 -1
- typer_cli-0.0.13/typer_cli/__main__.py +0 -3
- typer_cli-0.0.13/typer_cli/main.py +0 -291
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: typer-cli
|
|
3
|
+
Version: 0.12.dev1
|
|
4
|
+
Summary: Typer, build great CLIs. Easy to code. Based on Python type hints.
|
|
5
|
+
Home-page: https://github.com/tiangolo/typer
|
|
6
|
+
Author-Email: Sebastián Ramírez <tiangolo@gmail.com>
|
|
7
|
+
Classifier: Intended Audience :: Information Technology
|
|
8
|
+
Classifier: Intended Audience :: System Administrators
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: Development Status :: 4 - Beta
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
26
|
+
Project-URL: Documentation, https://typer.tiangolo.com/
|
|
27
|
+
Project-URL: Homepage, https://github.com/tiangolo/typer
|
|
28
|
+
Requires-Python: >=3.7
|
|
29
|
+
Requires-Dist: typer-slim[standard]==0.12.dev1
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>
|
|
34
|
+
</p>
|
|
35
|
+
<p align="center">
|
|
36
|
+
<em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>
|
|
37
|
+
</p>
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3ATest" target="_blank">
|
|
40
|
+
<img src="https://github.com/tiangolo/typer/workflows/Test/badge.svg" alt="Test">
|
|
41
|
+
</a>
|
|
42
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">
|
|
43
|
+
<img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">
|
|
44
|
+
</a>
|
|
45
|
+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
|
|
46
|
+
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">
|
|
47
|
+
<a href="https://pypi.org/project/typer" target="_blank">
|
|
48
|
+
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
|
49
|
+
</a>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com/tutorial/typer-command/</a>
|
|
55
|
+
|
|
56
|
+
**Source Code**: <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.
|
|
61
|
+
|
|
62
|
+
## Typer CLI
|
|
63
|
+
|
|
64
|
+
This package, `typer-cli`, only provides a command `typer` in the shell with the same functionality of `python -m typer`.
|
|
65
|
+
|
|
66
|
+
The only reason why this is a separate package is to allow developers to opt out of the `typer` command by installing `typer-slim`, that doesn't include `typer-cli`.
|
|
67
|
+
|
|
68
|
+
You probably **should not** install this package.
|
|
69
|
+
|
|
70
|
+
Install instead:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install typer
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
That includes this package, `typer-cli`, with the `typer` command.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
This project is licensed under the terms of the MIT license.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>
|
|
6
|
+
</p>
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3ATest" target="_blank">
|
|
9
|
+
<img src="https://github.com/tiangolo/typer/workflows/Test/badge.svg" alt="Test">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">
|
|
12
|
+
<img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
|
|
15
|
+
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">
|
|
16
|
+
<a href="https://pypi.org/project/typer" target="_blank">
|
|
17
|
+
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
|
18
|
+
</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com/tutorial/typer-command/</a>
|
|
24
|
+
|
|
25
|
+
**Source Code**: <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.
|
|
30
|
+
|
|
31
|
+
## Typer CLI
|
|
32
|
+
|
|
33
|
+
This package, `typer-cli`, only provides a command `typer` in the shell with the same functionality of `python -m typer`.
|
|
34
|
+
|
|
35
|
+
The only reason why this is a separate package is to allow developers to opt out of the `typer` command by installing `typer-slim`, that doesn't include `typer-cli`.
|
|
36
|
+
|
|
37
|
+
You probably **should not** install this package.
|
|
38
|
+
|
|
39
|
+
Install instead:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install typer
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That includes this package, `typer-cli`, with the `typer` command.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
This project is licensed under the terms of the MIT license.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from pdm.backend.hooks import Context
|
|
5
|
+
|
|
6
|
+
packages_to_sync = ["typer-slim"]
|
|
7
|
+
|
|
8
|
+
license_name = "LICENSE"
|
|
9
|
+
license_path = Path("..") / license_name
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def pdm_build_hook_enabled(context: Context):
|
|
13
|
+
return context.target == "sdist"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def pdm_build_initialize(context: Context):
|
|
17
|
+
metadata = context.config.metadata
|
|
18
|
+
# Get main version
|
|
19
|
+
version = metadata["version"]
|
|
20
|
+
# Update version in dependencies to sync them
|
|
21
|
+
dependencies: List[str] = metadata["dependencies"]
|
|
22
|
+
new_dependencies = []
|
|
23
|
+
for dep in dependencies:
|
|
24
|
+
if any(dep.startswith(name) for name in packages_to_sync):
|
|
25
|
+
new_dep = f"{dep}=={version}"
|
|
26
|
+
new_dependencies.append(new_dep)
|
|
27
|
+
else:
|
|
28
|
+
new_dependencies.append(dep)
|
|
29
|
+
if new_dependencies != dependencies:
|
|
30
|
+
metadata["dependencies"] = new_dependencies
|
|
31
|
+
# LICENSE
|
|
32
|
+
license_content = license_path.read_text()
|
|
33
|
+
context.ensure_build_dir()
|
|
34
|
+
# # Workaround, copy LICENSE to package_dir during build
|
|
35
|
+
Path(license_name).write_text(license_content)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def pdm_build_finalize(context: Context, artifact: Path):
|
|
39
|
+
# Workaround, remove LICENSE from package_dir after build
|
|
40
|
+
Path(license_name).unlink()
|
|
@@ -1,59 +1,62 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [
|
|
3
|
-
|
|
2
|
+
requires = [
|
|
3
|
+
"pdm-backend",
|
|
4
|
+
]
|
|
5
|
+
build-backend = "pdm.backend"
|
|
4
6
|
|
|
5
7
|
[project]
|
|
6
8
|
name = "typer-cli"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
requires-python = ">=3.7"
|
|
10
|
-
license = "MIT"
|
|
9
|
+
dynamic = []
|
|
10
|
+
description = "Typer, build great CLIs. Easy to code. Based on Python type hints."
|
|
11
11
|
authors = [
|
|
12
|
-
{name = "Sebastián Ramírez", email = "tiangolo@gmail.com"},
|
|
12
|
+
{ name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
|
|
13
13
|
]
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
requires-python = ">=3.7"
|
|
14
16
|
classifiers = [
|
|
15
|
-
"Environment :: Console",
|
|
16
|
-
"Intended Audience :: Developers",
|
|
17
|
-
"Intended Audience :: Education",
|
|
18
|
-
"Intended Audience :: End Users/Desktop",
|
|
19
17
|
"Intended Audience :: Information Technology",
|
|
20
18
|
"Intended Audience :: System Administrators",
|
|
21
19
|
"Operating System :: OS Independent",
|
|
22
|
-
"Programming Language :: Python",
|
|
23
20
|
"Programming Language :: Python :: 3",
|
|
24
|
-
"Programming Language :: Python
|
|
25
|
-
"Programming Language :: Python :: 3.7",
|
|
26
|
-
"Programming Language :: Python :: 3.8",
|
|
27
|
-
"Programming Language :: Python :: 3.9",
|
|
28
|
-
"Programming Language :: Python :: 3.10",
|
|
29
|
-
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python",
|
|
30
22
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
31
23
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
32
24
|
"Topic :: Software Development :: Libraries",
|
|
33
25
|
"Topic :: Software Development",
|
|
34
|
-
"Topic :: Terminals",
|
|
35
|
-
"Topic :: Utilities",
|
|
36
26
|
"Typing :: Typed",
|
|
37
27
|
"Development Status :: 4 - Beta",
|
|
38
|
-
"
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
30
|
+
"Programming Language :: Python :: 3.7",
|
|
31
|
+
"Programming Language :: Python :: 3.8",
|
|
32
|
+
"Programming Language :: Python :: 3.9",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
35
|
+
"License :: OSI Approved :: MIT License",
|
|
39
36
|
]
|
|
40
|
-
|
|
41
|
-
dynamic = ["version"]
|
|
42
37
|
dependencies = [
|
|
43
|
-
"typer
|
|
44
|
-
"colorama >=0.4.3,<=0.5.0",
|
|
45
|
-
"shellingham >=1.3.2,<=1.4.0",
|
|
38
|
+
"typer-slim[standard]==0.12.dev1",
|
|
46
39
|
]
|
|
40
|
+
version = "0.12.dev1"
|
|
47
41
|
|
|
48
42
|
[project.urls]
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
Documentation = "https://typer.tiangolo.com/"
|
|
44
|
+
homepage = "https://github.com/tiangolo/typer"
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
all = []
|
|
51
48
|
|
|
52
49
|
[project.scripts]
|
|
53
|
-
typer = "
|
|
50
|
+
typer = "typer.cli:main"
|
|
51
|
+
|
|
52
|
+
[tool.pdm]
|
|
53
|
+
distribution = true
|
|
54
54
|
|
|
55
|
-
[tool.
|
|
56
|
-
|
|
55
|
+
[tool.pdm.version]
|
|
56
|
+
source = "file"
|
|
57
|
+
path = "../typer/__init__.py"
|
|
57
58
|
|
|
58
|
-
[tool.
|
|
59
|
-
|
|
59
|
+
[tool.pdm.build]
|
|
60
|
+
excludes = [
|
|
61
|
+
"*",
|
|
62
|
+
]
|
typer_cli-0.0.13/.coveragerc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
github: [tiangolo]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
# GitHub Actions
|
|
4
|
-
- package-ecosystem: "github-actions"
|
|
5
|
-
directory: "/"
|
|
6
|
-
schedule:
|
|
7
|
-
interval: "daily"
|
|
8
|
-
commit-message:
|
|
9
|
-
prefix: ⬆
|
|
10
|
-
# Python
|
|
11
|
-
- package-ecosystem: "pip"
|
|
12
|
-
directory: "/"
|
|
13
|
-
schedule:
|
|
14
|
-
interval: "daily"
|
|
15
|
-
commit-message:
|
|
16
|
-
prefix: ⬆
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Issue Manager
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
schedule:
|
|
5
|
-
- cron: "0 0 * * *"
|
|
6
|
-
issue_comment:
|
|
7
|
-
types:
|
|
8
|
-
- created
|
|
9
|
-
- edited
|
|
10
|
-
issues:
|
|
11
|
-
types:
|
|
12
|
-
- labeled
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
issue-manager:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- uses: tiangolo/issue-manager@0.4.0
|
|
19
|
-
with:
|
|
20
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
-
config: >
|
|
22
|
-
{
|
|
23
|
-
"answered": {
|
|
24
|
-
"delay": 864000,
|
|
25
|
-
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: Latest Changes
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request_target:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
types:
|
|
8
|
-
- closed
|
|
9
|
-
workflow_dispatch:
|
|
10
|
-
inputs:
|
|
11
|
-
number:
|
|
12
|
-
description: PR number
|
|
13
|
-
required: true
|
|
14
|
-
debug_enabled:
|
|
15
|
-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
|
16
|
-
required: false
|
|
17
|
-
default: false
|
|
18
|
-
|
|
19
|
-
jobs:
|
|
20
|
-
latest-changes:
|
|
21
|
-
if: github.event.pull_request.merged == true
|
|
22
|
-
runs-on: ubuntu-latest
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v3
|
|
25
|
-
- uses: docker://tiangolo/latest-changes:0.0.3
|
|
26
|
-
with:
|
|
27
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
28
|
-
latest_changes_file: docs/en/docs/release-notes.md
|
|
29
|
-
latest_changes_header: '## Latest Changes\n\n'
|
|
30
|
-
debug_logs: true
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types:
|
|
6
|
-
- created
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v2
|
|
13
|
-
- name: Set up Python
|
|
14
|
-
uses: actions/setup-python@v4
|
|
15
|
-
with:
|
|
16
|
-
python-version: "3.7"
|
|
17
|
-
cache: "pip"
|
|
18
|
-
cache-dependency-path: requirements.txt
|
|
19
|
-
- uses: actions/cache@v3
|
|
20
|
-
id: cache
|
|
21
|
-
with:
|
|
22
|
-
path: ${{ env.pythonLocation }}
|
|
23
|
-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-publish
|
|
24
|
-
- name: Install build dependencies
|
|
25
|
-
if: steps.cache.outputs.cache-hit != 'true'
|
|
26
|
-
run: pip install build
|
|
27
|
-
- name: Build distribution
|
|
28
|
-
run: python -m build
|
|
29
|
-
- name: Publish
|
|
30
|
-
uses: pypa/gh-action-pypi-publish@v1.6.4
|
|
31
|
-
with:
|
|
32
|
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
33
|
-
- name: Dump GitHub context
|
|
34
|
-
env:
|
|
35
|
-
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
36
|
-
run: echo "$GITHUB_CONTEXT"
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
name: Smokeshow
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_run:
|
|
5
|
-
workflows: [Test]
|
|
6
|
-
types: [completed]
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
statuses: write
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
smokeshow:
|
|
13
|
-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/setup-python@v4
|
|
18
|
-
with:
|
|
19
|
-
python-version: '3.9'
|
|
20
|
-
|
|
21
|
-
- run: pip install smokeshow
|
|
22
|
-
|
|
23
|
-
- uses: dawidd6/action-download-artifact@v2.24.3
|
|
24
|
-
with:
|
|
25
|
-
workflow: test.yml
|
|
26
|
-
commit: ${{ github.event.workflow_run.head_sha }}
|
|
27
|
-
|
|
28
|
-
- run: smokeshow upload coverage-html
|
|
29
|
-
env:
|
|
30
|
-
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
|
|
31
|
-
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100
|
|
32
|
-
SMOKESHOW_GITHUB_CONTEXT: coverage
|
|
33
|
-
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
34
|
-
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
|
35
|
-
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
types: [opened, synchronize]
|
|
9
|
-
workflow_dispatch:
|
|
10
|
-
inputs:
|
|
11
|
-
debug_enabled:
|
|
12
|
-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
|
13
|
-
required: false
|
|
14
|
-
default: false
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
test:
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
strategy:
|
|
20
|
-
matrix:
|
|
21
|
-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
|
22
|
-
fail-fast: false
|
|
23
|
-
|
|
24
|
-
steps:
|
|
25
|
-
- uses: actions/checkout@v2
|
|
26
|
-
- name: Set up Python
|
|
27
|
-
uses: actions/setup-python@v4
|
|
28
|
-
with:
|
|
29
|
-
python-version: ${{ matrix.python-version }}
|
|
30
|
-
cache: "pip"
|
|
31
|
-
cache-dependency-path: |
|
|
32
|
-
requirements.txt
|
|
33
|
-
pyproject.toml
|
|
34
|
-
# Allow debugging with tmate
|
|
35
|
-
- name: Setup tmate session
|
|
36
|
-
uses: mxschmitt/action-tmate@v3
|
|
37
|
-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
|
|
38
|
-
with:
|
|
39
|
-
limit-access-to-actor: true
|
|
40
|
-
- uses: actions/cache@v3
|
|
41
|
-
id: cache
|
|
42
|
-
with:
|
|
43
|
-
path: ${{ env.pythonLocation }}
|
|
44
|
-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-test-v03
|
|
45
|
-
- name: Install Dependencies
|
|
46
|
-
if: steps.cache.outputs.cache-hit != 'true'
|
|
47
|
-
run: pip install -r requirements.txt
|
|
48
|
-
- name: Lint
|
|
49
|
-
run: bash scripts/lint.sh
|
|
50
|
-
- run: mkdir coverage
|
|
51
|
-
- name: Test
|
|
52
|
-
run: bash scripts/test.sh
|
|
53
|
-
env:
|
|
54
|
-
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
|
|
55
|
-
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
|
|
56
|
-
- name: Store coverage files
|
|
57
|
-
uses: actions/upload-artifact@v3
|
|
58
|
-
with:
|
|
59
|
-
name: coverage
|
|
60
|
-
path: coverage
|
|
61
|
-
|
|
62
|
-
coverage-combine:
|
|
63
|
-
needs: [test]
|
|
64
|
-
runs-on: ubuntu-latest
|
|
65
|
-
|
|
66
|
-
steps:
|
|
67
|
-
- uses: actions/checkout@v3
|
|
68
|
-
|
|
69
|
-
- uses: actions/setup-python@v4
|
|
70
|
-
with:
|
|
71
|
-
python-version: '3.8'
|
|
72
|
-
cache: "pip"
|
|
73
|
-
cache-dependency-path: |
|
|
74
|
-
requirements.txt
|
|
75
|
-
pyproject.toml
|
|
76
|
-
|
|
77
|
-
- name: Get coverage files
|
|
78
|
-
uses: actions/download-artifact@v3
|
|
79
|
-
with:
|
|
80
|
-
name: coverage
|
|
81
|
-
path: coverage
|
|
82
|
-
|
|
83
|
-
- run: pip install coverage
|
|
84
|
-
|
|
85
|
-
- run: ls -la coverage
|
|
86
|
-
- run: coverage combine coverage
|
|
87
|
-
- run: coverage report
|
|
88
|
-
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
|
|
89
|
-
|
|
90
|
-
- name: Store coverage HTML
|
|
91
|
-
uses: actions/upload-artifact@v3
|
|
92
|
-
with:
|
|
93
|
-
name: coverage-html
|
|
94
|
-
path: htmlcov
|
|
95
|
-
|
|
96
|
-
# https://github.com/marketplace/actions/alls-green#why
|
|
97
|
-
check: # This job does nothing and is only used for the branch protection
|
|
98
|
-
|
|
99
|
-
if: always()
|
|
100
|
-
|
|
101
|
-
needs:
|
|
102
|
-
- coverage-combine
|
|
103
|
-
|
|
104
|
-
runs-on: ubuntu-latest
|
|
105
|
-
|
|
106
|
-
steps:
|
|
107
|
-
- name: Decide whether the needed jobs succeeded or failed
|
|
108
|
-
uses: re-actors/alls-green@release/v1
|
|
109
|
-
with:
|
|
110
|
-
jobs: ${{ toJSON(needs) }}
|