Skip to content

Commit ded065d

Browse files
committed
Merge branch 'main' into bool-format-checks
* main: Slightly speed up pip installs by skipping the version check in CI. Remove the now-unused MANIFEST.in. v4.6.0 -> CHANGELOG Ignore the badge URLs, they seem super unreliable from CI. Ignore a deprecation warning coming from pkg_resources on 3.11 Add basic CONTRIBUTING guidelines. Make project.urls be valid URLs. Combine the CI and packaging workflows. Let RTD be authoritative about what the default doc version is. Re-enable Python 3.11 testing in CI. Modernize the packaging setup via PEP 621 and Hatch. Update various GHA versions. Update docs requirements. Revert "Merge pull request #954 from ssbarnea/fix/py.typed"
2 parents af47da8 + fd3a457 commit ded065d

File tree

15 files changed

+237
-188
lines changed

15 files changed

+237
-188
lines changed

.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
ban-relative-imports = true
3+
inline-quotes = "
4+
exclude =
5+
jsonschema/__init__.py
6+
jsonschema/_reflect.py
7+
ignore =
8+
B008, # Barring function calls in default args. Ha, no.
9+
B306, # See https://github.com/PyCQA/flake8-bugbear/issues/131
10+
W503, # (flake8 default) old PEP8 boolean operator line breaks

.github/workflows/ci.yml

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
pre-commit:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18-
- uses: pre-commit/[email protected].0
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v3
18+
- uses: pre-commit/[email protected].3
1919

2020
ci:
2121
runs-on: ${{ matrix.os }}
@@ -84,19 +84,18 @@ jobs:
8484
toxenv: py310-format_nongpl-build
8585
- name: "3.10"
8686
toxenv: py310-format_nongpl-tests
87-
# Temporarily disabled due to pypa/setuptools#3274
88-
# - name: "3.11.0-alpha - 3.11.0"
89-
# toxenv: py311-noextra-build
90-
# - name: "3.11.0-alpha - 3.11.0"
91-
# toxenv: py311-noextra-tests
92-
# - name: "3.11.0-alpha - 3.11.0"
93-
# toxenv: py311-format-build
94-
# - name: "3.11.0-alpha - 3.11.0"
95-
# toxenv: py311-format-tests
96-
# - name: "3.11.0-alpha - 3.11.0"
97-
# toxenv: py311-format_nongpl-build
98-
# - name: "3.11.0-alpha - 3.11.0"
99-
# toxenv: py311-format_nongpl-tests
87+
- name: "3.11.0-beta - 3.11.0"
88+
toxenv: py311-noextra-build
89+
- name: "3.11.0-beta - 3.11.0"
90+
toxenv: py311-noextra-tests
91+
- name: "3.11.0-beta - 3.11.0"
92+
toxenv: py311-format-build
93+
- name: "3.11.0-beta - 3.11.0"
94+
toxenv: py311-format-tests
95+
- name: "3.11.0-beta - 3.11.0"
96+
toxenv: py311-format_nongpl-build
97+
- name: "3.11.0-beta - 3.11.0"
98+
toxenv: py311-format_nongpl-tests
10099
- name: "3.10"
101100
toxenv: docs-dirhtml
102101
- name: "3.10"
@@ -180,13 +179,11 @@ jobs:
180179
toxenv: docs-style
181180

182181
steps:
183-
- uses: actions/checkout@v2
182+
- uses: actions/checkout@v3
184183
- name: Set up Python ${{ matrix.python-version.name }}
185-
uses: actions/setup-python@v2
184+
uses: actions/setup-python@v3
186185
with:
187186
python-version: ${{ matrix.python-version.name }}
188-
- name: Ensure we have new enough versions to respect python_version
189-
run: python -m pip install -U pip setuptools
190187
- name: Install dependencies
191188
run: >
192189
sudo apt-get update &&
@@ -199,3 +196,39 @@ jobs:
199196
run: python -m pip install tox
200197
- name: Run tox
201198
run: python -m tox -e "${{ matrix.python-version.toxenv }}"
199+
200+
packaging:
201+
needs: ci
202+
runs-on: ubuntu-latest
203+
204+
steps:
205+
- uses: actions/checkout@v3
206+
with:
207+
fetch-depth: 0
208+
- uses: actions/setup-python@v3
209+
with:
210+
python-version: "3.10"
211+
- name: Install dependencies
212+
run: python -m pip install build
213+
- name: Create packages
214+
run: python -m build .
215+
- uses: actions/upload-artifact@v3
216+
with:
217+
name: dist
218+
path: dist
219+
- name: Publish package
220+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
221+
uses: pypa/gh-action-pypi-publish@master
222+
with:
223+
user: __token__
224+
password: ${{ secrets.pypi_password }}
225+
- name: Create Release Notes
226+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
227+
uses: actions/github-script@v6
228+
with:
229+
github-token: ${{ secrets.GITHUB_TOKEN }}
230+
script: |
231+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
232+
tag_name: "${{ github.ref }}",
233+
generate_release_notes: true
234+
});

