Skip to content

Commit

Permalink
feat: support python 3.11, & disable typing tests (#42)
Browse files Browse the repository at this point in the history
* feat: support python 3.11

* fix: bump cython and disable type tests

* test: not strict xfail
  • Loading branch information
tlambert03 authored Nov 9, 2022
1 parent 8a51f73 commit 42dcf2d
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: ["ubuntu-latest"]
include:
# - platform: "windows-latest"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.10', '3.11']
platform: [ubuntu-latest, macos-latest, windows-latest]
include:
- python-version: '3.8'
platform: ubuntu-latest
- python-version: '3.9'
platform: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
user=tlambert03
user=napari
project=in-n-out
issues=false
exclude-labels=duplicate,question,invalid,wontfix,hide
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# in-n-out

[![License](https://img.shields.io/pypi/l/in-n-out.svg?color=green)](https://github.com/tlambert03/in-n-out/raw/main/LICENSE)
[![License](https://img.shields.io/pypi/l/in-n-out.svg?color=green)](https://github.com/napari/in-n-out/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/in-n-out.svg?color=green)](https://pypi.org/project/in-n-out)
[![Python Version](https://img.shields.io/pypi/pyversions/in-n-out.svg?color=green)](https://python.org)
[![CI](https://github.com/tlambert03/in-n-out/actions/workflows/ci.yml/badge.svg)](https://github.com/tlambert03/in-n-out/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/tlambert03/in-n-out/branch/main/graph/badge.svg)](https://codecov.io/gh/tlambert03/in-n-out)
[![CI](https://github.com/napari/in-n-out/actions/workflows/ci.yml/badge.svg)](https://github.com/napari/in-n-out/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/napari/in-n-out/branch/main/graph/badge.svg)](https://app.codecov.io/gh/napari/in-n-out)

Python dependency injection you can taste.

Expand Down
6 changes: 3 additions & 3 deletions asv.conf.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"version": 1,
"project": "in-n-out",
"project_url": "https://github.com/tlambert03/in-n-out",
"project_url": "https://github.com/napari/in-n-out",
"repo": ".",
"branches": ["main"],
"dvcs": "git",
"environment_type": "conda",
"install_timeout": 600,
"show_commit_url": "https://github.com/tlambert03/in-n-out/commit/",
"show_commit_url": "https://github.com/napari/in-n-out/commit/",
"pythons": ["3.10"],
"matrix": {
"pip+cython": ["3.0.0a10", null]
"pip+cython": ["3.0.0a11", null]
},
"env_dir": "/tmp/.asv/env",
"results_dir": ".asv/results",
Expand Down
16 changes: 11 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# https://peps.python.org/pep-0517/
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools-scm>=6.2", "Cython==3.0a10"]
requires = [
"setuptools>=45",
"wheel",
"setuptools-scm>=6.2",
"Cython==3.0.0a11",
]
build-backend = "setuptools.build_meta"

# https://peps.python.org/pep-0621/
Expand All @@ -18,14 +23,15 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dynamic = ["version"]
dependencies = []

# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
test = ["pytest>=6.0", "pytest-cov", "pytest-mypy-testing", "toolz"]
test = ["pytest>=6.0", "pytest-cov", "toolz"]
dev = [
"black",
"cruft",
Expand All @@ -45,11 +51,11 @@ dev = [
"pytest",
"rich",
]
build = ["Cython==3.0a10;sys_platform != 'win32'"]
build = ["Cython==3.0.0a11;sys_platform != 'win32'"]

[project.urls]
homepage = "https://github.com/tlambert03/in-n-out"
repository = "https://github.com/tlambert03/in-n-out"
homepage = "https://github.com/napari/in-n-out"
repository = "https://github.com/napari/in-n-out"

# same as console_scripts entry point
# [project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def test_inject_instance_into_unbound_method():


# https://github.com/cython/cython/issues/4888
@pytest.mark.xfail(bool(_compiled), reason="Cython doesn't support this", strict=True)
@pytest.mark.xfail(bool(_compiled), reason="Cython doesn't support this")
def test_generators():
def generator_func() -> Generator:
yield 1
Expand Down
4 changes: 4 additions & 0 deletions tests/typesafety/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pytest

pytest.skip("flaky pytest mypy plugins", allow_module_level=True)
# FIXME: re-enable after looking into testing with pytest-mypy-plugins again
8 changes: 2 additions & 6 deletions tests/typesafety/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@
# E: <msg> - we expect a mypy error message
# R: <msg> - we expect a mypy note message Revealed type is '<msg>'
"""
import os

import pytest

import in_n_out as ino

# flake8: noqa
# fmt: off
from typing_extensions import reveal_type

import in_n_out as ino


@pytest.mark.skipif(os.name == 'nt', reason="skip on windows")
@pytest.mark.mypy_testing
def mypy_test_injection() -> None:

Expand All @@ -42,7 +40,6 @@ def f(x: int) -> int:
injected(1, 2)


@pytest.mark.skipif(os.name == 'nt', reason="skip on windows")
@pytest.mark.mypy_testing
def mypy_test_provider() -> None:
store = ino.Store('name')
Expand Down Expand Up @@ -70,7 +67,6 @@ def func2() -> int:
reveal_type(outfunc2) # R: def () -> builtins.int


@pytest.mark.skipif(os.name == 'nt', reason="skip on windows")
@pytest.mark.mypy_testing
def mypy_test_processor() -> None:
store = ino.Store('name')
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38,39,310}-{linux,macos,windows}
envlist = py{38,39,310,311}-{linux,macos,windows}
isolated_build = true
toxworkdir=/tmp/.tox

Expand All @@ -8,6 +8,7 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
PLATFORM =
Expand Down

0 comments on commit 42dcf2d

Please sign in to comment.