Open kloczek opened 2 years ago
Here is pytest output:
And list of modules installed in build env
Package Version
----------------------------- -----------------
alabaster 0.7.12
appdirs 1.4.4
attrs 21.4.0
Babel 2.10.1
beautifulsoup4 4.10.0
boto3 1.23.1
botocore 1.26.1
Brlapi 0.8.3
build 0.7.0
cffi 1.15.0
charset-normalizer 2.0.12
codespell 2.1.0
cryptography 36.0.2
cycler 0.11.0
Cython 0.29.25
distro 1.7.0
docutils 0.17.1
domdf-python-tools 3.2.2.post1
extras 1.0.0
filelock 3.7.0
fixtures 4.0.0
fonttools 4.33.3
gpg 1.17.1-unknown
idna 3.3
imagesize 1.3.0
importlib-metadata 4.11.3
iniconfig 1.1.1
Jinja2 3.1.1
jmespath 1.0.0
kiwisolver 1.3.2
libcomps 0.1.18
louis 3.21.0
lxml 4.8.0
MarkupSafe 2.1.1
matplotlib 3.5.1
multidict 5.2.0
natsort 8.0.2
numpy 1.22.3
olefile 0.46
packaging 21.3
pbr 5.8.1
pep517 0.12.0
Pillow 9.1.1
pip 22.1
pluggy 1.0.0
ply 3.11
poetry-core 1.0.8
py 1.11.0
pycparser 2.21
Pygments 2.12.0
PyGObject 3.42.1
pyparsing 3.0.9
pytest 7.1.2
pytest-vcr 1.0.2
python-dateutil 2.8.2
pytz 2022.1
PyYAML 6.0
requests 2.27.1
requests-file 1.5.1
rpm 4.17.0
s3transfer 0.5.2
scour 0.38.2
setuptools 62.2.0
six 1.16.0
snowballstemmer 2.2.0
soupsieve 2.3.2.post1
Sphinx 4.5.0
sphinxcontrib-applehelp 1.0.2.dev20220410
sphinxcontrib-devhelp 1.0.2.dev20220410
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1.dev20220410
sphinxcontrib-qthelp 1.0.3.dev20220410
sphinxcontrib-serializinghtml 1.1.5
testtools 2.5.0
tldextract 3.3.0
toml 0.10.2
tomli 2.0.1
typing_extensions 4.1.1
urllib3 1.26.9
vcrpy 4.1.1
wheel 0.37.1
wrapt 1.14.0
yarl 1.7.2
zipp 3.8.0
The tests failing are related to providers that have optional dependencies. I think you have not installed them beforehand.
Either you plan to support them, and you should install lexicon with the dependencies to these python modules (they are described in the pyproject.toml
section), or you plan to not support them, and you should run pytest with the custom flag --xfail-providers-with-missing-deps
that will make pytest expect that these tests are failing.
OK. Will try to package that 😋 Nevertheless if test suite is failing because missing optional dependency still looks like something can be fixed 😝
BTW .. looking on https://github.com/joblib/joblib/compare/1.1.0...master I think that it woild be good to make new release.
And about optional pytest dependencies. I have some difficulties with finding what more I can add in build env for that package. May I ask for some hints ..?
The tests failing are related to providers that have optional dependencies. I think you have not installed them beforehand.
Either you plan to support them, and you should install lexicon with the dependencies to these python modules (they are described in the
pyproject.toml
section), or you plan to not support them, and you should run pytest with the custom flag--xfail-providers-with-missing-deps
that will make pytest expect that these tests are failing.
I have difficulty with locating list of those dependencies. And about that option
+ /usr/bin/pytest -ra --xfail-providers-with-missing-deps
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --xfail-providers-with-missing-deps
inifile: /home/tkloczko/rpmbuild/BUILD/lexicon-3.11.3/pyproject.toml
rootdir: /home/tkloczko/rpmbuild/BUILD/lexicon-3.11.3
Hello @kloczek, sorry for the late reply. I have been quite busy recently, giving me very little time to my open-source projects. I will come back to by the next week on this subject.
Np 👍
Just tested 3.11.6. Here is result
gentle ping ..
If you look at the tox.ini
file, you will see that there is two different functional testenv: the normal one and the light
one.
This is because some providers in Lexicon require optional dependencies that are installed only when Lexicon is installed with the full
extra. The light
testenv replicate this state, by installing Lexicon without the extra, and running the pytest suite with an extra custom flag, --xfail-providers-with-missing-deps
which makes pytest expect the tests for providers with optional dependencies (not installed in this case) to fail.
Here in your situation you seem to run the tests without this flag, so running the tests with the expectation to have all the optional dependencies in your virtual environment.
However it is only partially the case. If you have boto3
for instance, allowing the tests on the route53
provider to run, it is not the case for the dependencies localezone
, softlayer
and oci
, making the respective providers unable to work.
I do not know how the rpm tooling is working to generate the venv, but I guess you are missing the full extra, or most likely some RPM dependencies of these extra are missing or are not available.
Basically if you are fine with these three providers not working, I guess you could either just remove them from the code of the RPM package (including tests) or run pytest with the custom flag I mentionned above to let the test pass.
Note that in the latter case, Lexicon will still register the impacted provider, but will display a warning message that they cannot work because of missing dependencies.
This is because some providers in Lexicon require optional dependencies that are installed only when Lexicon is installed with the
full
extra. Thelight
testenv replicate this state, by installing Lexicon without the extra, and running the pytest suite with an extra custom flag,--xfail-providers-with-missing-deps
which makes pytest expect the tests for providers with optional dependencies (not installed in this case) to fail.
If it is the reason (with latest version) those options should be added to pytest.ini
Just tested 3.17.0 and looks like now pytest is failing a bit different
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modules