Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ jobs:
fail-fast: false
matrix:
include:
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.11", os: "ubuntu-latest", session: "docs-build" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "windows-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "pip-audit" }
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.12", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.12", os: "ubuntu-latest", session: "docs-build" }
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
- { python: "3.12", os: "windows-latest", session: "tests" }
- { python: "3.12", os: "ubuntu-latest", session: "pip-audit" }
- { python: "3.13", os: "ubuntu-latest", session: "tests" }

# - { python: "3.10", os: "ubuntu-latest", session: "mypy" }
# - { python: "3.9", os: "ubuntu-latest", session: "mypy" }
# - { python: "3.12", os: "ubuntu-latest", session: "mypy" }
# - { python: "3.10", os: "ubuntu-latest", session: "typeguard" }

env:
Expand Down Expand Up @@ -141,7 +142,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
- id: pyupgrade
description: Automatically upgrade syntax for newer versions.
types: [python]
args: [--py37-plus]
args: [--py310-plus]

# Prettier is failing in CI for Markdown files, so we disable it for now. It does not do much for us anyway.
# - repo: https://github.com/pre-commit/mirrors-prettier
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
python: "3.12"
sphinx:
configuration: docs/conf.py
formats: all
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Indicate you are working on a task by adding your GitHub @name after the task in
Definition of Done items are often a great starting point for contributing in a meaningful way while getting integrated into team practices.
Using SSH keys to check out the repository is ideal, as we require contributors to sign their commits.

You need Python 3.9+ and the following tools:
You need Python 3.10, 3.11, 3.12, or 3.13 and the following tools:

- [uv]
- [Nox]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metric is reported in hours.

## Requirements

- Python 3.9+
- Python 3.10, 3.11, 3.12, or 3.13
- uv (installation instructions provided [here](https://github.com/astral-sh/uv?tab=readme-ov-file#installation))
- Supported OS: Windows 10, Windows 11, Linux, MacOS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Our project includes data analysis.
## Decision

We will use Python for the main application functionality, Python for tests, and Poetry for build and dependency automation.
We are supporting Python 3.9 and 3.10 in order to use modern type hinting.
We are supporting Python 3.10, 3.11, 3.12, and 3.13 in order to use modern type hinting.

## Rationale

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
PYPROJECT = nox.project.load_toml("pyproject.toml")

package = "devops_deployment_metrics"
python_versions = ["3.11", "3.9", "3.10"]
python_versions = ["3.12", "3.10", "3.11", "3.13"]
nox.needs_version = ">= 2024.4.15"
nox.options.sessions = (
"pre-commit",
Expand Down
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ name = "devops-deployment-metrics"
version = "0.0.1"
description = "DevOps Deployment Metrics"
authors = [{ name = "Flexion, Inc.", email = "noreply@flexion.us" }]
requires-python = "~=3.9"
requires-python = ">=3.10"
readme = "README.md"
license = "MIT"
classifiers = ["Development Status :: 1 - Planning"]
classifiers = [
"Development Status :: 1 - Planning",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"click>=8.0.1",
"pandas>=2.0.0,<3",
Expand Down Expand Up @@ -110,8 +117,8 @@ exclude = [
line-length = 88
indent-width = 4

# Assume Python 3.8
target-version = "py38"
# Assume Python 3.12
target-version = "py312"

[tool.ruff.lint]
# Enable Pyflakes (`F`)
Expand Down
2 changes: 1 addition & 1 deletion src/devops_deployment_metrics/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from zoneinfo import ZoneInfo

import toml
from zoneinfo import ZoneInfo

from devops_deployment_metrics.workflow import Workflow

Expand Down
5 changes: 3 additions & 2 deletions src/devops_deployment_metrics/metrics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""This module contains classes for calculating deployment metrics."""

from collections.abc import Iterable
from dataclasses import asdict
from datetime import datetime, timedelta, timezone
from typing import Any, Iterable, Optional
from typing import Any

import pandas as pd

Expand Down Expand Up @@ -45,7 +46,7 @@ def get_deployments_in_period(
deployments: list[WorkflowRun],
days_slice: int,
start_date: datetime,
end_period: Optional[datetime] = None,
end_period: datetime | None = None,
) -> Iterable[tuple[datetime, list[WorkflowRun]]]:
"""Get the deployments for each period."""
# Using this workaround to get the current datetime with the local timezone
Expand Down
Loading