Commit graph

1132 commits

Author SHA1 Message Date
Jakub Kadlcik
4c4b1268b3 Add release instructions for PyPI 2022-07-21 11:00:34 +02:00
Jakub Kadlcik
4638a05b76 Automatic commit of package [tito] release [0.6.21-1].
Created by command:

/usr/bin/tito tag
2022-07-21 10:45:05 +02:00
Jakub Kadlcik
d541c5a241 Don't release for F34 anymore 2022-07-21 10:43:39 +02:00
Jakub Kadlcik
b17cc0592b Use io.open instead of open
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.
2022-07-21 10:39:55 +02:00
Jakub Kadlcik
bb3e661124 Properly catch TitoException
This is for example raised by builders, e.g.

    ERROR: Builder missing required argument: mock
2022-05-01 13:38:31 -04:00
Jakub Kadlcik
6570577782 Add documentation for the MockBuilder 2022-05-01 13:38:31 -04:00
Jakub Kadlcik
55454d836c Allow to define mock chroot in tito.props
[buildconfig]
    builder = tito.builder.MockBuilder

    [builder]
    mock = fedora-rawhide-x86_64
2022-05-01 13:38:31 -04:00
Jakub Kadlcik
4b4842fe3c Fix recursion error in MockBuilder
Fix #323
2022-05-01 13:38:31 -04:00
Pavel Raiskup
23216dd7b3 DistGitReleasers: don't nuke external sources with fetch_sources
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
2022-04-18 18:27:43 -04:00
Jakub Kadlcik
dbe6d6d41f Release also for F36 2022-04-11 00:42:40 +02:00
Jakub Kadlcik
5382a197e9 Add installation instructions from PyPI
Fix #404
2022-03-13 22:44:47 +01:00
Jakub Kadlcik
bd1b8e1bf4 Add long_description to setup.py
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.
2022-03-13 22:44:10 +01:00
Jakub Kadlcik
ed2d2e15e0 Release for EPEL9, don't release for F33 anymore 2022-02-23 12:47:18 +01:00
Jakub Kadlcik
201731715a Automatic commit of package [tito] release [0.6.20-1].
Created by command:

/usr/bin/tito tag
2022-02-23 12:35:54 +01:00
Nikos Moumoulidis
45d431ad14 Sync repo (in addition to tag) during mead build 2022-02-23 11:59:04 +01:00
Jakub Kadlcik
7177422ec9 Add 'Building RHEL packages with Tito' as external doc
http://frostyx.cz/posts/building-rhel-packages-with-tito
2021-09-24 02:25:05 +02:00
Jakub Kadlcik
bd7b56a93a Consider the current project git config when releasing to DistGit
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.
2021-09-13 00:21:43 +02:00
Jakub Kadlcik
0df894d613 Print the problematic binary files
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
2021-08-29 19:28:37 +02:00
Jakub Kadlcik
3a3039beb1 Release also for F35 2021-08-15 22:49:04 +02:00
Jakub Kadlcik
41f7cfd09f Automatic commit of package [tito] release [0.6.19-1].
Created by command:

/usr/bin/tito tag
2021-08-15 22:42:29 +02:00
Jakub Kadlcik
8e196799c8 Drop unused urllib.request import
Fix RHBZ 1982135
2021-07-16 22:16:56 +02:00
Jakub Kadlcik
6553a15948 Automatic commit of package [tito] release [0.6.18-1].
Created by command:

/usr/bin/tito tag
2021-06-23 21:32:50 +02:00
Jakub Kadlcik
a02aef69e5 Document fetch_sources option in tito.props 2021-06-23 20:36:06 +02:00
Jakub Kadlcik
971c39b5ed Rename fetch-sources to fetch_sources in the tito.props config
Complements PR #407

Every other `tito.props` config option uses underscores instead of
dashes, so let's preserve this convention.
2021-06-23 20:36:06 +02:00
Silvie Chlupova
5de167e0ff Adding option to fetch sources 2021-06-15 15:26:24 +02:00
Jakub Kadlcik
24b8f3d7d4 Change the master branch in releasers.conf to rawhide 2021-05-17 02:46:13 +02:00
Jakub Kadlcik
d6aeb8a29b Automatic commit of package [tito] release [0.6.17-1].
Created by command:

