diff --git a/.coveragerc b/.coveragerc index 0287948..35b98b1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -7,3 +7,7 @@ disable_warnings = [report] show_missing = True +exclude_also = + # jaraco/skeleton#97 + @overload + if TYPE_CHECKING: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf94f7d..ac0ff69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,11 @@ on: merge_group: push: branches-ignore: - # disabled for jaraco/skeleton#103 - # - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + # temporary GH branches relating to merge queues (jaraco/skeleton#93) + - gh-readonly-queue/** + tags: + # required if branches-ignore is supplied (jaraco/skeleton#103) + - '**' pull_request: permissions: @@ -28,10 +31,10 @@ env: jobs: test: strategy: + # https://blog.jaraco.com/efficient-use-of-ci-resources/ matrix: python: - "3.8" - - "3.11" - "3.12" platform: - ubuntu-latest @@ -42,6 +45,8 @@ jobs: platform: ubuntu-latest - python: "3.10" platform: ubuntu-latest + - python: "3.11" + platform: ubuntu-latest - python: pypy3.10 platform: ubuntu-latest runs-on: ${{ matrix.platform }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 053c728..dc8516a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,10 +3,14 @@ python: install: - path: . extra_requirements: - - docs + - doc # required boilerplate readthedocs/readthedocs.org#10401 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: "3" + python: latest + # post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114 + jobs: + post_checkout: + - git fetch --unshallow || true diff --git a/README.rst b/README.rst index 72e2096..5f54fd2 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ .. image:: https://readthedocs.org/projects/portend/badge/?version=latest :target: https://portend.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2023-informational +.. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton .. image:: https://tidelift.com/badges/package/pypi/portend diff --git a/pyproject.toml b/pyproject.toml index a853c57..375d1a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,54 @@ [build-system] -requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" +[project] +name = "portend" +authors = [ + { name = "Jason R. Coombs", email = "jaraco@jaraco.com" }, +] +description = "TCP port monitoring and discovery" +readme = "README.rst" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", +] +requires-python = ">=3.8" +dependencies = [ + "tempora>=1.8", +] +dynamic = ["version"] + +[project.urls] +Source = "https://github.com/jaraco/portend" + +[project.optional-dependencies] +test = [ + # upstream + "pytest >= 6, != 8.1.*", + "pytest-checkdocs >= 2.4", + "pytest-cov", + "pytest-mypy", + "pytest-enabler >= 2.2", + "pytest-ruff >= 0.2.1", + + # local +] +doc = [ + # upstream + "sphinx >= 3.5", + "jaraco.packaging >= 9.3", + "rst.linker >= 1.9", + "furo", + "sphinx-lint", + + # local +] + +[tool.setuptools] +py-modules = ["portend"] + [tool.setuptools_scm] diff --git a/pytest.ini b/pytest.ini index 67fe935..74aa5e1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,9 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules +addopts= + --doctest-modules + --import-mode importlib +consider_namespace_packages=true doctest_optionflags= IGNORE_EXCEPTION_DETAIL filterwarnings= diff --git a/ruff.toml b/ruff.toml index 795cca1..7061298 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,8 @@ [lint] +extend-select = [ + "C901", + "W", +] ignore = [ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", @@ -18,5 +22,7 @@ ignore = [ ] [format] +# Enable preview, required for quote-style = "preserve" +preview = true # https://docs.astral.sh/ruff/settings/#format-quote-style quote-style = "preserve" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f57ffaa..0000000 --- a/setup.cfg +++ /dev/null @@ -1,56 +0,0 @@ -[metadata] -name = portend -author = Jason R. Coombs -author_email = jaraco@jaraco.com -description = TCP port monitoring and discovery -long_description = file:README.rst -url = https://github.com/jaraco/portend -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - -[options] -packages = find_namespace: -py_modules = portend -include_package_data = true -python_requires = >=3.8 -install_requires = - tempora>=1.8 - -[options.packages.find] -exclude = - build* - dist* - docs* - tests* - -[options.extras_require] -testing = - # upstream - pytest >= 6 - pytest-checkdocs >= 2.4 - pytest-cov - pytest-mypy; \ - # workaround for jaraco/skeleton#22 - python_implementation != "PyPy" - pytest-enabler >= 2.2 - pytest-ruff >= 0.2.1 - - # local - -docs = - # upstream - sphinx >= 3.5 - # workaround for sphinx/sphinx-doc#11662 - sphinx < 7.2.5 - jaraco.packaging >= 9.3 - rst.linker >= 1.9 - furo - sphinx-lint - - # local - -[options.entry_points] diff --git a/tox.ini b/tox.ini index 331eeed..cc4db36 100644 --- a/tox.ini +++ b/tox.ini @@ -7,11 +7,12 @@ commands = pytest {posargs} usedevelop = True extras = - testing + test [testenv:diffcov] description = run tests and check that diff from main is covered deps = + {[testenv]deps} diff-cover commands = pytest {posargs} --cov-report xml @@ -21,8 +22,8 @@ commands = [testenv:docs] description = build the documentation extras = - docs - testing + doc + test changedir = docs commands = python -m sphinx -W --keep-going . {toxinidir}/build/html