speakhuman 0.1.0__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.
- speakhuman-0.1.0/.github/CONTRIBUTING.md +21 -0
- speakhuman-0.1.0/.github/ISSUE_TEMPLATE.md +22 -0
- speakhuman-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- speakhuman-0.1.0/.github/SECURITY.md +4 -0
- speakhuman-0.1.0/.github/labels.yml +74 -0
- speakhuman-0.1.0/.github/release-drafter.yml +48 -0
- speakhuman-0.1.0/.github/renovate.json +19 -0
- speakhuman-0.1.0/.github/workflows/docs.yml +29 -0
- speakhuman-0.1.0/.github/workflows/labels.yml +24 -0
- speakhuman-0.1.0/.github/workflows/lint.yml +34 -0
- speakhuman-0.1.0/.github/workflows/release-drafter.yml +31 -0
- speakhuman-0.1.0/.github/workflows/release.yml +86 -0
- speakhuman-0.1.0/.github/workflows/require-pr-label.yml +27 -0
- speakhuman-0.1.0/.github/workflows/test.yml +79 -0
- speakhuman-0.1.0/.github/zizmor.yml +7 -0
- speakhuman-0.1.0/.gitignore +159 -0
- speakhuman-0.1.0/.pre-commit-config.yaml +78 -0
- speakhuman-0.1.0/.readthedocs.yml +19 -0
- speakhuman-0.1.0/.yamlfmt.yaml +2 -0
- speakhuman-0.1.0/Cargo.lock +445 -0
- speakhuman-0.1.0/Cargo.toml +15 -0
- speakhuman-0.1.0/LICENCE +20 -0
- speakhuman-0.1.0/PKG-INFO +274 -0
- speakhuman-0.1.0/README.md +238 -0
- speakhuman-0.1.0/RELEASING.md +23 -0
- speakhuman-0.1.0/benchmarks/bench_compare.py +384 -0
- speakhuman-0.1.0/docs/css/code_select.css +10 -0
- speakhuman-0.1.0/docs/filesize.md +3 -0
- speakhuman-0.1.0/docs/i18n.md +3 -0
- speakhuman-0.1.0/docs/index.md +16 -0
- speakhuman-0.1.0/docs/lists.md +3 -0
- speakhuman-0.1.0/docs/number.md +3 -0
- speakhuman-0.1.0/docs/requirements.txt +6 -0
- speakhuman-0.1.0/docs/time.md +3 -0
- speakhuman-0.1.0/example.py +52 -0
- speakhuman-0.1.0/mkdocs.yml +41 -0
- speakhuman-0.1.0/pyproject.toml +116 -0
- speakhuman-0.1.0/requirements-mypy.txt +4 -0
- speakhuman-0.1.0/rust_src/lib.rs +224 -0
- speakhuman-0.1.0/scripts/generate-translation-binaries.sh +8 -0
- speakhuman-0.1.0/scripts/update-translations.sh +13 -0
- speakhuman-0.1.0/speakhuman-rs/Cargo.lock +331 -0
- speakhuman-0.1.0/speakhuman-rs/Cargo.toml +21 -0
- speakhuman-0.1.0/speakhuman-rs/src/bench.rs +131 -0
- speakhuman-0.1.0/speakhuman-rs/src/filesize.rs +131 -0
- speakhuman-0.1.0/speakhuman-rs/src/i18n.rs +409 -0
- speakhuman-0.1.0/speakhuman-rs/src/lib.rs +25 -0
- speakhuman-0.1.0/speakhuman-rs/src/lists.rs +60 -0
- speakhuman-0.1.0/speakhuman-rs/src/number.rs +739 -0
- speakhuman-0.1.0/speakhuman-rs/src/time.rs +793 -0
- speakhuman-0.1.0/src/speakhuman/__init__.py +49 -0
- speakhuman-0.1.0/src/speakhuman/filesize.py +105 -0
- speakhuman-0.1.0/src/speakhuman/i18n.py +206 -0
- speakhuman-0.1.0/src/speakhuman/lists.py +42 -0
- speakhuman-0.1.0/src/speakhuman/locale/ar/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/bn_BD/LC_MESSAGES/speakhuman.po +366 -0
- speakhuman-0.1.0/src/speakhuman/locale/ca_ES/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/da_DK/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/de_DE/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/locale/el_GR/LC_MESSAGES/speakhuman.po +445 -0
- speakhuman-0.1.0/src/speakhuman/locale/eo/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/es_ES/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/eu/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/fa_IR/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/locale/fi_FI/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/fr_FR/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/locale/he_IL/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/hu_HU/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/id_ID/LC_MESSAGES/speakhuman.po +342 -0
- speakhuman-0.1.0/src/speakhuman/locale/it_IT/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/ja_JP/LC_MESSAGES/speakhuman.po +354 -0
- speakhuman-0.1.0/src/speakhuman/locale/ko_KR/LC_MESSAGES/speakhuman.po +394 -0
- speakhuman-0.1.0/src/speakhuman/locale/nb/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/nl_NL/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/locale/pl_PL/LC_MESSAGES/speakhuman.po +388 -0
- speakhuman-0.1.0/src/speakhuman/locale/pt_BR/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/pt_PT/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/ru_RU/LC_MESSAGES/speakhuman.po +388 -0
- speakhuman-0.1.0/src/speakhuman/locale/sk_SK/LC_MESSAGES/speakhuman.po +386 -0
- speakhuman-0.1.0/src/speakhuman/locale/sl_SI/LC_MESSAGES/speakhuman.po +409 -0
- speakhuman-0.1.0/src/speakhuman/locale/sv_SE/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/tlh/LC_MESSAGES/speakhuman.po +363 -0
- speakhuman-0.1.0/src/speakhuman/locale/tr_TR/LC_MESSAGES/speakhuman.po +367 -0
- speakhuman-0.1.0/src/speakhuman/locale/uk_UA/LC_MESSAGES/speakhuman.po +383 -0
- speakhuman-0.1.0/src/speakhuman/locale/uz/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/locale/vi_VN/LC_MESSAGES/speakhuman.po +372 -0
- speakhuman-0.1.0/src/speakhuman/locale/zh_CN/LC_MESSAGES/speakhuman.po +364 -0
- speakhuman-0.1.0/src/speakhuman/locale/zh_HK/LC_MESSAGES/speakhuman.po +365 -0
- speakhuman-0.1.0/src/speakhuman/number.py +640 -0
- speakhuman-0.1.0/src/speakhuman/py.typed +0 -0
- speakhuman-0.1.0/src/speakhuman/time.py +736 -0
- speakhuman-0.1.0/tests/__init__.py +0 -0
- speakhuman-0.1.0/tests/test_filesize.py +95 -0
- speakhuman-0.1.0/tests/test_i18n.py +279 -0
- speakhuman-0.1.0/tests/test_lists.py +23 -0
- speakhuman-0.1.0/tests/test_number.py +309 -0
- speakhuman-0.1.0/tests/test_time.py +828 -0
- speakhuman-0.1.0/tox.ini +44 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Linting
|
|
4
|
+
|
|
5
|
+
Linting is run on the CI using [prek](https://prek.j178.dev//), and can be run locally:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install prek
|
|
9
|
+
prek install # optional: to run when you commit, on just the staged changes
|
|
10
|
+
prek run --all-files # to run on all files now
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Docstrings
|
|
14
|
+
|
|
15
|
+
Follow
|
|
16
|
+
[Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
|
|
17
|
+
for docstrings.
|
|
18
|
+
|
|
19
|
+
## Localization
|
|
20
|
+
|
|
21
|
+
See [README](https://github.com/jackburrus/humanize#localization).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
### What did you do?
|
|
2
|
+
|
|
3
|
+
### What did you expect to happen?
|
|
4
|
+
|
|
5
|
+
### What actually happened?
|
|
6
|
+
|
|
7
|
+
### What versions are you using?
|
|
8
|
+
|
|
9
|
+
* OS:
|
|
10
|
+
* Python:
|
|
11
|
+
* Humanize:
|
|
12
|
+
|
|
13
|
+
Please include **code** that reproduces the issue.
|
|
14
|
+
|
|
15
|
+
The [best reproductions](https://stackoverflow.com/help/minimal-reproducible-example)
|
|
16
|
+
are
|
|
17
|
+
[self-contained scripts](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/)
|
|
18
|
+
with minimal dependencies.
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
code goes here
|
|
22
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Default GitHub labels
|
|
2
|
+
- color: d73a4a
|
|
3
|
+
description: "Something isn't working"
|
|
4
|
+
name: bug
|
|
5
|
+
- color: cfd3d7
|
|
6
|
+
description: "This issue or pull request already exists"
|
|
7
|
+
name: duplicate
|
|
8
|
+
- color: a2eeef
|
|
9
|
+
description: "New feature or request"
|
|
10
|
+
name: enhancement
|
|
11
|
+
- color: 7057ff
|
|
12
|
+
description: "Good for newcomers"
|
|
13
|
+
name: good first issue
|
|
14
|
+
- color: 008672
|
|
15
|
+
description: "Extra attention is needed"
|
|
16
|
+
name: help wanted
|
|
17
|
+
- color: e4e669
|
|
18
|
+
description: "This doesn't seem right"
|
|
19
|
+
name: invalid
|
|
20
|
+
- color: d876e3
|
|
21
|
+
description: "Further information is requested"
|
|
22
|
+
name: question
|
|
23
|
+
- color: ffffff
|
|
24
|
+
description: "This will not be worked on"
|
|
25
|
+
name: wontfix
|
|
26
|
+
|
|
27
|
+
# Keep a Changelog labels
|
|
28
|
+
# https://keepachangelog.com/en/1.0.0/
|
|
29
|
+
- color: 0e8a16
|
|
30
|
+
description: "For new features"
|
|
31
|
+
name: "changelog: Added"
|
|
32
|
+
- color: af99e5
|
|
33
|
+
description: "For changes in existing functionality"
|
|
34
|
+
name: "changelog: Changed"
|
|
35
|
+
- color: FFA500
|
|
36
|
+
description: "For soon-to-be removed features"
|
|
37
|
+
name: "changelog: Deprecated"
|
|
38
|
+
- color: 00A800
|
|
39
|
+
description: "For any bug fixes"
|
|
40
|
+
name: "changelog: Fixed"
|
|
41
|
+
- color: ff0000
|
|
42
|
+
description: "For now removed features"
|
|
43
|
+
name: "changelog: Removed"
|
|
44
|
+
- color: 045aa0
|
|
45
|
+
description: "In case of vulnerabilities"
|
|
46
|
+
name: "changelog: Security"
|
|
47
|
+
- color: fbca04
|
|
48
|
+
description: "Exclude PR from release draft"
|
|
49
|
+
name: "changelog: skip"
|
|
50
|
+
|
|
51
|
+
# Other labels
|
|
52
|
+
- color: 0366d6
|
|
53
|
+
description: "For dependencies"
|
|
54
|
+
name: dependencies
|
|
55
|
+
- color: 0075ca
|
|
56
|
+
description: "Improvements or additions to documentation"
|
|
57
|
+
name: documentation
|
|
58
|
+
- color: d0c1ff
|
|
59
|
+
description: "Translations need updating"
|
|
60
|
+
name: "needs localisation"
|
|
61
|
+
- color: eb6123
|
|
62
|
+
description: ""
|
|
63
|
+
name: Hacktoberfest
|
|
64
|
+
- color: eb6123
|
|
65
|
+
description: "To credit accepted Hacktoberfest PRs"
|
|
66
|
+
name: hacktoberfest-accepted
|
|
67
|
+
- color: e29673
|
|
68
|
+
name: "needs tests"
|
|
69
|
+
- color: d65e88
|
|
70
|
+
description: "Deploy and release"
|
|
71
|
+
name: release
|
|
72
|
+
- color: fbca04
|
|
73
|
+
description: "Unit tests, linting, CI, etc."
|
|
74
|
+
name: testing
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name-template: "$RESOLVED_VERSION"
|
|
2
|
+
tag-template: "$RESOLVED_VERSION"
|
|
3
|
+
|
|
4
|
+
categories:
|
|
5
|
+
- title: "Added"
|
|
6
|
+
labels:
|
|
7
|
+
- "changelog: Added"
|
|
8
|
+
- "enhancement"
|
|
9
|
+
- title: "Changed"
|
|
10
|
+
label: "changelog: Changed"
|
|
11
|
+
- title: "Deprecated"
|
|
12
|
+
label: "changelog: Deprecated"
|
|
13
|
+
- title: "Removed"
|
|
14
|
+
label: "changelog: Removed"
|
|
15
|
+
- title: "Fixed"
|
|
16
|
+
labels:
|
|
17
|
+
- "changelog: Fixed"
|
|
18
|
+
- "bug"
|
|
19
|
+
- title: "Security"
|
|
20
|
+
label: "changelog: Security"
|
|
21
|
+
|
|
22
|
+
exclude-labels:
|
|
23
|
+
- "changelog: skip"
|
|
24
|
+
|
|
25
|
+
autolabeler:
|
|
26
|
+
- label: "changelog: skip"
|
|
27
|
+
branch:
|
|
28
|
+
- "/pre-commit-ci-update-config/"
|
|
29
|
+
|
|
30
|
+
template: |
|
|
31
|
+
$CHANGES
|
|
32
|
+
|
|
33
|
+
version-resolver:
|
|
34
|
+
major:
|
|
35
|
+
labels:
|
|
36
|
+
- "changelog: Removed"
|
|
37
|
+
minor:
|
|
38
|
+
labels:
|
|
39
|
+
- "changelog: Added"
|
|
40
|
+
- "changelog: Changed"
|
|
41
|
+
- "changelog: Deprecated"
|
|
42
|
+
- "enhancement"
|
|
43
|
+
|
|
44
|
+
patch:
|
|
45
|
+
labels:
|
|
46
|
+
- "changelog: Fixed"
|
|
47
|
+
- "bug"
|
|
48
|
+
default: minor
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": ["config:recommended", ":semanticCommitsDisabled"],
|
|
4
|
+
"labels": ["changelog: skip", "dependencies"],
|
|
5
|
+
"minimumReleaseAge": "7 days",
|
|
6
|
+
"packageRules": [
|
|
7
|
+
{
|
|
8
|
+
"groupName": "github-actions",
|
|
9
|
+
"matchManagers": ["github-actions"],
|
|
10
|
+
"separateMajorMinor": false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"groupName": "docs/requirements.txt",
|
|
14
|
+
"matchFileNames": ["docs/requirements.txt"],
|
|
15
|
+
"separateMajorMinor": false
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"schedule": ["on the first day of the month"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
|
4
|
+
|
|
5
|
+
permissions: {}
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
FORCE_COLOR: 1
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
with:
|
|
17
|
+
persist-credentials: false
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v6
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.x"
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v7
|
|
26
|
+
|
|
27
|
+
- name: Docs
|
|
28
|
+
run: |
|
|
29
|
+
uvx --with tox-uv tox -e docs
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Sync labels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- .github/labels.yml
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
sync:
|
|
13
|
+
permissions:
|
|
14
|
+
pull-requests: write
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
with:
|
|
19
|
+
persist-credentials: false
|
|
20
|
+
- uses: micnncim/action-label-syncer@v1
|
|
21
|
+
with:
|
|
22
|
+
prune: false
|
|
23
|
+
env:
|
|
24
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
|
4
|
+
|
|
5
|
+
permissions: {}
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
FORCE_COLOR: 1
|
|
9
|
+
RUFF_OUTPUT_FORMAT: github
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- uses: j178/prek-action@v1
|
|
20
|
+
|
|
21
|
+
mypy:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
- uses: actions/setup-python@v6
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.x"
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v7
|
|
33
|
+
- name: Mypy
|
|
34
|
+
run: uvx --with tox-uv tox -e mypy
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Release drafter
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
# branches to consider in the event; optional, defaults to all
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
# pull_request event is required only for autolabeler
|
|
9
|
+
pull_request:
|
|
10
|
+
# Only following types are handled by the action, but one can default to all as well
|
|
11
|
+
types: [opened, reopened, synchronize]
|
|
12
|
+
# pull_request_target event is required for autolabeler to support PRs from forks
|
|
13
|
+
# pull_request_target:
|
|
14
|
+
# types: [opened, reopened, synchronize]
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
update_release_draft:
|
|
19
|
+
if: github.event.repository.fork == false
|
|
20
|
+
permissions:
|
|
21
|
+
# write permission is required to create a GitHub Release
|
|
22
|
+
contents: write
|
|
23
|
+
# write permission is required for autolabeler
|
|
24
|
+
# otherwise, read permission is required at least
|
|
25
|
+
pull-requests: write
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
# Drafts your next release notes as pull requests are merged into "main"
|
|
29
|
+
- uses: release-drafter/release-drafter@v6
|
|
30
|
+
env:
|
|
31
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
release:
|
|
10
|
+
types:
|
|
11
|
+
- published
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
permissions: {}
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
FORCE_COLOR: 1
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
# Always build & lint package.
|
|
21
|
+
build-package:
|
|
22
|
+
name: Build & verify package
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v6
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
persist-credentials: false
|
|
30
|
+
|
|
31
|
+
- name: Install gettext
|
|
32
|
+
run: |
|
|
33
|
+
sudo apt install gettext
|
|
34
|
+
|
|
35
|
+
- name: Generate translation binaries
|
|
36
|
+
run: |
|
|
37
|
+
scripts/generate-translation-binaries.sh
|
|
38
|
+
|
|
39
|
+
- uses: hynek/build-and-inspect-python-package@v2
|
|
40
|
+
|
|
41
|
+
# Upload to Test PyPI on every commit on main.
|
|
42
|
+
release-test-pypi:
|
|
43
|
+
name: Publish in-dev package to test.pypi.org
|
|
44
|
+
if: |
|
|
45
|
+
github.event.repository.fork == false
|
|
46
|
+
&& github.event_name == 'push'
|
|
47
|
+
&& github.ref == 'refs/heads/main'
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
needs: build-package
|
|
50
|
+
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Download packages built by build-and-inspect-python-package
|
|
56
|
+
uses: actions/download-artifact@v7
|
|
57
|
+
with:
|
|
58
|
+
name: Packages
|
|
59
|
+
path: dist
|
|
60
|
+
|
|
61
|
+
- name: Upload package to Test PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
63
|
+
with:
|
|
64
|
+
repository-url: https://test.pypi.org/legacy/
|
|
65
|
+
|
|
66
|
+
# Upload to real PyPI on GitHub Releases.
|
|
67
|
+
release-pypi:
|
|
68
|
+
name: Publish released package to pypi.org
|
|
69
|
+
if: |
|
|
70
|
+
github.event.repository.fork == false
|
|
71
|
+
&& github.event.action == 'published'
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
needs: build-package
|
|
74
|
+
|
|
75
|
+
permissions:
|
|
76
|
+
id-token: write
|
|
77
|
+
|
|
78
|
+
steps:
|
|
79
|
+
- name: Download packages built by build-and-inspect-python-package
|
|
80
|
+
uses: actions/download-artifact@v7
|
|
81
|
+
with:
|
|
82
|
+
name: Packages
|
|
83
|
+
path: dist
|
|
84
|
+
|
|
85
|
+
- name: Upload package to PyPI
|
|
86
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Require PR label
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, labeled, unlabeled, synchronize]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
label:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
issues: write
|
|
13
|
+
pull-requests: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: mheap/github-action-required-labels@v5
|
|
17
|
+
with:
|
|
18
|
+
mode: minimum
|
|
19
|
+
count: 1
|
|
20
|
+
labels: |
|
|
21
|
+
changelog: Added
|
|
22
|
+
changelog: Changed
|
|
23
|
+
changelog: Deprecated
|
|
24
|
+
changelog: Fixed
|
|
25
|
+
changelog: Removed
|
|
26
|
+
changelog: Security
|
|
27
|
+
changelog: skip
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
|
4
|
+
|
|
5
|
+
permissions: {}
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
FORCE_COLOR: 1
|
|
9
|
+
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python-version:
|
|
18
|
+
- "pypy3.11"
|
|
19
|
+
- "3.15t"
|
|
20
|
+
- "3.15"
|
|
21
|
+
- "3.14t"
|
|
22
|
+
- "3.14"
|
|
23
|
+
- "3.13t"
|
|
24
|
+
- "3.13"
|
|
25
|
+
- "3.12"
|
|
26
|
+
- "3.11"
|
|
27
|
+
- "3.10"
|
|
28
|
+
os: [windows-latest, macos-latest, ubuntu-latest]
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
|
|
35
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
36
|
+
uses: actions/setup-python@v6
|
|
37
|
+
with:
|
|
38
|
+
python-version: ${{ matrix.python-version }}
|
|
39
|
+
allow-prereleases: true
|
|
40
|
+
|
|
41
|
+
- name: Set PYTHON_GIL
|
|
42
|
+
if: endsWith(matrix.python-version, 't')
|
|
43
|
+
run: |
|
|
44
|
+
echo "PYTHON_GIL=0" >> "$GITHUB_ENV"
|
|
45
|
+
|
|
46
|
+
- name: Install Linux dependencies
|
|
47
|
+
if: startsWith(matrix.os, 'ubuntu')
|
|
48
|
+
run: |
|
|
49
|
+
sudo apt install gettext
|
|
50
|
+
|
|
51
|
+
- name: Install macOS dependencies
|
|
52
|
+
if: startsWith(matrix.os, 'macos')
|
|
53
|
+
run: |
|
|
54
|
+
brew install gettext
|
|
55
|
+
|
|
56
|
+
- name: Install uv
|
|
57
|
+
uses: astral-sh/setup-uv@v7
|
|
58
|
+
|
|
59
|
+
- name: Generate translation binaries
|
|
60
|
+
run: |
|
|
61
|
+
scripts/generate-translation-binaries.sh
|
|
62
|
+
|
|
63
|
+
- name: Tox tests
|
|
64
|
+
run: |
|
|
65
|
+
uvx --python ${{ matrix.python-version }} --with tox-uv tox -e py
|
|
66
|
+
|
|
67
|
+
- name: Upload coverage
|
|
68
|
+
uses: codecov/codecov-action@v5
|
|
69
|
+
with:
|
|
70
|
+
flags: ${{ matrix.os }}
|
|
71
|
+
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
|
|
72
|
+
|
|
73
|
+
success:
|
|
74
|
+
needs: test
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
name: Test successful
|
|
77
|
+
steps:
|
|
78
|
+
- name: Success
|
|
79
|
+
run: echo Test successful
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# Jetbrains IDEs
|
|
156
|
+
.idea/
|
|
157
|
+
|
|
158
|
+
# hatch-vcs
|
|
159
|
+
src/*/_version.py
|