/usr/bin/tito tag
2021-05-17 02:37:35 +02:00
Jakub Kadlcik
23b24a289a Update releasers.conf 2021-05-17 02:36:56 +02:00
Nikos Moumoulidis
0729445d2f Make build --verbose autocompletable 2021-05-11 20:59:34 +02:00
William Poteat
883754e2e5 Add support for centpkg 2021-05-11 17:10:05 +02:00
Allen Reese
0dbcfc4554 Remove extraneous extra newline 2021-05-11 02:03:07 +02:00
Allen Reese
8570695097 Add some documentation for tito.builder.SubmoduleAwareBuilder 2021-05-11 02:03:07 +02:00
Allen Reese
71c2712e7e Update based on feedback:
1. Remove PushDir, tito.common.chdir has the same functionality so use that instead.
2. Remove useless override of constructor, it's just extra noise.
2021-05-11 02:03:07 +02:00
Allen Reese
f4251b30cd 150 Add support for repos that use submodules.
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
```
2021-05-11 02:03:07 +02:00
Link Dupont
88699fdf0b doc: fix typo tito.props 2021-04-15 02:18:22 +02:00
Jakub Kadlcik
286d5e4131 Update fedora releaser in .tito/releasers.conf 2021-01-26 16:42:31 +01:00
Jakub Kadlcik
0cbcb8a5e8 Automatic commit of package [tito] release [0.6.16-1].
Created by command:

/usr/bin/tito tag
2021-01-26 16:34:24 +01:00
Pavel Raiskup
6198e4d203 Enable Packit pull-request CI
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/920

Fixes: #395
2021-01-12 17:45:46 +01:00
Jakub Kadlcik
d96c9c7d7a Stop running tests for F27 in favor of F33 2021-01-12 16:27:27 +01:00
Jakub Kadlcik
6a216b2ea6 Fix manpage generation on Fedora Rawhide (F34)
I believe this is a `a2x` bug, not ours, so I am just workarounding it until the
issue gets fixed. The error looks like this

    [root@449665d34a95 sandbox]# a2x -d manpage -f manpage tito.8.asciidoc --verbose
    a2x: args: ['-d', 'manpage', '-f', 'manpage', 'tito.8.asciidoc', '--verbose']
    a2x: resource files: []
    a2x: resource directories: ['/etc/asciidoc/images', '/etc/asciidoc/stylesheets']
    a2x: executing: "/usr/bin/asciidoc.py" --backend docbook -a "a2x-format=manpage"  --doctype manpage --verbose  --out-file "/home/sandbox/tito.8.xml" "/home/sandbox/tito.8.asciidoc"

    asciidoc: reading: /etc/asciidoc/asciidoc.conf
    asciidoc: reading: /home/sandbox/tito.8.asciidoc
    asciidoc: include: /home/sandbox/man.asciidoc
    asciidoc: tito.8.asciidoc: line 3: reading: /home/sandbox/man.asciidoc
    asciidoc: reading: /etc/asciidoc/docbook45.conf
    asciidoc: reading: /etc/asciidoc/filters/graphviz/graphviz-filter.conf
    asciidoc: reading: /etc/asciidoc/filters/source/source-highlight-filter.conf
    asciidoc: reading: /etc/asciidoc/filters/code/code-filter.conf
    asciidoc: reading: /etc/asciidoc/lang-en.conf
    asciidoc: writing: /home/sandbox/tito.8.xml
    asciidoc: include: /home/sandbox/AUTHORS
    asciidoc: tito.8.asciidoc: line 299: reading: /home/sandbox/AUTHORS

    a2x: executing: "xmllint" --nonet --noout --valid "/home/sandbox/tito.8.xml"

    I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
    /home/sandbox/tito.8.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
    D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
										^
    /home/sandbox/tito.8.xml:5: validity error : Validation failed: no DTD found !
    <refentry lang="en">
		    ^

    a2x: ERROR: "xmllint" --nonet --noout --valid "/home/sandbox/tito.8.xml" returned non-zero exit status 4
2021-01-12 16:27:27 +01:00
Jakub Kadlcik
d41626d181 Print filenames that doesn't comply PEP8
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)
2021-01-12 16:27:27 +01:00
Jakub Kadlcik
998f7fb067 Make tests working on systems without non-versioned python macros
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`.
2020-10-12 11:39:27 +02:00
Jakub Kadlcik
861d15518e Ignore spectool warnings
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.
2020-10-06 21:44:14 +02:00
Jakub Kadlcik
00ee487ed2 Skip nonexisting extra sources
Make the `copy_extra_sources` method more foolproof and don't
traceback when a SourceX file doesn't exist.
2020-10-06 21:44:14 +02:00
Jakub Kadlcik
5947384f32 Fix copy_extra_sources for remote URLs
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.
2020-10-06 16:20:05 +02:00
Jiri Hnidek
d9ed1db7da Do not use absolute path to generate-patches.pl script
* When tito is installed using pip, then generate-patches is
  installed into the ~/.local/bin directory and the absolute
  path cannot work
2020-10-02 11:57:37 +02:00
Jakub Kadlcik
5575554c95 Use --no-rebuild-srpm for scratch builds in KojiReleaser
Fix #382
2020-08-11 18:00:04 +02:00
Jakub Kadlcik
2a9178dcf2 Automatic commit of package [tito] release [0.6.15-1].
Created by command:

/usr/bin/tito tag
2020-07-10 11:06:05 +02:00
Jakub Kadlcik
7f95272004 Do not release for F30 anymore 2020-07-10 10:59:41 +02:00
Jakub Kadlčík
0d4f1ccd38
Merge pull request #379 from praiskup/copy-extra-sources-fedora-releaser
FedoraGitReleaser: upload extra sources to lookaside cache
2020-06-13 23:11:22 +02:00