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

try to fix build #175

Merged
merged 6 commits into from
Mar 14, 2023
Merged
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
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
25 changes: 2 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
#
# Please bump to the latest unreleased candidate
# when you come across this and have a moment to spare!
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@master
- name: set up Python ${{ matrix.python-version }}
Expand All @@ -22,29 +22,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U tox tox-gh-actions coveralls
pip install -U tox tox-gh-actions
pip install -r requirements-tox.txt -r requirements-test.txt
- name: Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
- name: Run tox
run: |
tox -e py
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip install --upgrade coveralls
coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
push:
paths:
- '*.py'

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.11.2
architecture: x64
- name: Checkout
uses: actions/checkout@v1
- name: Install mypy
run: pip install mypy
- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1
with:
checkName: 'mypy' # NOTE: this needs to be the same as the job name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 0 additions & 10 deletions .pre-commit-config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## marshmallow-jsonschema: JSON Schema formatting with marshmallow

![Build Status](https://github.com/fuhrysteve/marshmallow-jsonschema/workflows/build/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/fuhrysteve/marshmallow-jsonschema/badge.svg?branch=master)](https://coveralls.io/github/fuhrysteve/marshmallow-jsonschema?branch=master)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)

marshmallow-jsonschema translates marshmallow schemas into
Expand Down
1 change: 1 addition & 0 deletions marshmallow_jsonschema/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def _resolve_additional_properties(cls) -> bool:
elif unknown == INCLUDE:
return True
else:
# This is probably unreachable as of marshmallow 3.16.0
raise UnsupportedValueError("Unknown value %s for `unknown`" % unknown)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tool.black]
target-version = ['py36', 'py37', 'py38']
target-version = ['py39', 'py310']
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pytest-cov
# Optional installs for the wheel, but always required for tests
marshmallow-enum
marshmallow-union
mypy>=0.910
mypy>=1.1.1

pre-commit~=2.15
14 changes: 0 additions & 14 deletions tests/test_additional_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,3 @@ class Meta:
dumped["definitions"]["TestSchema"]["additionalProperties"]
== additional_properties
)


def test_additional_properties_unknown_invalid_value():
class TestSchema(Schema):
class Meta:
unknown = "foo"

foo = fields.Integer()

schema = TestSchema()
json_schema = JSONSchema()

with pytest.raises(UnsupportedValueError):
json_schema.dump(schema)
10 changes: 2 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[tox]
envlist=lint,py{36,37,38,39,py3}
envlist=py{37,38,39,310,311,py3}

[testenv]
deps=-r requirements-test.txt
whitelist_externals=make
allowlist_externals=make
commands=make test_coverage


[testenv:lint]
deps = pre-commit~=1.17
skip_install = true
commands = pre-commit run --all-files --show-diff-on-failure