Skip to content

Commit

Permalink
build: unpin PyYAML to support Python 3.10 (#238)
Browse files Browse the repository at this point in the history
* build: unpin PyYAML

* test support on python 3.9 and 3.10

* Fix tests
  • Loading branch information
jirikuncar committed Jan 17, 2022
1 parent 1f4267a commit 9fb30c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .azure-pipelines/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
vmImage: "Ubuntu-20.04"
strategy:
matrix:
Py38:
PYTHON_VERSION: "3.8"
TOXENV: "py38"
Py39:
PYTHON_VERSION: "3.9"
Py310:
PYTHON_VERSION: "3.10"
steps:
- task: UsePythonVersion@0
displayName: Use python $(PYTHON_VERSION)
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ classifiers=
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
project_urls =
Bug Tracker = https://github.com/DataDog/apigentools/issues
Documentation = https://apigentools.readthedocs.io/en/latest/
Expand All @@ -38,7 +39,7 @@ install_requires =
chevron==0.13.1
click==7.1.2
jsonpath-ng==1.5.1
PyYAML==5.4.1
PyYAML>=5.4.1,<7.0.0
packaging==20.3
pydantic==1.7
setup_requires =
Expand All @@ -53,7 +54,7 @@ console_scripts =
[options.extras_require]
tests =
black>=20.8b1
flexmock>=0.10.4
flexmock>=0.10.4,<0.11
pytest>=5.2.4
pytest-cov
pytest-black
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import flexmock
import pytest
import yaml
from yaml import CSafeLoader

from apigentools.constants import REDACTED_OUT_SECRET
from apigentools.errors import SpecSectionNotFoundError
Expand Down Expand Up @@ -294,7 +295,7 @@ def test_write_full_spec(tmpdir):
)

with open(written, "r") as f:
assert yaml.load(f) == expected
assert yaml.load(f, Loader=CSafeLoader) == expected


def test_write_full_spec_section_not_found(tmpdir):
Expand Down

0 comments on commit 9fb30c3

Please sign in to comment.