Commit graph

1150 commits

Author SHA1 Message Date
Arun Babu Neelicattu
b635baa305 builder: defer submodule detection to git 2024-11-11 20:31:45 +01:00
Pavel Raiskup
e252a4ea1e lint: fix errors that appear to be new in #504 2024-11-06 11:19:55 +01:00
Pavel Raiskup
167a91cb4f tests: make the fedora-tox.yml working
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.
2024-11-06 11:19:55 +01:00
Pavel Raiskup
5f55271ca3 tests: drop (nowadays) useless hack for Python 2.4
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).
2024-11-06 11:19:55 +01:00
Pavel Raiskup
ef5e8abd81 Use packaging.version.Version() not LooseVersion
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.
2024-11-06 11:19:55 +01:00
Pavel Raiskup
8ce108266b tests: enable tests at RPM build time
- 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.
2024-11-06 11:19:55 +01:00
Pavel Raiskup
6feb4f2d21 tests: s/nosetests/pytest/
- 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.
2024-11-06 11:19:55 +01:00
Pavel Raiskup
3ec27836f3 tests: make tox tests working 2024-11-06 11:19:55 +01:00
Pavel Raiskup
f39b3d620d Fix linter errors
Mostly wrong import order, useless imports, etc.
2024-11-06 11:19:55 +01:00
Pavel Raiskup
cf1524495d tests: skip test_conformance() test
At least temporarily, if anyone wants to make it working in the future
(I am not motivated enough as we use vcs-diff-lint/python for similar
things).
2024-11-06 11:19:55 +01:00
Pavel Raiskup
10b315b1a5 tests: adapt test_undo_tag() to the master → main change 2024-11-06 11:19:55 +01:00
Pavel Raiskup
6e0f1f12ef tests: don't trim the reported nose/python versions 2024-11-06 11:19:55 +01:00
Pavel Raiskup
d220002bf0 tests: unittests assertEquals() is now assertEqual() 2024-11-06 11:19:55 +01:00
Pavel Raiskup
b895acb7db tests: modernize import statements 2024-11-06 11:19:55 +01:00
Pavel Raiskup
8692c9d420 Fix pylintrc & sync with Mock's one
************* Module pylintrc
pylintrc:1:0: F0011: error while parsing the configuration: File contains no section
2024-10-04 10:12:08 +02:00
Pavel Raiskup
61838924c6 New config option buildconfig.test_version_suffix
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
2024-10-02 12:35:47 +02:00
Jakub Kadlcik
2061732f6b Rename master branch to main
Fix #438
2024-04-23 12:32:37 +02:00
Jakub Kadlcik
fb1e00e074 Automatic commit of package [tito] release [0.6.26-1].
Created by command:

/usr/bin/tito tag --use-version=0.6.26
2024-03-05 18:19:39 +01:00
Jakub Kadlcik
e8de2e8e95 Remove redundant slash from a regex
Fix #492
Follow-up after #473
2024-02-27 22:39:22 +01:00
Pavel Raiskup
6d09a79369 <gitroot>/tito wrapper
This makes executing of Tito-from-Git a bit more convenient.
2024-02-27 18:51:27 +01:00
Pavel Raiskup
c6c091177d Fix a runtime SyntaxWarning with Python 3.12
Creating output directory: /tmp/tito
src/tito/builder/main.py:871: SyntaxWarning: invalid escape sequence '\d'
  patch_pattern = re.compile('^Patch(\d+):')
src/tito/builder/main.py:872: SyntaxWarning: invalid escape sequence '\d'
  source_pattern = re.compile('^Source(\d+)?:')
Building package [tito-0.6.25-1]
Wrote: /tmp/tito/tito-git-2.909184d.tar.gz
2024-02-23 23:10:11 +01:00
Jakub Kadlcik
409f37b269 Add .post suffix for the version 2024-01-28 15:30:49 +01:00
Jakub Kadlcik
38a3d7dbef Automatic commit of package [tito] release [0.6.25-1].
Created by command:

