Skip to content
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

Add experimental python 3.13 CI #10

Merged
merged 10 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 3 additions & 41 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
uses: actions/checkout@v4

# 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}}"
3 changes: 2 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ 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"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

env:
POETRY_VIRTUALENVS_CREATE: false
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions horology/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__author__ = 'Maciej J Mikulski'
__version__ = '1.4.1'

from horology.timed_context import Timing
from horology.timed_decorator import timed
Expand Down
2 changes: 1 addition & 1 deletion horology/timed_iterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <maciej.mikulski.jr@gmail.com>"]
license = "MIT"
Expand All @@ -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',
Expand All @@ -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"
8 changes: 4 additions & 4 deletions tests/test_actual_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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()
Expand All @@ -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')
Expand Down
Loading