* Hatch support and general build cleanups.
run: |
sudo apt install -y gnome-keyring
python -m pip install --upgrade pip
- python -m pip install poetry
- poetry install -E dnssec -E doh -E idna -E trio
+ python -m pip install cryptography trio idna httpx h2 aioquic
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- python -m pip install poetry
- poetry install -E dnssec -E doh -E idna -E trio -E doq
+ python -m pip install cryptography trio idna httpx h2 aioquic mypy pytest pytest-cov
- name: Typecheck
run: |
- poetry run python -m mypy --install-types --non-interactive --disallow-incomplete-defs dns
+ python -m mypy --install-types --non-interactive --disallow-incomplete-defs dns
- name: Test with pytest
run: |
- poetry run pytest --cov=dns --cov-branch --cov-report=xml:coverage.xml
+ pytest --cov=dns --cov-branch --cov-report=xml:coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
coverage.xml
.dir-locals.el
.vscode/
+doc/_build
\ No newline at end of file
+++ /dev/null
-include LICENSE ChangeLog README.md
-recursive-include examples *.txt *.py
-recursive-include tests *.txt *.py Makefile *.good example query *.pickle *.text *.generic
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile,v 1.16 2004/03/19 00:17:27 halley Exp $
-
-PYTHON=python
-
-all:
- ${PYTHON} ./setup.py build
-
-install:
- ${PYTHON} ./setup.py install
+build:
+ python -m build
clean:
- ${PYTHON} ./setup.py clean --all
- find . -name '*.pyc' -exec rm {} \;
- find . -name '*.pyo' -exec rm {} \;
- rm -f TAGS
rm -rf htmlcov .coverage
rm -rf .pytest_cache
-
-distclean: clean docclean
- rm -rf build dist
- rm -f MANIFEST
- rm -rf dnspython.egg-info
+ rm -rf .ruff_cache
+ rm -rf .mypy_cache
+ rm -rf doc/_build
+ rm -rf dist
+ rm -rf build
doc:
cd doc; make html
-docclean:
- rm -rf doc/_build
-
-check: test
-
test:
- cd tests; make test
-
-potest:
- poetry run pytest
-
-potestlf:
- poetry run pytest --lf
-
-potype:
- poetry run python -m mypy --install-types --non-interactive --disallow-incomplete-defs dns
+ pytest
-potypetests:
- poetry run python -m mypy --check-untyped-defs examples tests
-
-polint:
- poetry run pylint dns
-
-poflake:
- poetry run flake8 dns
+check: test
-poruff:
- poetry run ruff dns
+type:
+ python -m mypy --install-types --non-interactive --disallow-incomplete-defs dns
-pocov:
- poetry run coverage run --branch -m pytest
- poetry run coverage html --include 'dns/*'
- poetry run coverage report --include 'dns/*'
+lint:
+ pylint dns
-oldpokit:
- po run python setup.py sdist --formats=zip bdist_wheel
+flake:
+ flake8 dns
-pokit:
- po build
+ruff:
+ ruff dns
-findjunk:
- find dns -type f | egrep -v '.*\.py' | egrep -v 'py\.typed'
+cov:
+ coverage --branch -m pytest
+ coverage html --include 'dns/*'
+ coverage report --include 'dns/*'
-poblack:
- poetry run black dns examples tests
+black:
+ black dns examples tests
+++ /dev/null
-[mypy]
-
-[mypy-trio]
-ignore_missing_imports = True
-
-[mypy-pythoncom]
-ignore_missing_imports = True
-
-[mypy-wmi]
-ignore_missing_imports = True
-
-[mypy-httpcore.*]
-ignore_missing_imports = True
-[tool.poetry]
+[build-system]
+requires = ["hatchling>=1.17.0"]
+build-backend = "hatchling.build"
+
+[project]
name = "dnspython"
-version = "2.5.0"
description = "DNS toolkit"
-authors = ["Bob Halley <halley@dnspython.org>"]
-license = "ISC"
-packages = [
- {include = "dns"}
-]
-include = [
- { path="LICENSE", format="sdist" },
- { path="README.md", format="sdist" },
- { path="examples/*.txt", format="sdist" },
- { path="examples/*.py", format="sdist" },
- { path="tests/*.txt", format="sdist" },
- { path="tests/*.py", format="sdist" },
- { path="tests/*.good", format="sdist" },
- { path="tests/example", format="sdist" },
- { path="tests/query", format="sdist" },
- { path="tests/*.pickle", format="sdist" },
- { path="tests/*.text", format="sdist" },
- { path="tests/*.generic", format="sdist" },
- { path="tests/tls/*.crt", format="sdist" },
- { path="tests/tls/*.pem", format="sdist" },
- { path="util/**", format="sdist" },
- { path="setup.cfg", format="sdist" },
-]
-exclude = [
- "**/.DS_Store",
- "**/__pycache__/**",
+authors = [{ name = "Bob Halley", email = "halley@dnspython.org" }]
+classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: ISC License (ISCL)",
+ "Operating System :: POSIX",
+ "Operating System :: Microsoft :: Windows",
+ "Programming Language :: Python",
+ "Topic :: Internet :: Name Service (DNS)",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
]
readme = "README.md"
+requires-python = ">=3.8"
+dependencies = []
+dynamic = ["version"]
+
+[project.optional-dependencies]
+dev = [
+ "black>=23.1.0",
+ "coverage>=7.0",
+ "flake8>=5.0.3",
+ "mypy>=1.0.1",
+ "pylint>=2.7",
+ "pytest>=6.2.5",
+ "pytest-cov>=3.0.0",
+ "sphinx>=7.0.0",
+ "twine>=4.0.0",
+ "wheel>=0.41.0",
+]
+dnssec = ["cryptography>=41"]
+doh = ["httpcore>=0.17.3", "httpx>=0.25.1", "h2>=4.1.0"]
+doq = ["aioquic>=0.9.20"]
+idna = ["idna>=2.1"]
+trio = ["trio>=0.14"]
+wmi = ["wmi>=1.5.1"]
+
+[project.urls]
homepage = "https://www.dnspython.org"
repository = "https://github.com/rthalley/dnspython.git"
documentation = "https://dnspython.readthedocs.io/en/stable/"
+issues = "https://github.com/rthalley/dnspython/issues"
-[tool.poetry.urls]
-"Bug Tracker" = "https://github.com/rthalley/dnspython/issues"
-
-[tool.poetry.dependencies]
-python = "^3.8"
-httpx = {version=">=0.24.1", optional=true}
-httpcore = {version=">=0.17.3", optional=true}
-h2 = {version=">=4.1.0", optional=true}
-idna = {version=">=2.1,<4.0", optional=true}
-cryptography = {version=">=2.6", optional=true}
-trio = {version=">=0.14,<0.24", optional=true}
-wmi = {version="^1.5.1", optional=true}
-aioquic = {version=">=0.9.20", optional=true}
+[tool.hatch.build.targets.sdist]
+include = [
+ "/dns/*.py",
+ "/dns/**/*.py",
+ "/dns/py.typed",
+ "/examples/*.txt",
+ "/examples/*.py",
+ "/tests/*.txt",
+ "/tests/*.py",
+ "/tests/*.good",
+ "/tests/example",
+ "/tests/query",
+ "/tests/*.pickle",
+ "/tests/*.text",
+ "/tests/*.generic",
+ "/tests/tls/*.crt",
+ "/tests/tls/*.pem",
+ "/util/**",
+]
-[tool.poetry.dev-dependencies]
-pytest = ">=5.4.1,<8"
-pytest-cov = "^4.0.0"
-flake8 = "^5.0.3"
-sphinx = "^7.0.0"
-coverage = "^7.0"
-twine = "^4.0.0"
-wheel = "^0.41.0"
-pylint = ">=2.7,<4"
-mypy = ">=1.0.1"
-black = "^23.1.0"
+[tool.hatch.build.targets.wheel]
+include = ["dns/*.py", "dns/**/*.py", "dns/py.typed"]
-[tool.poetry.extras]
-doh = ['httpx', 'h2', 'httpcore']
-idna = ['idna']
-dnssec = ['cryptography']
-trio = ['trio']
-wmi = ['wmi']
-doq = ['aioquic']
+[tool.hatch.envs.default]
+features = ["trio", "dnssec", "idna", "doh", "doq", "dev"]
-[build-system]
-requires = ["poetry-core"]
-build-backend = "poetry.core.masonry.api"
-
-[tool.setuptools_scm]
+[tool.hatch.version]
+source = "code"
+path = "dns/version.py"
+expression = "version"
[tool.ruff]
ignore = ['E741', 'F401']
[tool.isort]
profile = "black"
+
+[[tool.mypy.overrides]]
+module = "pythoncom"
+ignore_missing_imports = true
+
+[[tool.mypy.overrides]]
+module = "wmi"
+ignore_missing_imports = true
+++ /dev/null
-# pytest.ini
-[pytest]
-junit_family=xunit1
+++ /dev/null
-[metadata]
-name = dnspython
-version = 2.5.0
-author = Bob Halley
-author_email = halley@dnspython.org
-license = ISC
-license_file = LICENSE
-description = DNS toolkit
-url = https://www.dnspython.org
-project_urls =
- Bug Tracker = https://github.com/rthalley/dnspython/issues
- Documentation = https://dnspython.readthedocs.io/en/stable/
- Source Code = https://github.com/rthalley/dnspython
-long_description = dnspython is a DNS toolkit for Python. It supports almost all
- record types. It can be used for queries, zone transfers, and dynamic
- updates. It supports TSIG authenticated messages and EDNS0.
-
- dnspython provides both high and low level access to DNS. The high
- level classes perform queries for data of a given name, type, and
- class, and return an answer set. The low level classes allow
- direct manipulation of DNS zones, messages, names, and records.
-long_description_content_type = text/plain
-classifiers =
- Development Status :: 5 - Production/Stable
- Intended Audience :: Developers
- Intended Audience :: System Administrators
- License :: OSI Approved :: ISC License (ISCL)
- Operating System :: POSIX
- Operating System :: Microsoft :: Windows
- Programming Language :: Python
- Topic :: Internet :: Name Service (DNS)
- Topic :: Software Development :: Libraries :: Python Modules
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.8
- Programming Language :: Python :: 3.9
- Programming Language :: Python :: 3.10
- Programming Language :: Python :: 3.11
- Programming Language :: Python :: 3.12
-provides = dns
-
-[options]
-packages =
- dns
- dns.dnssecalgs
- dns.quic
- dns.rdtypes
- dns.rdtypes.IN
- dns.rdtypes.ANY
- dns.rdtypes.CH
-python_requires = >=3.8
-test_suite = tests
-setup_requires = setuptools>=44; setuptools_scm[toml]>=3.4.3
-
-[options.extras_require]
-DOH = httpx>=0.21.1; h2>=4.1.0
-IDNA = idna>=2.1
-DNSSEC = cryptography>=2.6
-trio = trio>=0.14.0
-wmi = wmi>=1.5.1
-DOQ = aioquic>=0.9.20
-
-[options.package_data]
-dns = py.typed
+++ /dev/null
-#!/usr/bin/env python3
-#
-# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
-#
-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose with or without fee is hereby granted,
-# provided that the above copyright notice and this permission notice
-# appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-import sys
-
-from setuptools import setup
-
-try:
- sys.argv.remove("--cython-compile")
-except ValueError:
- compile_cython = False
-else:
- compile_cython = True
- from Cython.Build import cythonize
-
- ext_modules = cythonize(
- [
- "dns/*.py",
- "dns/dnssecalgs/*.py",
- "dns/quic/*.py",
- "dns/rdtypes/*.py",
- "dns/rdtypes/*/*.py",
- ],
- language_level="3",
- )
-
-kwargs = {
- "ext_modules": ext_modules if compile_cython else None,
- "zip_safe": False if compile_cython else None,
-}
-
-setup(**kwargs)