This is tricky. Note the sys.path hack in test/unit/__init__.py where
we intentionally use the Fedora's default Python libraries with a
different Python version selected by Tox. Right now it means that we
use, e.g., python3-rpm compiled for Python 3.12 (F39) with Python 3.7
(which probably works because Tox is executed as root in the tox
container, overwriting the pre-compiled *.pyc files in container).
Some tests need to be skipped in Tox, therefore the skip_if_tox()
method.
Also, the GitHub's action for 'git checkout' provides somewhat
non-standard environment for Tito to work, hence the fix_tox_env()
configuration method.
Even Python 2.7 is now EOL. And this weird import has been breaking
the Tox tests (importing the tagger class brought in other unnecessary
deps and tests bombed).
The Version is more strict, but we only use this for the implementation
of tito.props configuration:
[requirements]
tito = <version>
And the tito versions are not anyhow extraordinary.
Note, this is done to fix a tox test failure.
- Some tests can not work at rpmbuild time, because we can not run
rpmbuild in rpmbuild, and there's no .git/ directory, skip.
- Use 'titodir' below 'srcdir', to not pollute the /tmp/tito dir.
- The test_colors() test requires color-friendly TERM env.
- EL7 is EOL, do not enable tests there.
- Requires us to add pytest.ini to tell pytest where to look for test
files, and set the python path.
- Mock drops terminal from the tested code, so we have to "mock" it in
test_colors()
- Enable coverage in tox tests.
If configured like
$ cat .tito/tito.props
[buildconfig]
test_version_suffix = .tito.git
The `tito build --test ...` NEVRA is always higher than the NEVRA of
released RPMs.
Fixes: #460
Fix#481
See also https://github.com/rpm-software-management/mock/pull/1223
As a reproducer, I used the following releaser:
[yum]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.Builder
srpm_disttag = fc39
rsync = /tmp/tito/yum-repo
and then did `tito release yum`.
The behavior changed. We now build non-initialized projects without
any additional parameter. The `--without-init` could be confusing
because it could be understood as ignoring `.tito` directory even if
it is there. Which is not true, if `.tito` directory exists, the
parameter does nothing. It is only used to silence warnings.
Fix#466
See #363
Actually, it still doesn't work completely but this particular issue
is fixed. I am now getting:
Auto-installing packages:
sudo dnf install -y /tmp/tito/noarch/tito-0.6.24-1.git.0.2a15b8c.fc39.noarch.rpm
...
Failed to resolve the transaction:
Problem: problem with installed package
- cannot install both tito-0.6.24-1.git.0.2a15b8c.fc39.noarch and tito-0.6.24-2.fc39.noarch
- conflicting requests
Which seems to be fixed in the dnf5 main branch:
https://github.com/rpm-software-management/dnf5/issues/722