I don't remember if the `encoding="utf-8"` parameter for `open` is
necessary in this case but I think I added it for a reason. Let's be
safe and not remove it. Instead let's use `io.open` which supports it
even in python 2.
Previously only 'tito build --srpm|--rpm' worked well with fetch_sources
where we rely on RPM's (rpmbuild) built-in download mechanism. It did
not work well with 'tito release' and DistGit releasers, though.
The thing is that we don't use rpmbuild at all while doing DistGit
releases BUT we still want those files to be (a) downloaded to
%_sourcedir and then (b) uploaded to DistGit lookaside cache. Because
we did not download those files before, every extra source file was
entirely ignored, or even worse, if the file was already uploaded in
the target lookaside cache, the file was removed from sources.
This issue has bitten us during the 'copr-backend' releases several
times before, and now it starts also in 'resalloc-aws' releases.
Unfortunately for this fix, we don't read/use the "buildconfig" options
while instantiating Builder objects from Releaser classes, therefore
I had to add an explicit read for the 'fetch_sources' config.
Closes: PR#420
Relates: #407
I uploaded tito to PyPI, see https://pypi.org/project/tito/
and it says that
> The author of this package has not provided a project description
This should fix it.
I use two different email addresses for git config, depending on what
kind of project it is going on. I use my personal email address for
public community projects and my work email address for internal
repositories.
Let's say my global config is my personal address
$ git config --get --global user.email
frostyx@email.cz
And that I am working on an internal project, therefore I set
git config user.email "jkadlcik@redhat.com"
Once I run `tito release internal`, I would like all changes to be
commited with my work address, i.e. I would like the local git user
config to be considered. This commit fixes that.
The output will look like this:
Binary files /dev/null and b/createrepo_mod/tests/packages/foo-3.0.10-3.fc33.noarch.rpm differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-other.xml.gz differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-filelists.sqlite.bz2 differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-other.sqlite.bz2 differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-primary.sqlite.bz2 differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-primary.xml.gz differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-filelists.xml.gz differ
Binary files /dev/null and b/modulemd-merge/tests/testdata/repodata/foo-modules.yaml.gz differ
ERROR: You are doomed. Diff contains binary files. You can not use this builder
Allow though submodules are a contentious topic, this adds a submodule_aware_builder
This can be used with the following config in tito.props:
```
[buildconfig]
builder = SubmoduleAwareBuilder
```
Enable it on all currently supported Fedora/EPEL architectures.
Packit doesn't support our way of preparing source RPMs via the command
'tito build --srpm --test', but creates it's own source RPM instead.
This doesn't seem to cause a practical problems, so we are good to go
for now till the Packit RFE is implemented:
https://github.com/packit/packit-service/issues/920Fixes: #395
The old output was missing filenames, e.g.
AssertionError: Found PEP8 errors that may break your code in Python 3:
2 E201 whitespace after '['
3 E202 whitespace before ']'
2 E203 whitespace before ':'
1 E221 multiple spaces before operator
1 E302 expected 2 blank lines, found 1
2 E303 too many blank lines (2)
That's now usefull at all. Where the heck should I search for these errors. The
new output is a little bit messy but contains more usefull information, e.g.
AssertionError: Found PEP8 errors that may break your code in Python 3:
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:9:1: E302 expected 2 blank lines, found 1
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:17:66: E202 whitespace before ']'
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:21:15: E203 whitespace before ':'
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:22:16: E203 whitespace before ':'
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:26:18: E201 whitespace after '['
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:26:32: E202 whitespace before ']'
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:29:15: E201 whitespace after '['
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:29:32: E202 whitespace before ']'
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:35:17: E221 multiple spaces before operator
/tito/test/unit/../../src/tito/release/LocalYumRepo.py:76:5: E303 too many blank lines (2)
See RHBZ 1784688
We are using unversioned python macros, such as `%__python` and
`%python_sitelib` which are not supported in Fedora rawhide
anymore. Instead, we should use `%__python3` and `%python3_sitelib`.
Without this change, the spectool output can look like this
[root@e15222e75294 pkg1]# spectool -S titotestpkg.spec | awk '{print $2}'
warning: Macro expanded in comment on line 37: %{python3_sitelib}/%{name}
titotestpkg-0.0.1.tar.gz
and then each of the lines is considered to be a SourceX file. We
should really ignore the warnings.
Fix#387
A build with a remote URL in its `SourceX` will work only with
%_disable_source_fetch 0
macro defined. It can be done either globally via `~/.rpmmacros` or by
using tito with following parameter
--rpmbuild-options="--define '%_disable_source_fetch 0'"
IMHO this macro should be set by default but we should also introduce
a switch to turn it off (like e.g. Mock or Copr do). Since it is not
related to fixing #387, I am not doing it in this commit.