Skip to content

Commit

Permalink
support Python3.12, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jdum committed Oct 20, 2023
1 parent 82f586d commit 03ee2d7
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 289 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.230"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.1
hooks:
- id: ruff

- repo: https://github.com/psf/black
rev: "22.8.0"
rev: "23.9.1"
hooks:
- id: black
- id: black
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: install
install: ## Install the poetry environment and install the pre-commit hooks
@echo "🚀 Creating virtual environment using pyenv and poetry"
@poetry install
@poetry install
@ poetry run pre-commit install
@poetry shell

.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Checking Poetry lock file consistency with 'pyproject.toml': Running poetry lock --check"
@poetry lock --check
@poetry check --lock
@echo "🚀 Linting code: Running pre-commit"
@poetry run pre-commit run -a
@echo "🚀 Static type checking: Running mypy"
Expand Down Expand Up @@ -45,4 +45,4 @@ build-and-publish: build publish ## Build and publish.
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

.DEFAULT_GOAL := help
.DEFAULT_GOAL := help
4 changes: 3 additions & 1 deletion asciinema_scene/scenelib/scene_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def info(self) -> str:
@property
def date(self) -> str:
timestamp = self.header.get("timestamp", 0)
return datetime.fromtimestamp(timestamp, timezone.utc).isoformat(" ")
return datetime.fromtimestamp(timestamp, timezone.utc).isoformat( # noqa: UP017
" "
)

@property
def length(self) -> int:
Expand Down
520 changes: 255 additions & 265 deletions poetry.lock

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[tool.poetry]
name = "asciinema_scene"
version = "0.7.1"
version = "0.8.0"
description = "Toolbox to edit asciinema screencasts (sciine)."
authors = ["Jerome Dumonteil <[email protected]>"]
repository = "https://github.com/jdum/asciinema-scene"
documentation = "https://jdum.github.io/asciinema-scene/"
readme = "README.md"
license = "MIT"
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [
{include = "asciinema_scene"}
Expand All @@ -23,24 +24,24 @@ sciine = "asciinema_scene.sciine:cli"

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
click = "^8.1.3"
click = "^8"

[tool.poetry.group.dev.dependencies]
urllib3 = ">1.22,<2"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
deptry = "^0.6.4"
mypy = "^0.981"
pytest = "*"
pytest-cov = "*"
deptry = "*"
mypy = "*"
pre-commit = "^2.20.0"
tox = "^3.25.1"
tox = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
target-version = ['py310']
target-version = ['py312']

[tool.mypy]
files = ["asciinema_scene"]
Expand All @@ -53,9 +54,9 @@ warn_unused_ignores = "True"
show_error_codes = "True"

[tool.ruff]
target-version = "py310"
target-version = "py312"
line-length = 88
fix = true
fix = false
select = [
# flake8-2020
"YTT",
Expand Down Expand Up @@ -96,7 +97,7 @@ ignore = [
#Use specific rule codes when ignoring type issues
"PGH003",
#check for execution of untrusted input
# "S603",
"S603",
]

[tool.ruff.per-file-ignores]
Expand Down
6 changes: 4 additions & 2 deletions tests/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from importlib import resources as rso

LONG_FILE_CONTENT = gzip.decompress(
rso.read_binary("tests.files", "long.cast.gz")
rso.files("tests.files").joinpath("long.cast.gz").read_bytes()
).decode()

SHORT_FILE_CONTENT = rso.read_text("tests.files", "short.cast", encoding="utf8")
SHORT_FILE_CONTENT = (
rso.files("tests.files").joinpath("short.cast").read_text(encoding="utf8")
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
skipsdist = true
envlist = py310, py311
envlist = py310, py311, py312

[gh-actions]
python =
Expand Down

0 comments on commit 03ee2d7

Please sign in to comment.