Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
* Upgrade to Python v3.9+
* Upgrade to websockets v10 for compatibility with Python v3.10
* Upgrade mypy & update old type annotations
* Update CI
  • Loading branch information
dtip committed Jan 19, 2024
1 parent 8a9c866 commit 6faeaf5
Show file tree
Hide file tree
Showing 8 changed files with 391 additions and 482 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -25,13 +25,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: "1.3"
- name: Install deps
run: poetry install
- name: Run Mypy
run: make mypy
- name: Run Pytype
if: ${{ matrix.python-version != 3.8 && matrix.os == 'ubuntu-latest' }}
run: make pytype
- name: Run tests
run: make test

Expand All @@ -45,9 +44,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.9
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: "1.3"
- name: Install deps
run: poetry install
- name: Build
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
check: mypy pytype test
check: mypy test

mypy:
poetry run mypy gsc tests

pytype:
poetry run pytype gsc tests

test:
poetry run pytest
2 changes: 1 addition & 1 deletion gsc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.3"
__version__ = "3.0.0"
2 changes: 1 addition & 1 deletion gsc/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AuthenticationError(Exception):

async def handle_login(email: str):
url = BASE_URL + "/socket/websocket"
async with websockets.connect(url) as websocket:
async with websockets.connect(url) as websocket: # type: ignore
login_msg = {
"topic": "login",
"event": "phx_join",
Expand Down
4 changes: 3 additions & 1 deletion gsc/verifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os
import pathlib
import typing as t

from gsc import cli
from gsc.exercises import (
my_first_commit,
Expand All @@ -19,7 +21,7 @@ class VerifyError(Exception):
pass


def verify(exercise: str = None):
def verify(exercise: t.Optional[str] = None):
while not os.path.exists(".git"):
os.chdir("..")
if os.getcwd() == "/":
Expand Down
836 changes: 372 additions & 464 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gsc"
version = "2.0.3"
version = "3.0.0"
description = "Git for Scientists practical exercise helper."
authors = ["Daniel Tipping <[email protected]>"]
license = "GPL-3.0-only"
Expand All @@ -9,16 +9,17 @@ homepage = "https://www.gitscientist.com"
repository = "https://github.com/git-scientist/gsc"

[tool.poetry.dependencies]
python = "^3.6.1"
python = "^3.9"
typer = "^0.1.1"
asyncio = "^3.4.3"
websockets = "^8.1"
websockets = "^10"
requests = "^2.24.0"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
mypy = "^0.770"
pytest = "^7.4"
mypy = "^1.8"
pytype = {version = "^2020.4.1", python = ">=3.6,<3.8"}
types-requests = "^2.31.0.20240106"

[tool.poetry.scripts]
gsc = "gsc.cli:main"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_version():
assert __version__ == "2.0.3"
assert __version__ == "3.0.0"


def test_version_option():
Expand Down

0 comments on commit 6faeaf5

Please sign in to comment.