From 2333a94b9812f0f6e080370db9fbf417a6474d70 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 24 May 2022 12:13:30 -0400 Subject: [PATCH 01/14] Revert "Merge pull request #954 from ssbarnea/fix/py.typed" This reverts commit 77c7a3005d233d9c7721fccf280439ba081cc8a3, reversing changes made to d715573aa84833fcc360066d31f21f6abdb3cc23. See https://github.com/python-jsonschema/jsonschema/pull/954#issuecomment-1136012833 --- jsonschema/py.typed | 0 setup.cfg | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 jsonschema/py.typed diff --git a/jsonschema/py.typed b/jsonschema/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/setup.cfg b/setup.cfg index 18623eb0b..7571fdfbb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,7 +63,7 @@ console_scripts = jsonschema = jsonschema.cli:main [options.package_data] -jsonschema = py.typed, schemas/*.json, schemas/*/*.json +jsonschema = schemas/*.json, schemas/*/*.json [flake8] ban-relative-imports = true From bc617026cb00becde36610c368c2ab6d9359e21a Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 28 May 2022 11:05:00 -0400 Subject: [PATCH 02/14] Update docs requirements. --- docs/requirements.txt | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 6bc490f28..64da82794 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -8,51 +8,51 @@ alabaster==0.7.12 # via sphinx attrs==21.4.0 # via jsonschema -babel==2.9.1 +babel==2.10.1 # via sphinx -beautifulsoup4==4.10.0 +beautifulsoup4==4.11.1 # via furo -certifi==2021.10.8 +certifi==2022.5.18.1 # via requests -charset-normalizer==2.0.10 +charset-normalizer==2.0.12 # via requests docutils==0.17.1 # via sphinx -furo==2022.1.2 +furo==2022.4.7 # via -r docs/requirements.in idna==3.3 # via requests imagesize==1.3.0 # via sphinx -jinja2==3.0.3 +jinja2==3.1.2 # via sphinx file:.#egg=jsonschema # via -r docs/requirements.in -lxml==4.7.1 +lxml==4.8.0 # via -r docs/requirements.in -markupsafe==2.0.1 +markupsafe==2.1.1 # via jinja2 packaging==21.3 # via sphinx pyenchant==3.2.2 # via sphinxcontrib-spelling -pygments==2.11.2 +pygments==2.12.0 # via # furo # sphinx -pyparsing==3.0.6 +pyparsing==3.0.9 # via packaging -pyrsistent==0.18.0 +pyrsistent==0.18.1 # via jsonschema -pytz==2021.3 +pytz==2022.1 # via babel requests==2.27.1 # via sphinx snowballstemmer==2.2.0 # via sphinx -soupsieve==2.3.1 +soupsieve==2.3.2.post1 # via beautifulsoup4 -sphinx==4.3.2 +sphinx==4.5.0 # via # -r docs/requirements.in # furo @@ -69,10 +69,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sphinxcontrib-spelling==7.3.2 +sphinxcontrib-spelling==7.4.1 # via -r docs/requirements.in -urllib3==1.26.7 +urllib3==1.26.9 # via requests - -# The following packages are considered to be unsafe in a requirements file: -# setuptools From f2fb1df342a27fdbfb0c007f2a141115964b3b86 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 28 May 2022 11:10:50 -0400 Subject: [PATCH 03/14] Update various GHA versions. --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/coverage.yml | 6 +++--- .github/workflows/fuzz.yml | 2 +- .github/workflows/packaging.yml | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1b7ee37e..101c7ec0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,9 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v2.0.3 ci: runs-on: ${{ matrix.os }} @@ -180,9 +180,9 @@ jobs: toxenv: docs-style steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version.name }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version.name }} - name: Ensure we have new enough versions to respect python_version diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7a14bcedb..2ee94c540 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,11 +10,11 @@ jobs: coverage: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: 3.9 + python-version: "3.10" - name: Ensure we have new enough versions to respect python_version run: python -m pip install -U pip setuptools - name: Install tox diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 927c0806d..dcc49a383 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -23,7 +23,7 @@ jobs: oss-fuzz-project-name: 'jsonschema' fuzz-seconds: 30 - name: Upload Crash - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 47723ec87..0b4df2747 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -10,13 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies run: python -m pip install build - name: Create packages @@ -33,7 +33,7 @@ jobs: password: ${{ secrets.pypi_password }} - name: Create Release Notes if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: actions/github-script@v4.0.2 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | From f61f3b7a73c14409178921bf4ce23050bf90560d Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 28 May 2022 10:42:42 -0400 Subject: [PATCH 04/14] Modernize the packaging setup via PEP 621 and Hatch. Doing so jettisons setuptools in favor of a more modern, well-designed, legacy-free, and now well-supported packaging tool, Hatch. No end-user facing behavior changes are expected for any users using a recent packaging setup (within the past 2-3 years), so please report any issues. Hatch: https://hatch.pypa.io/latest/ PEP 621: https://peps.python.org/pep-0621/ --- .flake8 | 10 +++++ docs/validate.rst | 2 +- pyproject.toml | 97 +++++++++++++++++++++++++++++++++++++++++++---- setup.cfg | 91 -------------------------------------------- tox.ini | 2 +- 5 files changed, 101 insertions(+), 101 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..6a6b5cfe7 --- /dev/null +++ b/.flake8 @@ -0,0 +1,10 @@ +[flake8] +ban-relative-imports = true +inline-quotes = " +exclude = + jsonschema/__init__.py + jsonschema/_reflect.py +ignore = + B008, # Barring function calls in default args. Ha, no. + B306, # See https://github.com/PyCQA/flake8-bugbear/issues/131 + W503, # (flake8 default) old PEP8 boolean operator line breaks diff --git a/docs/validate.rst b/docs/validate.rst index cda8f355f..abb52cb97 100644 --- a/docs/validate.rst +++ b/docs/validate.rst @@ -205,7 +205,7 @@ to validate. Their names can be viewed by inspecting the `FormatChecker.checkers` attribute. Certain checkers will only be available if an appropriate package is available for use. The easiest way to ensure you have what is needed is to install ``jsonschema`` using the -``format`` or ``format_nongpl`` setuptools extra -- i.e. +``format`` or ``format_nongpl`` collection of optional dependencies -- e.g. .. code-block:: sh diff --git a/pyproject.toml b/pyproject.toml index 477d5e673..fc1487b4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,97 @@ [build-system] -requires = [ - # The minimum setuptools version is specific to the PEP 517 backend, - # and may be stricter than the version required in `setup.py` - "setuptools>=40.6.0", - "setuptools_scm[toml]>=3.4", - "wheel", +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[tool.hatch.version] +source = "vcs" + +[project] +name = "jsonschema" +description = "An implementation of JSON Schema validation for Python" +readme = "README.rst" +requires-python = ">=3.7" +license = {text = "MIT"} +keywords = ["validation", "data validation", "jsonschema", "json"] +authors = [ + {email = "Julian+jsonschema@GrayVines.com"}, + {name = "Julian Berman"}, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dynamic = ["version"] + +dependencies = [ + "attrs>=17.4.0", + "pyrsistent>=0.14.0,!=0.17.0,!=0.17.1,!=0.17.2", + + "importlib_metadata;python_version<'3.8'", + "typing_extensions;python_version<'3.8'", + "importlib_resources>=1.4.0;python_version<'3.9'", +] + +[project.optional-dependencies] +format = [ + "fqdn", + "idna", + "isoduration", + "jsonpointer>1.13", + "rfc3339-validator", + "rfc3987", + "uri_template", + "webcolors>=1.11", +] +format_nongpl = [ + "fqdn", + "idna", + "isoduration", + "jsonpointer>1.13", + "rfc3339-validator", + "rfc3986-validator>0.1.0", + "uri_template", + "webcolors>=1.11", ] -build-backend = "setuptools.build_meta" + +[project.scripts] +jsonschema = "jsonschema.cli:main" + +[project.urls] +homepage = "github.com/python-jsonschema/jsonschema" +documentation = "python-jsonschema.readthedocs.io/en/latest/" +issues = "github.com/python-jsonschema/jsonschema/issues/" +funding = "github.com/sponsors/Julian" +tidelift = "tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link" +changelog = "github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst" +source = "github.com/python-jsonschema/jsonschema" [tool.isort] from_first = true include_trailing_comma = true multi_line_output = 3 -[tool.setuptools_scm] +[tool.mypy] +ignore_missing_imports = true + +[tool.pydocstyle] +match = "(?!(test_|_|compat|cli)).*\\.py" # see PyCQA/pydocstyle#323 +add-select = [ + "D410", # Trailing whitespace plz +] +add-ignore = [ + "D107", # Hah, no + "D200", # 1-line docstrings don't need to be on one line + "D202", # One line is fine. + "D412", # Trailing whitespace plz + "D413", # No trailing whitespace plz +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7571fdfbb..000000000 --- a/setup.cfg +++ /dev/null @@ -1,91 +0,0 @@ -[metadata] -name = jsonschema -url = https://github.com/python-jsonschema/jsonschema -project_urls = - Funding = https://github.com/sponsors/Julian - Tidelift = https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link - Changelog = https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst - Documentation = https://python-jsonschema.readthedocs.io/en/latest/ - Source = https://github.com/python-jsonschema/jsonschema - Issues = https://github.com/python-jsonschema/jsonschema/issues/ -description = An implementation of JSON Schema validation for Python -long_description = file: README.rst -long_description_content_type = text/x-rst -author = Julian Berman -author_email = Julian@GrayVines.com -license = MIT -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python - 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 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - -[options] -packages = find: -python_requires = >=3.7 -install_requires = - attrs>=17.4.0 - importlib_metadata;python_version<'3.8' - importlib_resources>=1.4.0;python_version<'3.9' - pyrsistent>=0.14.0,!=0.17.0,!=0.17.1,!=0.17.2 - typing_extensions;python_version<'3.8' - -[options.extras_require] -format = - fqdn - idna - isoduration - jsonpointer>1.13 - rfc3339-validator - rfc3987 - uri_template - webcolors>=1.11 -format_nongpl = - fqdn - idna - isoduration - jsonpointer>1.13 - rfc3339-validator - rfc3986-validator>0.1.0 - uri_template - webcolors>=1.11 - -[options.entry_points] -console_scripts = - jsonschema = jsonschema.cli:main - -[options.package_data] -jsonschema = schemas/*.json, schemas/*/*.json - -[flake8] -ban-relative-imports = true -inline-quotes = " -exclude = - jsonschema/__init__.py - jsonschema/_reflect.py -ignore = - B008, # Barring function calls in default args. Ha, no. - B306, # See https://github.com/PyCQA/flake8-bugbear/issues/131 - W503, # (flake8 default) old PEP8 boolean operator line breaks - -[mypy] -ignore_missing_imports = true - -[pydocstyle] -match = (?!(test_|_|compat|cli)).*\.py # see PyCQA/pydocstyle#323 -add-select = - D410, # Trailing whitespace plz -add-ignore = - D107, # Hah, no - D200, # 1-line docstrings don't need to be on one line - D202, # One line is fine. - D412, # Trailing whitespace plz - D413, # No trailing whitespace plz diff --git a/tox.ini b/tox.ini index 93365b71a..bc40266c1 100644 --- a/tox.ini +++ b/tox.ini @@ -97,7 +97,7 @@ deps = pyrsistent types-attrs types-requests -commands = {envpython} -m mypy --config {toxinidir}/setup.cfg {posargs} {toxinidir}/jsonschema +commands = {envpython} -m mypy --config {toxinidir}/pyproject.toml {posargs} {toxinidir}/jsonschema [testenv:docs-dirhtml] commands = {envpython} -m sphinx -b dirhtml {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} From a5af0cd98202789973300252101d5f4b83b2b745 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 28 May 2022 11:08:58 -0400 Subject: [PATCH 05/14] Re-enable Python 3.11 testing in CI. --- .github/workflows/ci.yml | 27 ++++++++++++--------------- .github/workflows/coverage.yml | 2 -- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 101c7ec0b..f9ef1aeaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,19 +84,18 @@ jobs: toxenv: py310-format_nongpl-build - name: "3.10" toxenv: py310-format_nongpl-tests - # Temporarily disabled due to pypa/setuptools#3274 - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-noextra-build - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-noextra-tests - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-format-build - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-format-tests - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-format_nongpl-build - # - name: "3.11.0-alpha - 3.11.0" - # toxenv: py311-format_nongpl-tests + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-noextra-build + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-noextra-tests + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-format-build + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-format-tests + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-format_nongpl-build + - name: "3.11.0-beta - 3.11.0" + toxenv: py311-format_nongpl-tests - name: "3.10" toxenv: docs-dirhtml - name: "3.10" @@ -185,8 +184,6 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version.name }} - - name: Ensure we have new enough versions to respect python_version - run: python -m pip install -U pip setuptools - name: Install dependencies run: > sudo apt-get update && diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2ee94c540..3edc62750 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,8 +15,6 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" - - name: Ensure we have new enough versions to respect python_version - run: python -m pip install -U pip setuptools - name: Install tox run: python -m pip install tox - name: Collect & Upload Coverage From 9b22313143a7de18a08f7852dede1aa86929a6da Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 28 May 2022 12:52:26 -0400 Subject: [PATCH 06/14] Let RTD be authoritative about what the default doc version is. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc1487b4b..fb7224b51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ jsonschema = "jsonschema.cli:main" [project.urls] homepage = "github.com/python-jsonschema/jsonschema" -documentation = "python-jsonschema.readthedocs.io/en/latest/" +documentation = "python-jsonschema.readthedocs.io/" issues = "github.com/python-jsonschema/jsonschema/issues/" funding = "github.com/sponsors/Julian" tidelift = "tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link" From 679e82bb555ad65f555a50276e1c5cbd9bc65eb4 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Mon, 30 May 2022 15:09:45 -0400 Subject: [PATCH 07/14] Combine the CI and packaging workflows. And only run the latter after the former. --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++++++ .github/workflows/packaging.yml | 43 --------------------------------- 2 files changed, 36 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/packaging.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9ef1aeaa..ad885a437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,3 +196,39 @@ jobs: run: python -m pip install tox - name: Run tox run: python -m tox -e "${{ matrix.python-version.toxenv }}" + + packaging: + needs: ci + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: python -m pip install build + - name: Create packages + run: python -m build . + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + - name: Publish package + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + - name: Create Release Notes + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.request(`POST /repos/${{ github.repository }}/releases`, { + tag_name: "${{ github.ref }}", + generate_release_notes: true + }); diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml deleted file mode 100644 index 0b4df2747..000000000 --- a/.github/workflows/packaging.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Packaging - -on: - push: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: python -m pip install build - - name: Create packages - run: python -m build . - - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist - - name: Publish package - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - name: Create Release Notes - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - await github.request(`POST /repos/${{ github.repository }}/releases`, { - tag_name: "${{ github.ref }}", - generate_release_notes: true - }); From 499a6dac061f339911c3f789c0700f5c368a4a78 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Mon, 30 May 2022 15:11:19 -0400 Subject: [PATCH 08/14] Make project.urls be valid URLs. Refs: python/peps#2621. --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fb7224b51..115e20154 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,13 +67,13 @@ format_nongpl = [ jsonschema = "jsonschema.cli:main" [project.urls] -homepage = "github.com/python-jsonschema/jsonschema" -documentation = "python-jsonschema.readthedocs.io/" -issues = "github.com/python-jsonschema/jsonschema/issues/" -funding = "github.com/sponsors/Julian" -tidelift = "tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link" -changelog = "github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst" -source = "github.com/python-jsonschema/jsonschema" +homepage = "https://github.com/python-jsonschema/jsonschema" +documentation = "https://python-jsonschema.readthedocs.io/" +issues = "https://github.com/python-jsonschema/jsonschema/issues/" +funding = "https://github.com/sponsors/Julian" +tidelift = "https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link" +changelog = "https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst" +source = "https://github.com/python-jsonschema/jsonschema" [tool.isort] from_first = true From 69d3787b5448821c691b5ac8c0e959f77f957fb9 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Mon, 30 May 2022 15:26:58 -0400 Subject: [PATCH 09/14] Add basic CONTRIBUTING guidelines. Some additional detail would be helpful, such as that this project (now) uses hatch, which is why it's on this branch, but this is a start. --- CONTRIBUTING.rst | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 5 ++-- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.rst diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 000000000..c051d5697 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,60 @@ +============================ +Contributing to `jsonschema` +============================ + +Found a bug? +------------ + +If you suspect you may have found a security-related vulnerability, please follow the instructions in `the security policy `_. + +Otherwise, it is extremely helpful if you first search to see whether your bug has been `previously reported on the Issues tab `_. + +If it doesn't appear to be a known issue, please `file a new one `_, and include a **title and clear description**, along with as much relevant information as possible. +Including a *minimal*, *self-sufficient* bit of code (often an instance and schema) is the fastest way to get attention, along with a description of the behavior you expect, and if you're able, a link to where in the specification contains the behavior you're noticing is incorrect. + +Pull requests to fix your issue are of course very welcome. + + +Fixing a Bug? +------------- + +Please open a new GitHub pull request with the change, along with new tests. + +Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. + +Continuous integration via GitHub actions should run to indicate whether your change passes both the test suite as well as linters. +Please ensure it passes, or indicate in a comment if you believe it fails spuriously. + + +Adding New Functionality? +------------------------- + +Please discuss any larger changes ahead of time for the sake of your own time! + +Improvements are very welcome, but large pull requests, disruptive ones, or backwards incompatible ones, can lead to long back and forth discussions. + +You're welcome to suggest a change in an issue and thereby get some initial feedback before embarking on an effort that may not get merged. + + +Improving the Documentation? +---------------------------- + +Writing good documentation is challenging both to prioritize and to do well. + +Any help you may have would be great, especially if you're a beginner who's struggled to understand a part of the library. + +Documentation is written in `Sphinx-flavored reStructuredText `_, so you'll want to familiarize yourself a bit with Sphinx. + +Feel free to file issues or pull requests. + + +Have a Question? +---------------- + +Please do not use the issue tracker for questions, it's reserved for things believed to be bugs, or new functionality. + +There is a `discussions tab `_ where general questions can be asked. + +Answers on it are best-effort. + +Any help you can offer to answer others' questions is of course very welcome as well. diff --git a/README.rst b/README.rst index 8b43ad9c8..0003c5020 100644 --- a/README.rst +++ b/README.rst @@ -125,8 +125,9 @@ schemas can be found there. Otherwise, asking questions on Stack Overflow is another means of getting help if you're stuck. -Contributing ------------- + +About +----- I'm Julian Berman. From b890d2f16c9df863057c88f91d739e8cca3e0315 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 31 May 2022 12:43:18 -0400 Subject: [PATCH 10/14] Ignore a deprecation warning coming from pkg_resources on 3.11 See pypa/setuptools#3276. --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index bc40266c1..b9c12d616 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,8 @@ commands = format,perf: {envpython} -m pip install '{toxinidir}[format]' format_nongpl: {envpython} -m pip install '{toxinidir}[format_nongpl]' - tests,coverage,codecov: {envpython} -W 'error' -m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema} + # Ignore the deprecation warning until pypa/setuptools#3276 is released + tests,coverage,codecov: {envpython} -Werror -W"ignore:module 'sre_constants' is deprecated:DeprecationWarning" -m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema} tests: {envpython} -m doctest {toxinidir}/README.rst coverage: {envpython} -m coverage report --show-missing From 6a68aa2444f031ded3e1cb1e9a73e6d36d61e76e Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 31 May 2022 12:43:50 -0400 Subject: [PATCH 11/14] Ignore the badge URLs, they seem super unreliable from CI. --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index c07be7870..2d080d4f0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -239,6 +239,7 @@ def entire_domain(host): linkcheck_ignore = [ + entire_domain("img.shields.io"), "https://github.com/python-jsonschema/jsonschema/actions", "https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg", ] From 6ca4004b7c1dcddadbe6e02dff2c793a366666dc Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 1 Jun 2022 16:26:26 -0400 Subject: [PATCH 12/14] v4.6.0 -> CHANGELOG --- CHANGELOG.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d05032d08..18bd54fee 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +v4.6.0 +------ + +* Fix ``unevaluatedProperties`` and ``unevaluatedItems`` for types they should + ignore (#949) +* ``jsonschema`` now uses `hatch `_ for its build + process. This should be completely transparent to end-users (and only matters + to contributors). + v4.5.1 ------ From b621484e84314e18052af306e225066cc430d0f3 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 1 Jun 2022 16:27:38 -0400 Subject: [PATCH 13/14] Remove the now-unused MANIFEST.in. --- MANIFEST.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 2eef0b793..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -graft json -include *.rst -include COPYING -include pyproject.toml -include tox.ini From fd3a457c7359f13f50de8d5e3fbc73998c3ea2dc Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 1 Jun 2022 16:47:22 -0400 Subject: [PATCH 14/14] Slightly speed up pip installs by skipping the version check in CI. Also remove some old version upgrading cruft. --- tox.ini | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tox.ini b/tox.ini index b9c12d616..eb2201342 100644 --- a/tox.ini +++ b/tox.ini @@ -22,11 +22,9 @@ setenv = whitelist_externals = mkdir commands = - {envpython} -m pip install 'pip>=21.1.1' # Evade CVE-2021-28363 - - noextra: {envpython} -m pip install {toxinidir} - format,perf: {envpython} -m pip install '{toxinidir}[format]' - format_nongpl: {envpython} -m pip install '{toxinidir}[format_nongpl]' + noextra: {envpython} -m pip install --disable-pip-version-check {toxinidir} + format,perf: {envpython} -m pip install --disable-pip-version-check '{toxinidir}[format]' + format_nongpl: {envpython} -m pip install --disable-pip-version-check '{toxinidir}[format_nongpl]' # Ignore the deprecation warning until pypa/setuptools#3276 is released tests,coverage,codecov: {envpython} -Werror -W"ignore:module 'sre_constants' is deprecated:DeprecationWarning" -m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema} @@ -69,11 +67,7 @@ commands = [testenv:safety] deps = safety commands = - {envpython} -m pip install 'pip>=21.1.1' # Evade CVE-2021-28363 - - # Remove once pypa/pip#7555 is closed. - {envpython} -m pip install --use-feature=in-tree-build '{toxinidir}[format]' - + {envpython} -m pip install --disable-pip-version-check '{toxinidir}[format]' {envpython} -m safety check [testenv:secrets]