Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to pyproject, bump pyupgrade #542

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
Expand Down
24 changes: 22 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# Intellij
.idea/
*.egg-info

# Python binary files
*.pyc
__pycache__

# Wheel builds
dist/
build/
.eggs

# Tox
/.tox

# Hypothesis
.hypothesis

# Cache
.cache
.eggs
.pytest_cache/

# Tests
test_layer*
test_consumer*

.python-version
.pytest_cache/

# Vscode
.vscode

# pytest-cov code coverage
.coverage
.coverage.**
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand All @@ -19,5 +19,6 @@ repos:
- id: flake8
additional_dependencies:
- flake8-bugbear
- Flake8-pyproject
ci:
autoupdate_schedule: quarterly
2 changes: 1 addition & 1 deletion daphne/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def run(self):
application=application,
endpoints=endpoints,
signal_handlers=False,
**self.kwargs
**self.kwargs,
)
# Set up a poller to look for the port
reactor.callLater(0.1, self.resolve_port)
Expand Down
99 changes: 96 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "daphne"
dynamic = ["version"]
description = "Django ASGI (HTTP/WebSocket) server"
requires-python = ">=3.9"
authors = [
{ name = "Django Software Foundation", email = "[email protected]" },
]

license = { text = "BSD" }
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
]

dependencies = ["asgiref>=3.5.2,<4", "autobahn>=22.4.2", "twisted[tls]>=22.4"]

[project.optional-dependencies]
tests = [
"django",
"hypothesis",
"pytest",
"pytest-asyncio",
"pytest-cov",
"black",
"tox",
"flake8",
"flake8-bugbear",
"mypy",
]

[project.urls]
homepage = "https://github.com/django/daphne"
documentation = "https://channels.readthedocs.io"
repository = "https://github.com/django/daphne.git"
changelog = "https://github.com/django/daphne/blob/main/CHANGELOG.txt"
issues = "https://github.com/django/daphne/issues"

[project.scripts]
daphne = "daphne.cli:CommandLineInterface.entrypoint"

[tool.setuptools]
packages = ["daphne"]

[tool.setuptools.dynamic]
version = { attr = "daphne.__version__" }
readme = { file = "README.rst", content-type = "text/x-rst" }

[tool.flake8]
exclude = [
"venv/*",
"tox/*",
"docs/*",
"testproject/*",
"js_client/*",
".eggs/*",
]
extend-ignore = ["E123", "E128", "E266", "E402", "W503", "E731", "W601", "B036"]
max-line-length = 120

[tool.isort]
profile = "black"

[tool.pytest]
testpaths = ["tests"]
asyncio_mode = "strict"
filterwarnings = ["ignore::pytest.PytestDeprecationWarning"]

[tool.coverage.run]
omit = ["tests/*"]
concurrency = ["multiprocessing"]

[tool.coverage.report]
show_missing = "true"
skip_covered = "true"

[tool.coverage.html]
directory = "reports/coverage_html_report"

[tool.tox]
envlist = ["py39", "py310", "py311", "py312", "py313"]

[tool.tox.testenv]
extras = ["tests"]
commands = ["pytest -v {posargs}"]
59 changes: 0 additions & 59 deletions setup.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions tox.ini

This file was deleted.

Loading