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

Support Python 3.8-3.14 #35

Merged
merged 8 commits into from
Nov 7, 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
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.1"]
toxenv: [py]
include:
- python: "3.10"
- python: "3.13"
toxenv: flake8
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -27,7 +27,7 @@ jobs:
- run: tox -e ${{ matrix.toxenv }}
all-tests-succeeded:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [test]
steps:
- name: All tests succeeded
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- "master"
release:
types: [published]
workflow_dispatch:


jobs:
release:
env:
POETRY_VERSION: "1.8.4"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Python package version (tag)
if: github.ref_type == 'tag'
run: echo 'PYTHON_PACKAGE_VERSION=${{ github.ref_name }}' >> ${GITHUB_ENV}
- name: Python package version (branch)
if: github.ref_type != 'tag'
run: echo 'PYTHON_PACKAGE_VERSION=0.0.0.dev' >> ${GITHUB_ENV}
- uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Poetry env
run: echo "POETRY_HOME=${{ runner.temp }}/.poetry" >> ${GITHUB_ENV}
- name: Poetry path
run: echo "${POETRY_HOME}/bin" >> ${GITHUB_PATH}
- name: Install Poetry
run: |
set -x \
&& python -m venv "${POETRY_HOME}" \
&& "${POETRY_HOME}/bin/pip" install -U pip wheel setuptools \
&& "${POETRY_HOME}/bin/pip" install "poetry==${POETRY_VERSION}"
- run: poetry version "${PYTHON_PACKAGE_VERSION}"
- name: Build and publish the PyPI package
if: github.ref_type == 'tag'
run: POETRY_PYPI_TOKEN_PYPI='${{ secrets.PYPI_TOKEN }}' poetry publish --build
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ lot of code snippets, but none of them is powerful or convenient enough to do ou
jobs.
BisTiming aims at implementing all the missing functions in those code snippets and
prevents us from reinventing the wheel.
It is very useful when we want to log something with some timing information or
It is very useful when we want to log something with some timing information or
optimize the performance of our code.

This package is tested with Python 2.7, 3.5, 3.6 and 3.7, but might also work in other
This package is tested with Python 3.8 to 3.14, but might also work in other
Python versions.

.. contents::
Expand Down
1,948 changes: 1,142 additions & 806 deletions poetry.lock

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "~2.7 || ^3.5"
python = "^3.7"
six = "^1.12"
tabulate = "^0.8.7"
tabulate = "^0.9"
importlib-metadata = {version = "*", python = "<3.8"}

[tool.poetry.dev-dependencies]
pytest = { version = "^6.0", python = "^3.8" }
flake8 = { version = "^4.0", python = "^3.8" }
pep8-naming = { version = "^0.12.1", python = "^3.8"}
flake8-import-order = { version = "^0.18.1", python = "^3.8"}
flake8-bugbear = { version = "^21.9.2", python = "^3.8"}
flake8-comprehensions = { version = "^3.2.3", python = "^3.8"}
flake8-docstrings = { version = "^1.5.0", python = "^3.8"}
flake8-logging-format = { version = "^0.6.0", python = "^3.8"}
flake8-return = { version = "^1.1.2", python = "^3.8"}
flake8-black = { version = "^0.2.1", python = "^3.8"}
tox = { version = "^3.19", python = "^3.8" }
coverage = { version = "^6.0", python = "^3.8" }
black = { version = "=21.9b0", python = "^3.8" }
rstcheck = { version = "^3.3.1", python = "^3.8" }
docutils = { version = "^0.17", python = "^3.8" }
sphinx = { version = "^4.2.0", python = "^3.8"}
sphinx-rtd-theme = { version = "^1.0.0", python = "^3.8"}
pytest = { version = "^8.0", python = "^3.10" }
flake8 = { version = "^7.0", python = "^3.10" }
pep8-naming = { version = "^0.14", python = "^3.10"}
flake8-import-order = { version = "^0.18.1", python = "^3.10"}
flake8-bugbear = { version = "^24.0", python = "^3.10"}
flake8-comprehensions = { version = "^3.2.3", python = "^3.10"}
flake8-docstrings = { version = "^1.5.0", python = "^3.10"}
flake8-logging-format = { version = "^2024.0", python = "^3.10"}
flake8-return = { version = "^1.1.2", python = "^3.10"}
flake8-black = { version = "^0.3", python = "^3.10"}
tox = { version = "^4.0", python = "^3.10" }
coverage = { version = "^7.0", python = "^3.10" }
black = { version = "^24.0.0", python = "^3.10" }
rstcheck = { version = "^6.0", python = "^3.10" }
docutils = { version = "^0.21", python = "^3.10" }
sphinx = { version = "^8.0", python = "^3.10"}
sphinx-rtd-theme = { version = "^3.0", python = "^3.10"}

[tool.black]
target-version = ['py38']
Expand Down
12 changes: 7 additions & 5 deletions src/bistiming/multistopwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ def get_mean_per_split(self):
mean_elapsed_time_per_split : List[datetime.timedelta]
"""
return [
div_timedelta(
sum(stopwatch.split_elapsed_time, datetime.timedelta()),
len(stopwatch.split_elapsed_time),
(
div_timedelta(
sum(stopwatch.split_elapsed_time, datetime.timedelta()),
len(stopwatch.split_elapsed_time),
)
if stopwatch.split_elapsed_time
else datetime.timedelta()
)
if stopwatch.split_elapsed_time
else datetime.timedelta()
for stopwatch in self
]

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = true
envlist = py{27, 36, 37, 38, 39, 310}, flake8
envlist = py{38, 39, 310, 311, 312, 313, 314}, flake8

[testenv]
deps =
Expand All @@ -14,7 +14,7 @@ commands =
[testenv:flake8]
deps =
skip_install = true
whitelist_externals =
allowlist_externals =
poetry
commands =
# use poetry to install all dev dependencies
Expand Down
Loading