Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ jobs:
tox:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- pypy3
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
# - "3.14"
- "pypy3.11"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down
24 changes: 12 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
import sys
import re

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath("../.."))

PROJECT_ROOT = os.path.dirname(__file__)
# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open(os.path.join(PROJECT_ROOT, '../../', 'src/priority/__init__.py')) as file_:
with open(os.path.join(PROJECT_ROOT, "../../", "src/priority/__init__.py")) as file_:
text = file_.read()
match = re.search(version_regex, text)
version = match.group(1)


# -- Project information -----------------------------------------------------

project = 'priority'
copyright = '2021, Cory Benfield'
author = 'Cory Benfield'
project = "priority"
copyright = "2021, Cory Benfield"
author = "Cory Benfield"
release = version

# -- General configuration ------------------------------------------------
Expand All @@ -38,29 +38,29 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
intersphinx_mapping = {"python": ("http://docs.python.org/", None)}

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = "default"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
56 changes: 28 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

PROJECT_ROOT = os.path.dirname(__file__)

with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_:
with open(os.path.join(PROJECT_ROOT, "README.rst")) as file_:
long_description = file_.read()

version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open(os.path.join(PROJECT_ROOT, 'src/priority/__init__.py')) as file_:
with open(os.path.join(PROJECT_ROOT, "src/priority/__init__.py")) as file_:
text = file_.read()
match = re.search(version_regex, text)
if match:
Expand All @@ -20,36 +20,36 @@
raise RuntimeError("No version number found!")

setup(
name='priority',
name="priority",
version=version,
description='A pure-Python implementation of the HTTP/2 priority tree',
description="A pure-Python implementation of the HTTP/2 priority tree",
long_description=long_description,
long_description_content_type='text/x-rst',
author='Cory Benfield',
author_email='[email protected]',
url='https://github.com/python-hyper/priority/',
long_description_content_type="text/x-rst",
author="Cory Benfield",
author_email="[email protected]",
url="https://github.com/python-hyper/priority/",
project_urls={
'Documentation': 'https://python-hyper.org/projects/priority/',
'Source': 'https://github.com/python-hyper/priority/',
'Tracker': 'https://github.com/python-hyper/priority/issues',
'Changelog': 'https://github.com/python-hyper/priority/blob/master/HISTORY.rst',
"Documentation": "https://python-hyper.org/projects/priority/",
"Source": "https://github.com/python-hyper/priority/",
"Tracker": "https://github.com/python-hyper/priority/issues",
"Changelog": "https://github.com/python-hyper/priority/blob/master/HISTORY.rst",
},
packages=find_packages(where='src'),
package_data={'priority': ['py.typed']},
package_dir={'': 'src'},
python_requires='>=3.6.1',
license='MIT License',
packages=find_packages(where="src"),
package_data={"priority": ["py.typed"]},
package_dir={"": "src"},
python_requires=">=3.6.1",
license="MIT License",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
)
14 changes: 7 additions & 7 deletions test/test_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def test_streams_are_well_ordered(self, streams_and_weights):
assert sorted(streams_by_id) == streams_by_id

@given(
integers(min_value=1, max_value=2 ** 24),
integers(min_value=1, max_value=2 ** 24),
integers(min_value=1, max_value=2**24),
integers(min_value=1, max_value=2**24),
)
def test_stream_ordering(self, a, b):
"""
Expand Down Expand Up @@ -554,7 +554,7 @@ def __init__(self):
self.stream_ids = set([0])
self.blocked_stream_ids = set()

@rule(stream_id=integers()) # type: ignore[no-untyped-call]
@rule(stream_id=integers())
def insert_stream(self, stream_id):
try:
self.tree.insert_stream(stream_id)
Expand All @@ -574,24 +574,24 @@ def _run_action(self, action, stream_id):
else:
assert stream_id in self.stream_ids

@rule(stream_id=integers()) # type: ignore[no-untyped-call]
@rule(stream_id=integers())
def remove_stream(self, stream_id):
self._run_action(self.tree.remove_stream, stream_id)
if stream_id != 0:
self.stream_ids.discard(stream_id)

@rule(stream_id=integers()) # type: ignore[no-untyped-call]
@rule(stream_id=integers())
def block_stream(self, stream_id):
self._run_action(self.tree.block, stream_id)
if (stream_id != 0) and (stream_id in self.stream_ids):
self.blocked_stream_ids.add(stream_id)

@rule(stream_id=integers()) # type: ignore[no-untyped-call]
@rule(stream_id=integers())
def unblock_stream(self, stream_id):
self._run_action(self.tree.unblock, stream_id)
self.blocked_stream_ids.discard(stream_id)

@invariant() # type: ignore[no-untyped-call]
@invariant()
def check_next_stream_consistent(self):
"""
If we ask priority for the next stream, it always returns a sensible
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ commands = pytest {posargs}
[testenv:lint]
deps =
flake8>=3.8,<4
black==21.6b0
black
mypy==0.910
{[testenv]deps}
commands =
Expand All @@ -37,8 +37,8 @@ commands =

[testenv:docs]
deps =
sphinx>=3.5,<5
whitelist_externals = make
sphinx
allowlist_externals = make
changedir = {toxinidir}/docs
commands =
make clean
Expand All @@ -48,9 +48,9 @@ commands =
basepython = python3.9
deps =
check-manifest==0.46
readme-renderer==29.0
twine>=3.4.1,<4
whitelist_externals = rm
readme-renderer
twine
allowlist_externals = rm
commands =
rm -rf dist/
check-manifest
Expand Down