Skip to content

Commit

Permalink
support Python 3.13, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jdum committed Oct 26, 2024
1 parent b0915d3 commit b890312
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 441 deletions.
33 changes: 0 additions & 33 deletions .github/actions/setup-poetry-env/action.yml

This file was deleted.

62 changes: 27 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,53 @@ name: Main
on:
push:
branches:
- main
- devel
pull_request:
types: [opened, synchronize, reopened]

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
# quality:
# runs-on: ubuntu-latest
# steps:
# - name: Check out
# uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
# - uses: actions/cache@v4
# with:
# path: ~/.cache/pre-commit
# key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
# - name: Set up the environment
# uses: ./.github/actions/setup-poetry-env

- name: Run checks
run: make check
# - name: Run checks
# run: make check

tox:
runs-on: ubuntu-latest
name: Tox with ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
uses: actions/checkout@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
fetch-depth: 0

- name: Load cached venv
uses: actions/cache@v3
- name: Setup python for test ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
path: .tox
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
python-version: ${{ matrix.python-version }}

- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Install dependencies
run: python -m pip install -U setuptools pip wheel "poetry>=1.8" "tox>=4" "tox-gh-actions>=3.2"

- name: Test with tox
run: tox

- name: Upload coverage reports to Codecov with GitHub Action on Python 3.12
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.12' }}
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.13
uses: codecov/codecov-action@v4
if: ${{ matrix.python-version == '3.13' }}
31 changes: 0 additions & 31 deletions .github/workflows/on-release-main.yml

This file was deleted.

20 changes: 10 additions & 10 deletions .github/workflows/validate-codecov-config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: validate-codecov-config

on:
pull_request:
paths: [codecov.yaml]
push:
branches: [main]
pull_request:
paths: [codecov.yaml]
push:
branches: [devel]

jobs:
validate-codecov-config:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Validate codecov configuration
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate
validate-codecov-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate codecov configuration
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ docs/source
__pycache__/
*.py[cod]
*$py.class
.venv/

# C extensions
*.so
Expand Down
10 changes: 0 additions & 10 deletions .pre-commit-config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023, Jerome Dumonteil
Copyright (c) 2023-2024, Jerome Dumonteil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ check: ## Run code quality tools.
@echo "🚀 Checking for obsolete dependencies: Running deptry"
@poetry run deptry .

.PHONY: lint
lint:
isort asciinema_scene
ruff check --fix asciinema_scene

.PHONY: test
test: ## Test the code with pytest
@echo "🚀 Testing code: Running pytest"
Expand Down
3 changes: 3 additions & 0 deletions asciinema_scene/scenelib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class SceneStdinError(Exception):


def detect_stdin_timeout() -> None:
if sys.platform == "win32":
# cant do that on windows
return
selector = selectors.DefaultSelector()
selector.register(sys.stdin, selectors.EVENT_READ)
something = selector.select(timeout=STDIN_TIMEOUT)
Expand Down
Loading

0 comments on commit b890312

Please sign in to comment.