/usr/bin/tito tag --use-version=0.6.25
2024-01-28 15:16:04 +01:00
Jakub Kadlcik
c578f53d4f Document distribution aliases in releasers.conf manpage 2024-01-28 15:07:35 +01:00
Jakub Kadlcik
1b031f312f Update releasers.conf to use fedora and epel aliases 2024-01-28 14:50:56 +01:00
Jakub Kadlcik
53403f1d05 Whatever the alias order, release into rawhide first
Follow-up after PR #476
2024-01-28 14:50:14 +01:00
Jakub Kadlcik
5b05b611a7 Fix traceback related to undefined variable
Fixup after 68d8b21
Obsoletes PR #487
2024-01-28 13:53:16 +01:00
Jakub Kadlcik
b9d6d2b96b Use rpm.ds instead of deprecated hdr.dsFromHeader
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`.
2024-01-28 13:43:52 +01:00
Jakub Kadlcik
3cb798fa83 Support branch aliases in releasers
Fix #430
2024-01-15 13:19:29 +01:00
Pavel Raiskup
9d1c10f52f packit: generate tarball by tito, read Version from spec
Complements: #483
Relates: #480
2024-01-12 15:02:00 +01:00
Pavel Raiskup
a096b21484 Bump the ENVRA built directly from git master branch
Fixes: #480
2024-01-12 10:51:01 +01:00
Jakub Kadlcik
18b1badd60 Rename --without-init to --ignore-missing-config
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.
2024-01-11 11:14:14 +01:00
Jakub Kadlcik
68d8b219db Building in non-initialized project without explicit parameter
Fix #472
2024-01-11 11:14:14 +01:00
Miroslav Suchý
39943ba3fc document how to automate bodhi updates
Fixes: #428
2024-01-05 17:26:25 +01:00
Jakub Kadlcik
87f8076adb Use raw strings for regex patterns
I am fixing the following syntax warnings and more.

/home/jkadlcik/git/tito/src/tito/common.py:81: SyntaxWarning: invalid escape sequence '\d'
  source_pattern = re.compile('^Source\d+?:\s*(.*)')
/home/jkadlcik/git/tito/src/tito/common.py:732: SyntaxWarning: invalid escape sequence '\s'
  ver_regex = re.compile("(\s*)(version)(\s*)(=)(\s*)(['\"])(.*)(['\"])(.*)",
/home/jkadlcik/git/tito/src/tito/tar.py:187: SyntaxWarning: invalid escape sequence '\d'
  field_size = int(re.match('(\d+)', member_template).group(1)) - 1
2024-01-04 19:02:13 +01:00
Jakub Kadlcik
4fb18d45c4 Allow tito build without .tito directory
Fix #472
2024-01-04 18:58:07 +01:00
Miroslav Suchý
37a8a23dbb unify README and index.md
README is in better state - I used that one
2024-01-04 14:10:34 +01:00
Jakub Kadlcik
9fd0c5a2c7 Fix PEP8 issues found by runtests.py 2023-08-14 14:15:32 +02:00
Jakub Kadlcik
2ad7a823dd Replace egrep with grep -E
egrep: warning: egrep is obsolescent; using grep -E
2023-08-14 14:15:32 +02:00
Jakub Kadlcik
39b298aa38 Don't use --cacheonly on DNF5
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
2023-08-14 13:54:43 +02:00
Jakub Kadlcik
2a15b8c171 Automatic commit of package [tito] release [0.6.24-1].
Created by command:

/usr/bin/tito tag
2023-07-08 01:58:09 +02:00
Arcadiy Ivanov
369c6baeb5 Will now copy both source files and patch files declared in the spec
Also fix some spelling errors

fixes #463
2023-07-07 19:55:42 -04:00
Jakub Kadlčík
39449a8cc2
Fix UpstreamBuilder deprecation warning (#461)
RPM build warnings:
        %patchN is deprecated (1 usages found), use %patch N (or %patch -P N)
2023-06-30 09:43:30 +02:00
Jakub Kadlčík
deb8dd130a
Show how to specify additional mock parameters (#436)
See #435
2023-06-30 09:42:43 +02:00
Jakub Kadlčík
3aba8d0f7a
Fix the setup.py license according to tito.spec (#433)
See PR #431
2023-06-30 09:36:18 +02:00
Jakub Kadlcik
863e4c7e34 Update releasers.conf 2023-06-13 19:34:48 +02:00
Jakub Kadlcik
9973d7e92f Automatic commit of package [tito] release [0.6.23-1].
Created by command:

/usr/bin/tito tag
2023-06-13 19:01:04 +02:00
Arcadiy Ivanov
835309b6f4 Submodules may contain other submodules. Do process and add those
to the source tar.

fixes #456
2023-05-16 11:37:25 +02:00
Arcadiy Ivanov
71c8e6f652 Replace submodule--helper list with git config --get-regexp
fixes #454
2023-04-26 16:23:38 +02:00
Lumír 'Frenzy' Balhar
6324a06670 Switch tox-github-action from master to main branch 2023-04-17 01:03:11 +02:00