From 5baa4370cc4604719e8c2c3daf6fa01941ee14fb Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Tue, 20 Aug 2024 22:52:46 +0200 Subject: [PATCH 01/10] Add experimental python 3.13 CI --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 724f55d..1bbb8e3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] env: POETRY_VIRTUALENVS_CREATE: false From 96da5cf90b1b14e31f4f9c6288386f532f541692 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Tue, 20 Aug 2024 23:16:19 +0200 Subject: [PATCH 02/10] Revert python 3.13 testing - github is not ready --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1bbb8e3..724f55d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12"] env: POETRY_VIRTUALENVS_CREATE: false From 7a4d89f5e992fefbcf9cd676e15d90a3217ea29e Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Tue, 20 Aug 2024 23:44:25 +0200 Subject: [PATCH 03/10] Set fail fast to false --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 724f55d..63ba902 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,6 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.10", "3.11", "3.12"] From b1fe03d533500709275e8fd1bd56435ecf131454 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Wed, 21 Aug 2024 00:04:53 +0200 Subject: [PATCH 04/10] Try again with python 3.13 rc1. Update codeql yaml. --- .github/workflows/codeql.yaml | 42 ++--------------------------------- .github/workflows/tests.yaml | 2 +- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index da25c56..540df2f 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -1,14 +1,3 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: @@ -33,44 +22,17 @@ jobs: fail-fast: false matrix: language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - name: Checkout repository uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 63ba902..62a0537 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13.0-rc.1"] env: POETRY_VIRTUALENVS_CREATE: false From bd1925261ebf07c025531bc1d712638a68745c9c Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Wed, 21 Aug 2024 00:09:21 +0200 Subject: [PATCH 05/10] Try to fix darwin actual sleep problems --- tests/test_actual_delay.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_actual_delay.py b/tests/test_actual_delay.py index e3dd0ee..33145c0 100644 --- a/tests/test_actual_delay.py +++ b/tests/test_actual_delay.py @@ -6,12 +6,12 @@ from horology import Timed, Timing, timed -@pytest.mark.flaky(reruns=5) +@pytest.mark.flaky(reruns=7) class TestWithSleep: def test_context(self): with redirect_stdout(out := StringIO()): with Timing(): - sleep(0.11) + sleep(0.1) print_str = out.getvalue().strip() assert print_str.startswith('1') @@ -20,7 +20,7 @@ def test_context(self): def test_decorator(self): @timed def foo(): - sleep(0.11) + sleep(0.1) with redirect_stdout(out := StringIO()): foo() @@ -32,7 +32,7 @@ def foo(): def test_iterable(self): with redirect_stdout(out := StringIO()): for _ in Timed(range(1)): - sleep(0.11) + sleep(0.1) print_str = out.getvalue().strip() assert print_str.startswith('iteration 1: 1') From d63557ae0be3c14cdcd23b7c82b82d6686f7fa74 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Wed, 21 Aug 2024 00:12:58 +0200 Subject: [PATCH 06/10] Update codeql yaml --- .github/workflows/codeql.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 540df2f..2c1f19d 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v3 From b1bc33f4287646d71c9678506c71b0f624172d92 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Thu, 17 Oct 2024 22:06:58 +0200 Subject: [PATCH 07/10] Docs fixes --- horology/timed_iterable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/horology/timed_iterable.py b/horology/timed_iterable.py index 7441de2..2019c9e 100644 --- a/horology/timed_iterable.py +++ b/horology/timed_iterable.py @@ -28,7 +28,7 @@ class Timed: disable printing the summary. You can provide e.g. `logger.info`. By default, the built-in `print` function is used. - Properties + Attributes ---------- num_iterations: int How many iteration were executed. From e7595f02d74f8f701b19c62e15034c980713d611 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Thu, 17 Oct 2024 22:08:12 +0200 Subject: [PATCH 08/10] Bump package versions in pyproject.toml --- pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a5f555..1c6cc11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "horology" -version = "1.4.0" +version = "1.4.1" description = "Conveniently measures the time of loops, contexts and functions." authors = ["mjmikulski "] license = "MIT" @@ -14,6 +14,7 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Utilities', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Testing', @@ -25,13 +26,13 @@ classifiers = [ python = "^3.10" [tool.poetry.dev-dependencies] -pytest = "7.4.*" -mypy = "1.7.*" -pytest-rerunfailures = "13.*" +pytest = "8.0.*" +mypy = "1.8.*" +pytest-rerunfailures = "14.*" [tool.pytest.ini_options] addopts = "--doctest-modules" [build-system] -requires = ["poetry-core>=1.0.0"] +requires = ["poetry-core>=1.9.1"] build-backend = "poetry.core.masonry.api" From 3c33cc3f1cf4db41771dba28ce65daf3c6634c89 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Thu, 17 Oct 2024 22:08:58 +0200 Subject: [PATCH 09/10] Add non-rc pyton 3.13 to test matrix --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 62a0537..98b8d8a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12", "3.13.0-rc.1"] + python-version: ["3.10", "3.11", "3.12", "3.13"] env: POETRY_VIRTUALENVS_CREATE: false From 22c560ab1a6419b1035fa706ef4c3cbc243bc436 Mon Sep 17 00:00:00 2001 From: Maciej J Mikulski Date: Thu, 17 Oct 2024 22:22:04 +0200 Subject: [PATCH 10/10] Update README and CHANGELOG --- CHANGELOG.md | 15 +++++++++++++++ README.md | 5 +++-- horology/__init__.py | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 930e5f7..a7405bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog + +## 1.4.1 + +### Tests and deployment + +- Dev-dependencies were updated. +- CodeQL configuration was cleaned and updated to new versions. +- Minor tests tweaks. + +### Supported Python versions + +- Added support for 3.13. + +Supported python versions are 3.10-3.13. + ## 1.4.0 ### Features and enhancements diff --git a/README.md b/README.md index fc1c3db..20fd071 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ [![PyPI version](https://badge.fury.io/py/horology.svg)](https://badge.fury.io/py/horology) [![tests](https://github.com/mjmikulski/horology/actions/workflows/tests.yaml/badge.svg)](https://github.com/mjmikulski/horology/actions/workflows/tests.yaml) [![codeql](https://github.com/mjmikulski/horology/actions/workflows/codeql.yaml/badge.svg)](https://github.com/mjmikulski/horology/actions/workflows/codeql.yaml) -[![PythonVersion](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://pypi.org/project/horology/) -[![PythonVersion](https://img.shields.io/badge/OS-linux%20%7C%20windows%20%7C%20macos-green)](https://pypi.org/project/horology/) +[![PythonVersion](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/project/horology/) +[![OperatingSystems](https://img.shields.io/badge/OS-linux%20%7C%20windows%20%7C%20macos-green)](https://pypi.org/project/horology/) [![Downloads](https://pepy.tech/badge/horology/month)](https://pepy.tech/project/horology) [![License: MIT](https://img.shields.io/badge/License-MIT-cyan.svg)](https://opensource.org/licenses/MIT) @@ -17,6 +17,7 @@ Conveniently measures the time of your loops, contexts and functions. | horology version | compatible python | |------------------|-------------------| +| 1.4.1 | 3.10-3.13 | | 1.4 | 3.10-3.12 | | 1.3 | 3.8-3.11 | | 1.2 | 3.6-3.9 | diff --git a/horology/__init__.py b/horology/__init__.py index c40de6e..32ebc80 100644 --- a/horology/__init__.py +++ b/horology/__init__.py @@ -1,4 +1,5 @@ __author__ = 'Maciej J Mikulski' +__version__ = '1.4.1' from horology.timed_context import Timing from horology.timed_decorator import timed