Skip to content

Commit

Permalink
Feature typing (#58)
Browse files Browse the repository at this point in the history
* intial typing support
* removed unused exclusion for py2.7
  • Loading branch information
jvanasco committed May 3, 2023
1 parent ed74fd2 commit 16f4eb3
Show file tree
Hide file tree
Showing 16 changed files with 508 additions and 341 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,13 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
include:
# ubuntu-latest does not have: py27, py36
- os: "ubuntu-20.04"
python-version: "2.7"
# ubuntu-latest[22.04] does not have: py27, py36
- os: "ubuntu-20.04"
python-version: "3.6"
pyramid-version: ["<2", ">=2"]
redis-version: ["<4", ">=4.0.0"]
exclude:
# Pyramid 2 doesn't support Python 2.7 or 3.5
- python-version: 2.7
pyramid-version: ">=2"
# Redis 4.0 require python3.6 or higher
- python-version: 2.7
redis-version: ">=4.0.0"

# Service containers to run with `container-job`
services:
Expand All @@ -53,22 +45,19 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox setuptools flake8 pytest
pip install ".[testing]" "pyramid${{ matrix.pyramid-version }}"
pip install ".[testing]" "redis${{ matrix.redis-version }}"
pip freeze
- name: Test with tox/pytest
# tox is used to run pytest
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog

* unreleased
* code style changes
* dropping PY2
* initial typing support

* 2021.11.16
* version 1.6.3
Expand Down
7 changes: 6 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ cover-erase=1
[aliases]
dev = develop easy_install pyramid_session_redis[testing]

[mypy]
ignore_missing_imports = True

[flake8]
exclude = src/pyramid_session_redis/docs

Expand All @@ -22,7 +25,9 @@ import_order_style = appnexus
per-file-ignores =
setup.py: E501
src/pyramid_session_redis/__init__.py: E501
src/pyramid_session_redis/compat.py: F401
src/pyramid_session_redis/compat.py: F401,E501
src/pyramid_session_redis/legacy.py: E501
src/pyramid_session_redis/session.py: E501
src/pyramid_session_redis/util.py: E501
tests/test_factory.py: E501,E731
tests/test_session.py: E501,E731
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
install_requires = [
"redis>=2.4.11, != 2.9.1",
"pyramid>=1.3",
"six>=1.12.0",
"zope.interface", # in Pyramid
]
testing_requires = [
"nose",
"pytest",
"typing_extensions", # for 3.8 `Literal`
"webob", # in Pyramid
]
testing_extras = install_requires + testing_requires + ["coverage"]
Expand All @@ -50,13 +50,13 @@
"Intended Audience :: Developers",
"Framework :: Pyramid",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
keywords="pyramid session redis",
author="Jonathan Vanasco",
Expand All @@ -68,6 +68,7 @@
where="src",
),
package_dir={"": "src"},
package_data={"pyramid_session_redis": ["py.typed"]},
include_package_data=True,
zip_safe=False,
entry_points="",
Expand Down

0 comments on commit 16f4eb3

Please sign in to comment.