.github/workflows/coverage.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ jobs:
1010
coverage:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: Set up Python
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v3
1616
with:
17-
python-version: 3.9
18-
- name: Ensure we have new enough versions to respect python_version
19-
run: python -m pip install -U pip setuptools
17+
python-version: "3.10"
2018
- name: Install tox
2119
run: python -m pip install tox
2220
- name: Collect & Upload Coverage

.github/workflows/fuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
oss-fuzz-project-name: 'jsonschema'
2424
fuzz-seconds: 30
2525
- name: Upload Crash
26-
uses: actions/upload-artifact@v2
26+
uses: actions/upload-artifact@v3
2727
if: failure() && steps.build.outcome == 'success'
2828
with:
2929
name: artifacts

.github/workflows/packaging.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
v4.6.0
2+
------
3+
4+
* Fix ``unevaluatedProperties`` and ``unevaluatedItems`` for types they should
5+
ignore (#949)
6+
* ``jsonschema`` now uses `hatch <https://hatch.pypa.io/>`_ for its build
7+
process. This should be completely transparent to end-users (and only matters
8+
to contributors).
9+
110
v4.5.1
211
------
312

CONTRIBUTING.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
============================
2+
Contributing to `jsonschema`
3+
============================
4+
5+
Found a bug?
6+
------------
7+
8+
If you suspect you may have found a security-related vulnerability, please follow the instructions in `the security policy <https://github.com/python-jsonschema/jsonschema/blob/main/.github/SECURITY.md>`_.
9+
10+
Otherwise, it is extremely helpful if you first search to see whether your bug has been `previously reported on the Issues tab <https://github.com/python-jsonschema/jsonschema/issues?q=is%3Aissue+is%3Aopen+label%3ABug>`_.
11+
12+
If it doesn't appear to be a known issue, please `file a new one <https://github.com/python-jsonschema/jsonschema/issues/new>`_, and include a **title and clear description**, along with as much relevant information as possible.
13+
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.
14+
15+
Pull requests to fix your issue are of course very welcome.
16+
17+
18+
Fixing a Bug?
19+
-------------
20+
21+
Please open a new GitHub pull request with the change, along with new tests.
22+
23+
Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
24+
25+
Continuous integration via GitHub actions should run to indicate whether your change passes both the test suite as well as linters.
26+
Please ensure it passes, or indicate in a comment if you believe it fails spuriously.
27+
28+
29+
Adding New Functionality?
30+
-------------------------
31+
32+
Please discuss any larger changes ahead of time for the sake of your own time!
33+
34+
Improvements are very welcome, but large pull requests, disruptive ones, or backwards incompatible ones, can lead to long back and forth discussions.
35+
36+
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.
37+
38+
39+
Improving the Documentation?
40+
----------------------------
41+
42+
Writing good documentation is challenging both to prioritize and to do well.
43+
44+
Any help you may have would be great, especially if you're a beginner who's struggled to understand a part of the library.
45+
46+
Documentation is written in `Sphinx-flavored reStructuredText <https://www.sphinx-doc.org>`_, so you'll want to familiarize yourself a bit with Sphinx.
47+
48+
Feel free to file issues or pull requests.
49+
50+
51+
Have a Question?
52+
----------------
53+
54+
Please do not use the issue tracker for questions, it's reserved for things believed to be bugs, or new functionality.
55+
56+
There is a `discussions tab <https://github.com/python-jsonschema/jsonschema/discussions>`_ where general questions can be asked.
57+
58+
Answers on it are best-effort.
59+
60+
Any help you can offer to answer others' questions is of course very welcome as well.

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ schemas can be found there.
125125
Otherwise, asking questions on Stack Overflow is another means of
126126
getting help if you're stuck.
127127

128-
Contributing
129-
------------
128+
129+
About
130+
-----
130131

131132
I'm Julian Berman.
132133

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def entire_domain(host):
240240

241241

242242
linkcheck_ignore = [
243+
entire_domain("img.shields.io"),
243244
"https://github.com/python-jsonschema/jsonschema/actions",
244245
"https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg",
245246
]

0 commit comments

Comments
 (0)