Skip to content

Commit b358610

Browse files
drop Python 3.7 (#65)
* drop Python 3.7 * update pygments * remove py37 specific code * isort * pin poetry version in CI * use variables in MAKEFILE * remove ifdef
1 parent b5cb6b5 commit b358610

File tree

6 files changed

+54
-179
lines changed

6 files changed

+54
-179
lines changed

.github/workflows/test-lock.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ ubuntu-latest ]
12-
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
12+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
1313
runs-on: ${{ matrix.os }}
1414
steps:
1515
- name: Check out OQpy
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Install poetry
2525
run: |
26-
make install-poetry
26+
make install-poetry poetry_version=1.5.1
2727
poetry --version
2828
poetry config virtualenvs.in-project true
2929

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ ubuntu-latest ]
15-
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
15+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Check out OQpy
@@ -79,7 +79,7 @@ jobs:
7979
strategy:
8080
matrix:
8181
os: [ ubuntu-latest ]
82-
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
82+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
8383
runs-on: ${{ matrix.os }}
8484
steps:
8585
- name: Check out OQpy
@@ -93,7 +93,7 @@ jobs:
9393

9494
- name: Install poetry
9595
run: |
96-
make install-poetry
96+
make install-poetry poetry_version=1.5.1
9797
poetry --version
9898
poetry config virtualenvs.in-project true
9999

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ check-citation:
4646
.PHONY: install-poetry
4747
install-poetry:
4848
command -v curl >/dev/null 2>&1 || { echo >&2 "please install curl and retry."; exit 1; }
49-
curl -sSL https://install.python-poetry.org | python -
49+
curl -sSL https://install.python-poetry.org | POETRY_VERSION=$(poetry_version) python -

oqpy/base.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,23 @@
2222
from __future__ import annotations
2323

2424
import math
25-
import sys
2625
from abc import ABC, abstractmethod
27-
from typing import TYPE_CHECKING, Any, Iterable, Optional, Sequence, Union
26+
from typing import (
27+
TYPE_CHECKING,
28+
Any,
29+
Iterable,
30+
Optional,
31+
Protocol,
32+
Sequence,
33+
Union,
34+
runtime_checkable,
35+
)
2836

2937
import numpy as np
3038
from openpulse import ast
3139

3240
from oqpy import classical_types
3341

34-
if sys.version_info >= (3, 8):
35-
from typing import Protocol, runtime_checkable
36-
else:
37-
from typing_extensions import Protocol, runtime_checkable
38-
3942
if TYPE_CHECKING:
4043
from oqpy import Program
4144

0 commit comments

Comments
 (0)