-
-
Notifications
You must be signed in to change notification settings - Fork 64
Show elapsed time for build and publishing #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dd8a562
Show elapsed time for build and publishing
hugovk 3ef52a6
Fix hours and minutes for float input
hugovk 6c194eb
Remove functools.cache
hugovk 124693f
Keep build_docs() near main()
hugovk 21d094e
Show elapsed time for full docs build
hugovk 53391b4
Merge remote-tracking branch 'upstream/main' into log-elapsed-time
hugovk f2d2ffb
Update pre-commit
hugovk d32c793
Merge remote-tracking branch 'upstream/main' into log-elapsed-time
hugovk 652c561
Simplify uv + tox-uv setup
hugovk c6a8855
Using uv not pip
hugovk b0921bd
Reformat pyproject.toml
hugovk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
cache: pip | ||
- uses: pre-commit/[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Test | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
|
||
- name: Install uv | ||
uses: hynek/setup-cached-uv@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
uv pip install --system -U tox-uv | ||
|
||
- name: Tox tests | ||
run: | | ||
tox -e py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: forbid-submodules | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.28.6 | ||
hooks: | ||
- id: check-github-workflows | ||
|
||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.7.1 | ||
hooks: | ||
- id: actionlint | ||
|
||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: 2.1.3 | ||
hooks: | ||
- id: pyproject-fmt | ||
|
||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.18 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: 1.3.1 | ||
hooks: | ||
- id: tox-ini-fmt | ||
|
||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
- id: check-useless-excludes | ||
|
||
ci: | ||
autoupdate_schedule: quarterly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[tool.pytest.ini_options] | ||
pythonpath = [ | ||
".", | ||
] | ||
testpaths = [ | ||
"tests", | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from build_docs import format_seconds | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"seconds, expected", | ||
[ | ||
(0.4, "0s"), | ||
(0.5, "0s"), | ||
(0.6, "1s"), | ||
(1.5, "2s"), | ||
(30, "30s"), | ||
(60, "1m 0s"), | ||
(185, "3m 5s"), | ||
(454, "7m 34s"), | ||
(7456, "2h 4m 16s"), | ||
(30.1, "30s"), | ||
(60.2, "1m 0s"), | ||
(185.3, "3m 5s"), | ||
(454.4, "7m 34s"), | ||
(7456.5, "2h 4m 16s"), | ||
], | ||
) | ||
def test_format_seconds(seconds: float, expected: str) -> None: | ||
assert format_seconds(seconds) == expected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[tox] | ||
requires = | ||
tox>=4.2 | ||
env_list = | ||
lint | ||
py{313, 312, 311, 310} | ||
|
||
[testenv] | ||
package = wheel | ||
wheel_build_env = .pkg | ||
skip_install = true | ||
deps = | ||
-r requirements.txt | ||
pytest | ||
commands = | ||
{envpython} -m pytest {posargs} | ||
|
||
[testenv:lint] | ||
skip_install = true | ||
deps = | ||
pre-commit | ||
pass_env = | ||
PRE_COMMIT_COLOR | ||
commands = | ||
pre-commit run --all-files --show-diff-on-failure |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.