Closed kloczek closed 2 years ago
What is the version of mypy you are testing with? This version of immutables requries mypy>=0.910. If you can't update mypy, those tests can be skipped safely.
[tkloczko@barrel SPECS]$ pip show mypy | grep Version
Version: 0.910
Hm. That's a fairly arcane way of testing the package. setup.py install
has been deprecated for a long time and shouldn't be used anymore and this issue is one of the reasons why. Essentially, the install prefix site-packages creates this layout:
$ ls -l /tmp/immu//lib/python3.9/site-packages/
total 0
drwxr-xr-x 4 elvis elvis 80 Aug 7 14:50 immutables-0.15-py3.9-linux-x86_64.egg/
While Python's import system can deal with eggs, mypy and other tools cannot:
Actual:
test.py:1: error: Cannot find implementation or library stub for module named "immutables" (diff)
May I suggest using pip wheel
and pip install --root
to build and install the package properly instead?
Also, in addition to PYTHONPATH
you probably need to be setting MYPYPATH
to the same directory as well.
Finally, C Map is not available
indicates that pytest
is messing up the import paths and is not actually testing the installed code, run it with --import-mode=importlib
to fix this.
The make test
target in the package also triggers this issue.
Hm. That's a fairly arcane way of testing the package.
setup.py install
has been deprecated for a long time and shouldn't be used anymore and this issue is one of the reasons why. Essentially, the install prefix site-packages creates this layout:
Hmm .. so what should be used instead and what is the issue with setuptools install? It is still widelly used almost everuywrere. Just checked Fedora spec files
[tkloczko@barrel SPECS.fedora]$ grep %py3_install *| wc -l
2816
and mine:
[tkloczko@barrel SPECS]$ grep -w %py3_install python-*| wc -l; ls -1 python-*| wc -l
563
567
While Python's import system can deal with eggs, mypy and other tools cannot:
So looks like mypy issue .. AFAIK no one deperecated .egg-info metadata.
Also, in addition to
PYTHONPATH
you probably need to be settingMYPYPATH
to the same directory as well.
Hmm .. why mypy cannot use PYTHONPATH??
Finally,
C Map is not available
indicates thatpytest
is messing up the import paths and is not actually testing the installed code, run it with--import-mode=importlib
to fix this.
THos should be added to pytest params?
Hmm .. so what should be used instead and what is the issue with setuptools install?
Python packaging is moving away from setup.py
(see PEP 517, PEP 621, etc). You are supposed to use a packaging frontend instead of invoking setup.py
, which is now considered to be a packaging implementation detail. pip wheel
and build
are two examples of modern package builders.
Hmm .. why mypy cannot use PYTHONPATH??
I'm not exactly sure why, but per PEP 561 only site-packages
as returned by site.getsitepackages()
is consulted. All additional locations must be specified by MYPYPATH
.
THos should be added to pytest params?
Yes, add --import-mode=importlib
to pytest params.
The
make test
target in the package also triggers this issue.
@mgorny. make test
works without issues for me. How are you building/running it? FWIW, we don't recommend using the Makefile
for packaging, it's intended for development only.
The
make test
target in the package also triggers this issue.@mgorny.
make test
works without issues for me. How are you building/running it? FWIW, we don't recommend using theMakefile
for packaging, it's intended for development only.
Err, I've just run it ;-). I'm not using it for packaging, I've presumed that's how you expect me to test the development repo.
Err, I've just run it ;-)
I suspect it's because the test
target does not depend on build
and neither does it install dependencies needed for testing.
pip install -e .[test] && make && make test
in a fresh venv works consistently for me.
Finally,
C Map is not available
indicates thatpytest
is messing up the import paths and is not actually testing the installed code, run it with--import-mode=importlib
to fix this.
OK. I've tested that option and pytest still is failing:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-immutables-0.16-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-immutables-0.16-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/immutables-0.16, configfile: pytest.ini, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6
collected 153 items
tests/test_issue24.py ............
tests/test_map.py ..........................................................................................................................
tests/test_mypy.py Expected:
...
test.py:30: error: Incompatible types in assignment (expression has type "M...
test.py:31: error: Incompatible types in assignment (expression has type "M...
test.py:33: error: Incompatible types in assignment (expression has type "M...
test.py:34: error: Incompatible types in assignment (expression has type "M...
test.py:44: error: Unexpected keyword argument "three" for "update" of "Map" (diff)
test.py:45: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[IterableItems[int, str], Iterable[Tuple[int, str]]]" (diff)
test.py:49: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[IterableItems[str, str], Iterable[Tuple[str, str]]]" (diff)
test.py:53: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[IterableItems[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:57: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[IterableItems[str, Union[int, str]], Iterable[Tuple[str, Union[int, str]]]]" (diff)
test.py:63: error: Invalid index type "int" for "MapMutation[str, str]"; expected type "str" (diff)
test.py:64: error: Incompatible types in assignment (expression has type "int", target has type "str") (diff)
test.py:70: note: Revealed type is "immutables._map.Map[builtins.str*, builtins.str*]" (diff)
Actual:
...
test.py:30: error: Incompatible types in assignment (expression has type "M...
test.py:31: error: Incompatible types in assignment (expression has type "M...
test.py:33: error: Incompatible types in assignment (expression has type "M...
test.py:34: error: Incompatible types in assignment (expression has type "M...
test.py:35: error: Incompatible types in assignment (expression has type "Map[str, str]", variable has type "Map[str, Union[int, str]]") (diff)
test.py:45: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[Mapping[int, str], Iterable[Tuple[int, str]]]" (diff)
test.py:49: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[Mapping[str, str], Iterable[Tuple[str, str]]]" (diff)
test.py:52: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, str]"; expected "Union[Mapping[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:53: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[Mapping[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:57: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[Mapping[str, Union[int, str]], Iterable[Tuple[str, Union[int, str]]]]" (diff)
test.py:63: error: Invalid index type "int" for "MapMutation[str, str]"; expected type "str" (diff)
test.py:64: error: Incompatible types in assignment (expression has type "int", target has type "str") (diff)
test.py:70: note: Revealed type is "immutables._map.Map[builtins.str*, builtins.str*]" (diff)
Alignment of first line difference:
E: test.py:44: error: Unexpected keyword argument "three" for "update" of "...
A: test.py:35: error: Incompatible types in assignment (expression has type...
^
F
tests/test_none_keys.py ..................
================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ testMypyImmu _______________________________________________________________________________
data: /home/tkloczko/rpmbuild/BUILD/immutables-0.16/tests/test-data/check-immu.test:1:
/usr/lib/python3.8/site-packages/pluggy/hooks.py:286: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python3.8/site-packages/pluggy/manager.py:93: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python3.8/site-packages/pluggy/manager.py:84: in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
/usr/lib/python3.8/site-packages/_pytest/runner.py:170: in pytest_runtest_call
raise e
/usr/lib/python3.8/site-packages/_pytest/runner.py:162: in pytest_runtest_call
item.runtest()
/usr/lib/python3.8/site-packages/mypy/test/data.py:248: in runtest
suite.run_case(self)
/usr/lib/python3.8/site-packages/mypy/test/testcmdline.py:39: in run_case
test_python_cmdline(testcase, step)
/usr/lib/python3.8/site-packages/mypy/test/testcmdline.py:101: in test_python_cmdline
assert_string_arrays_equal(expected_out, out,
/usr/lib/python3.8/site-packages/mypy/test/helpers.py:117: in assert_string_arrays_equal
raise AssertionError(msg)
E AssertionError: Invalid output (/home/tkloczko/rpmbuild/BUILD/immutables-0.16/tests/test-data/check-immu.test, line 1)
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183
/usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
self.issue_config_time_warning(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
FAILED tests/test_mypy.py::ImmuMypyTest::testMypyImmu
================================================================ 1 failed, 152 passed, 1 warning in 18.35s =================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
OK. I've tested that option and pytest still is failing:
Because you still don't seem to be setting MYPYPATH
OK. I've tested that option and pytest still is failing:
Because you still don't seem to be setting
MYPYPATH
Add use MYPATH changes nothing
+ export 'MYPYPATH=%{builderoot}/usr/lib64/python3.8/site-packages'
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-immutables-0.16-2.1.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-immutables-0.16-2.1.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=198155276
rootdir: /home/tkloczko/rpmbuild/BUILD/immutables-0.16, configfile: pytest.ini, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, Faker-8.12.1
collected 153 items
tests/test_issue24.py ............
tests/test_none_keys.py .................
tests/test_mypy.py Expected:
...
test.py:30: error: Incompatible types in assignment (expression has type "M...
test.py:31: error: Incompatible types in assignment (expression has type "M...
test.py:33: error: Incompatible types in assignment (expression has type "M...
test.py:34: error: Incompatible types in assignment (expression has type "M...
test.py:44: error: Unexpected keyword argument "three" for "update" of "Map" (diff)
test.py:45: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[IterableItems[int, str], Iterable[Tuple[int, str]]]" (diff)
test.py:49: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[IterableItems[str, str], Iterable[Tuple[str, str]]]" (diff)
test.py:53: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[IterableItems[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:57: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[IterableItems[str, Union[int, str]], Iterable[Tuple[str, Union[int, str]]]]" (diff)
test.py:63: error: Invalid index type "int" for "MapMutation[str, str]"; expected type "str" (diff)
test.py:64: error: Incompatible types in assignment (expression has type "int", target has type "str") (diff)
test.py:70: note: Revealed type is "immutables._map.Map[builtins.str*, builtins.str*]" (diff)
Actual:
...
test.py:30: error: Incompatible types in assignment (expression has type "M...
test.py:31: error: Incompatible types in assignment (expression has type "M...
test.py:33: error: Incompatible types in assignment (expression has type "M...
test.py:34: error: Incompatible types in assignment (expression has type "M...
test.py:35: error: Incompatible types in assignment (expression has type "Map[str, str]", variable has type "Map[str, Union[int, str]]") (diff)
test.py:45: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[Mapping[int, str], Iterable[Tuple[int, str]]]" (diff)
test.py:49: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[Mapping[str, str], Iterable[Tuple[str, str]]]" (diff)
test.py:52: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, str]"; expected "Union[Mapping[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:53: error: Argument 1 to "update" of "Map" has incompatible type "Dict[str, int]"; expected "Union[Mapping[Union[int, str], str], Iterable[Tuple[Union[int, str], str]]]" (diff)
test.py:57: error: Argument 1 to "update" of "Map" has incompatible type "Dict[int, int]"; expected "Union[Mapping[str, Union[int, str]], Iterable[Tuple[str, Union[int, str]]]]" (diff)
test.py:63: error: Invalid index type "int" for "MapMutation[str, str]"; expected type "str" (diff)
test.py:64: error: Incompatible types in assignment (expression has type "int", target has type "str") (diff)
test.py:70: note: Revealed type is "immutables._map.Map[builtins.str*, builtins.str*]" (diff)
Alignment of first line difference:
E: test.py:44: error: Unexpected keyword argument "three" for "update" of "...
A: test.py:35: error: Incompatible types in assignment (expression has type...
^
F
tests/test_none_keys.py .
tests/test_map.py ..........................................................................................................................
================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ testMypyImmu _______________________________________________________________________________
data: /home/tkloczko/rpmbuild/BUILD/immutables-0.16/tests/test-data/check-immu.test:1:
/usr/lib/python3.8/site-packages/pluggy/hooks.py:286: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
/usr/lib/python3.8/site-packages/pluggy/manager.py:93: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python3.8/site-packages/pluggy/manager.py:84: in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
/usr/lib/python3.8/site-packages/_pytest/runner.py:170: in pytest_runtest_call
raise e
/usr/lib/python3.8/site-packages/_pytest/runner.py:162: in pytest_runtest_call
item.runtest()
/usr/lib/python3.8/site-packages/mypy/test/data.py:248: in runtest
suite.run_case(self)
/usr/lib/python3.8/site-packages/mypy/test/testcmdline.py:39: in run_case
test_python_cmdline(testcase, step)
/usr/lib/python3.8/site-packages/mypy/test/testcmdline.py:101: in test_python_cmdline
assert_string_arrays_equal(expected_out, out,
/usr/lib/python3.8/site-packages/mypy/test/helpers.py:117: in assert_string_arrays_equal
raise AssertionError(msg)
E AssertionError: Invalid output (/home/tkloczko/rpmbuild/BUILD/immutables-0.16/tests/test-data/check-immu.test, line 1)
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183
/usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
self.issue_config_time_warning(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
FAILED tests/test_mypy.py::ImmuMypyTest::testMypyImmu
================================================================ 1 failed, 152 passed, 1 warning in 18.61s =================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
Off topic question.
In my build procedures of many packages I found that important is to have before test suite execution or even docyumentation build .egg-info metadata.
I see that your module during the setuptools build
command additionally runs egg_info
command. Do you know what exactly triggers in setup.{py,cfg}/project.toml execution of that command?
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/immutables
copying immutables/__init__.py -> build/lib.linux-x86_64-3.8/immutables
copying immutables/_protocols.py -> build/lib.linux-x86_64-3.8/immutables
copying immutables/_testutils.py -> build/lib.linux-x86_64-3.8/immutables
copying immutables/_version.py -> build/lib.linux-x86_64-3.8/immutables
copying immutables/map.py -> build/lib.linux-x86_64-3.8/immutables
running egg_info <<=== HERE
creating immutables.egg-info
writing immutables.egg-info/PKG-INFO
writing dependency_links to immutables.egg-info/dependency_links.txt
writing requirements to immutables.egg-info/requires.txt
writing top-level names to immutables.egg-info/top_level.txt
writing manifest file 'immutables.egg-info/SOURCES.txt'
reading manifest file 'immutables.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
adding license file 'LICENSE-APACHE'
adding license file 'NOTICE'
writing manifest file 'immutables.egg-info/SOURCES.txt'
copying immutables/_map.c -> build/lib.linux-x86_64-3.8/immutables
copying immutables/_map.h -> build/lib.linux-x86_64-3.8/immutables
copying immutables/_map.pyi -> build/lib.linux-x86_64-3.8/immutables
copying immutables/py.typed -> build/lib.linux-x86_64-3.8/immutables
copying immutables/pythoncapi_compat.h -> build/lib.linux-x86_64-3.8/immutables
running build_ext
building 'immutables._map' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/immutables
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DNDEBUG=1 -I/usr/include/python3.8 -c immutables/_map.c -o build/temp.linux-x86_64-3.8/immutables/_map.o -O2 -std=c99 -fsigned-char -Wall -Wsign-compare -Wconversion
/usr/bin/gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-3.8/immutables/_map.o -L/usr/lib64 -o build/lib.linux-x86_64-3.8/immutables/_map.cpython-38-x86_64-linux-gnu.so
I cannot find anything about that in available documentation :/
Add use
MYPATH
changes nothing
- export 'MYPYPATH=%{builderoot}/usr/lib64/python3.8/site-packages'
You've got a typo in macro name, should be %{buildroot}
I see that your module during the setuptools
build
command additionally runsegg_info
command.
setuptools calls egg_info
from install_egg_info
, which is part of install
. Here's the doc
Add use
MYPATH
changes nothing
- export 'MYPYPATH=%{builderoot}/usr/lib64/python3.8/site-packages'
You've got a typo in macro name, should be
%{buildroot}
Ahh .. sorry :/ Now is way better :)
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=14365310
rootdir: /home/tkloczko/rpmbuild/BUILD/immutables-0.16, configfile: pytest.ini, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, Faker-8.12.1, nose2pytest-1.0.8
collected 153 items
tests/test_map.py ..........................................................................................................................
tests/test_issue24.py ............
tests/test_none_keys.py ...
tests/test_mypy.py .
tests/test_none_keys.py ...............
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183
/usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
self.issue_config_time_warning(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
===================================================================== 153 passed, 1 warning in 18.06s ======================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
Thank you :)
Still it is minor warning about use --strict
but it is less important.
I see that your module during the setuptools
build
command additionally runsegg_info
command.setuptools calls
egg_info
frominstall_egg_info
, which is part ofinstall
. Here's the doc
Thank you very much .. this is what I've been looking for :)
Feel free to close this ticket.
You've got a typo in macro name, should be
%{buildroot}
I see that your module during the setuptools
build
command additionally runsegg_info
command.setuptools calls
egg_info
frominstall_egg_info
, which is part ofinstall
. Here's the doc
I just read this one more time and .. install
always calls install_egg_info
which calls egg_info
. I see that all the time.
My question was however about build
.
I see that sometimes build
like in your module calls egg_info
.
Many of may build procedures are calling build_sphinx
after build
to build documentation (I'm building all python module sphinx documentation as man pages). Issue is that in many cases build_sphinx
needs module metadata and have.
You module is one of those which as part of the build
are automatically calls egg_info
and I cannot find what triggers that egg_info
as part of the build
.
Browsing setuptools
documentation I cannot find any details about that exactly bit :/
Just tested 0.18 and looks like pytest is now OK.
Only other thing which I see are kind of odd messages on pep517 build
Feel free to close that ticket. Thank you 😃
Thanks @kloczek
I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:
May I ask for help because few units are failing: