diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b61b784..dab4e3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,10 +41,10 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install test dependencies run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt -r requirements_dev.txt + python -mpip install --upgrade pip + python -mpip install -r requirements_dev.txt - name: tests run: | python setup.py develop diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6c05a61..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyyaml==5.1 diff --git a/requirements_dev.txt b/requirements_dev.txt index eb111cc..a2f8067 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1 +1,2 @@ +pyyaml~=5.4.0 tox==3.9.0 diff --git a/setup.py b/setup.py index a629625..f8018eb 100644 --- a/setup.py +++ b/setup.py @@ -194,7 +194,7 @@ class sdist(_sdist): zip_safe=False, url="https://github.com/ua-parser/uap-python", include_package_data=True, - setup_requires=["pyyaml"], + setup_requires=["pyyaml ~= 5.4.0"], install_requires=[], cmdclass=cmdclass, classifiers=[ diff --git a/ua_parser/user_agent_parser.py b/ua_parser/user_agent_parser.py index 6f9c7d4..7e2bebc 100644 --- a/ua_parser/user_agent_parser.py +++ b/ua_parser/user_agent_parser.py @@ -472,7 +472,8 @@ def GetFilters( import yaml try: - # Try and use libyaml bindings if available since faster + # Try and use libyaml bindings if available since faster, + # pyyaml doesn't do it by default (yaml/pyyaml#436) from yaml import CSafeLoader as SafeLoader except ImportError: from yaml import SafeLoader