Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e27d50d

Browse files
authored
Add comment clarifying use of yaml.load, remove requirements file
pyyaml hasn't been a required dependency for a very long time, it's really not clear why ua-parser#70 reintroduced a requirements.txt for it, unless there were points at which `install_requires` was not resolved as a *dependency*, so pyyaml had to be separately installed for `develop` to work? See also: ua-parser#103 Closes ua-parser#106
1 parent fa5478c commit e27d50d

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
uses: actions/setup-python@v3
4242
with:
4343
python-version: ${{ matrix.python-version }}
44-
- name: Install dependencies
44+
- name: Install test dependencies
4545
run: |
46-
python -m pip install --upgrade pip
47-
python -m pip install -r requirements.txt -r requirements_dev.txt
46+
python -mpip install --upgrade pip
47+
python -mpip install -r requirements_dev.txt
4848
- name: tests
4949
run: |
5050
python setup.py develop

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
pyyaml~=5.4.0
12
tox==3.9.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class sdist(_sdist):
194194
zip_safe=False,
195195
url="https://github.com/ua-parser/uap-python",
196196
include_package_data=True,
197-
setup_requires=["pyyaml"],
197+
setup_requires=["pyyaml ~= 5.4.0"],
198198
install_requires=[],
199199
cmdclass=cmdclass,
200200
classifiers=[

ua_parser/user_agent_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ def GetFilters(
472472
import yaml
473473

474474
try:
475-
# Try and use libyaml bindings if available since faster
475+
# Try and use libyaml bindings if available since faster,
476+
# pyyaml doesn't do it by default (yaml/pyyaml#436)
476477
from yaml import CSafeLoader as SafeLoader
477478
except ImportError:
478479
from yaml import SafeLoader

0 commit comments

Comments
 (0)