Skip to content

Commit

Permalink
Support Python 3.10 (#1)
Browse files Browse the repository at this point in the history
* python: test 3.10 support

* fix: backport StrEnum

* refactor: shorten CI names
  • Loading branch information
MikulasZelinka authored Jan 5, 2023
1 parent f414b8d commit 74b616a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 12 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
name: Pre-commit checks (black, isort, mypy, flake8, pytest)
name: Test

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

# This allows a subsequently queued workflow run to interrupt previous runs
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix#example-workflow
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
install-and-test:
test:

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.11"]
python-version: ["3.10", "3.11"]

runs-on: ${{ matrix.os }}

Expand All @@ -34,15 +42,15 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Using poetry, install the package
run: |
poetry --version
poetry install
- name: Check installed packages (both conda and poetry/pip)
- name: Check installed packages
run: |
poetry env info
pip list
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ The search (launcher) can be triggered from anywhere as it's listening for a glo
pip install searchlauncher
```

Requires Python 3.11 [for now](#todo).
#### Requirements

Python `>=3.10` with [`tkinter`](https://docs.python.org/3/library/tkinter.html) installed.

### Running in background

Expand Down Expand Up @@ -67,7 +69,6 @@ You can also customise the default `shortcut` hotkey as well as shortcuts for al
- [x] Customise search sites
- [x] Customisable search groups
- [ ] Add and select different browsers
- [ ] Support Python versions older than just 3.11

## Development

Expand Down
34 changes: 32 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "searchlauncher"
version = "0.1.1"
version = "0.2.0"
description = "Search multiple websites using a single shortcut."
authors = ["Mikuláš Zelinka <[email protected]>"]
readme = "README.md"
Expand All @@ -10,12 +10,13 @@ repository = "https://github.com/MikulasZelinka/searchlauncher"
searchlauncher = 'searchlauncher.cli:cli'

[tool.poetry.dependencies]
python = "^3.11"
python = "^3.10"
keyboard = "^0.13.5"
typer = {extras = ["all"], version = "^0.7.0"}
loguru = "^0.6.0"
pydantic = "^1.10.4"
tomlkit = "^0.11.6"
"backports.strenum" = { version = "^1.1.1", python = "<3.11" }

[tool.poetry.group.dev.dependencies]
black = "^22.10.0"
Expand Down
7 changes: 6 additions & 1 deletion src/searchlauncher/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from enum import StrEnum
import sys

if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from backports.strenum import StrEnum # type: ignore
from typing import Generator

import typer
Expand Down

0 comments on commit 74b616a

Please sign in to comment.