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

Skip to content

Commit 911624c

Browse files
committed
Relax pyyaml versioning during building
e27d50d moved the yaml dependency from runtime to dev and updated the version from 5.1 to 5.4 (not 6.0 as that dropped Python 2.7 compatibility), but that turns out to cause issues for people who can't / won't download pyyaml on the fly and require building to work with preinstalled packages, as building regexes now refuses to work with a locally available 6.0. Remove version bound on pyyaml (though a `>=` bound might also have worked), but add a bunch of tests to ensure the regexes build on all supported versions of Python, and pyyaml (also reinstate 5.1 for that purpose only). Fixes #121
1 parent 7250d81 commit 911624c

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,37 @@ jobs:
2727
- name: black
2828
run: black --check --diff --color --quiet .
2929

30+
compile:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-alpha - 3.11", "pypy-3.8"]
36+
pyyaml-version: ["5.1.*", "5.4.*", "6.0.*", "6.*"]
37+
exclude:
38+
- python-version: 2.7
39+
pyyaml-version: 6.0.*
40+
- python-version: 2.7
41+
pyyaml-version: 6.*
42+
43+
steps:
44+
- name: Checkout working copy
45+
uses: actions/checkout@v3
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v3
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
- name: Install dependency
51+
run: |
52+
python -mpip install --upgrade pip
53+
python -mpip install pyyaml==${{ matrix.pyyaml-version }}
54+
- name: Build regexes.py
55+
run: python setup.py build_regexes -i
56+
- name: Check results
57+
run: |
58+
# check that _regexes exists, and .eggs does not (== setuptools used our dependency)
59+
test -e ua_parser/_regexes.py -a ! -e .eggs
60+
3061
test:
3162
runs-on: ubuntu-latest
3263
strategy:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class sdist(_sdist):
210210
zip_safe=False,
211211
url="https://github.com/ua-parser/uap-python",
212212
include_package_data=True,
213-
setup_requires=["pyyaml ~= 5.4.0"],
213+
setup_requires=["pyyaml"],
214214
install_requires=[],
215215
cmdclass=cmdclass,
216216
classifiers=[

0 commit comments

Comments
 (0)