Skip to content

Commit

Permalink
Merge branch 'openSUSE:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hramrach authored Dec 16, 2023
2 parents 66fb8d2 + e7c0883 commit c8e83da
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 62 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '2.7', '3.7', '3.8', '3.9' ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -39,9 +39,10 @@ jobs:
locale
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install python dependencies
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ confidence=
# * E0015 - unrecognized-option


disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,missing-docstring,old-style-class,bad-whitespace,consider-using-with,consider-using-f-string,duplicate-code,R0022,W0012,E0012,E0015
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,missing-docstring,old-style-class,bad-whitespace,consider-using-with,consider-using-f-string,duplicate-code,R0022,W0012,E0012,E0015,no-member


[REPORTS]
Expand Down
2 changes: 1 addition & 1 deletion .pylinttestsrc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ confidence=
# * W0012 - unknown-option-value
# * E0015 - unrecognized-option

disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,missing-docstring,old-style-class,bad-whitespace,duplicate-code,too-many-public-methods,protected-access,too-many-locals,consider-using-with,consider-using-f-string,super-with-arguments,E0012,R0022,W0012,E0015
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,missing-docstring,old-style-class,bad-whitespace,duplicate-code,too-many-public-methods,protected-access,too-many-locals,consider-using-with,consider-using-f-string,super-with-arguments,E0012,R0022,W0012,E0015,no-member


[REPORTS]
Expand Down
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

13 changes: 5 additions & 8 deletions KankuFile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Kanku::Util::IPTables:


domain_name: obs-service-tar_scm
default_job: kanku-job
default_job: tw
login_user: root
login_pass: kankudai

qemu:
user:

jobs:
kanku-job:
tw:
-
use_module: Kanku::Handler::SetJobContext
options:
Expand All @@ -25,9 +25,9 @@ jobs:
# https://build.opensuse.org/project/show/devel:kanku:immages
# to find more official Images
project: devel:kanku:images
repository: images_leap_15_3
package: openSUSE-Leap-15.3-JeOS
use_oscrc: 0
package: openSUSE-Tumbleweed-JeOS:ext4
repository: images_tumbleweed
arch: x86_64
-
use_module: Kanku::Handler::ImageDownload
options:
Expand All @@ -47,7 +47,6 @@ jobs:
options:
commands:
- zypper -n in git bzr mercurial subversion make tar
- zypper -n in python2-PyYAML python2-python-dateutil python2-mock python2-pylint python2-flake8
- zypper -n in python3-PyYAML python3-python-dateutil python3-pylint python3-flake8
-
use_module: Kanku::Handler::ExecuteCommandViaSSH
Expand All @@ -56,5 +55,3 @@ jobs:
commands:
# test python3
- make -C /tmp/kanku clean check3
# test python2
- make -C /tmp/kanku clean test2
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ under the `tests/fixtures/` subdirectory.
### gbp
The `obs_gbp` service can be used to create Debian source artefacts
(.dsc, .orig.tar.gz and if non-native .debian.tar.gz or .diff.gz) from
Git repositories, following the very popular [git-buildpackage workflow.]
(https://honk.sigxcpu.org/piki/projects/git-buildpackage/)
Git repositories, following the very popular [git-buildpackage workflow](https://honk.sigxcpu.org/piki/projects/git-buildpackage/).
Requires git-buildpackage to be installed.

## Archive Formats
Expand Down
16 changes: 11 additions & 5 deletions TarSCM/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ def _init_config(self, fname):

if self.fakeheader:
logging.debug("Using fakeheader for file '%s'", fname)
tmp_fp = StringIO()
tmp_fp.write('[' + self.default_section + ']\n')
tmp_fp.write(open(fname, 'r').read())
tmp_fp.seek(0, os.SEEK_SET)
config.readfp(tmp_fp)
try:
fake_header = '[' + self.default_section + ']\n'
config.read_string(fake_header + open(fname, 'r').read(),
source=fname)
except AttributeError:
tmp_fp = StringIO()
tmp_fp.write('[' + self.default_section + ']\n')
tmp_fp.write(open(fname, 'r').read())
tmp_fp.seek(0, os.SEEK_SET)
config.readfp(tmp_fp)

else:
config.read(fname)

Expand Down
4 changes: 4 additions & 0 deletions TarSCM/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
class OptionsError(BaseException):
pass


class GitError(BaseException):
pass
3 changes: 2 additions & 1 deletion TarSCM/scm/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil

from TarSCM.scm.base import Scm
from TarSCM.exceptions import GitError


def search_tags(comment, limit=None):
Expand Down Expand Up @@ -585,7 +586,7 @@ def get_parents(self, sha1):
parents = result[1].rstrip().split(" ")
fcm = parents.pop(0)
if fcm != sha1:
raise Exception("First commit %s no equal sha1 %s" % (fcm, sha1))
raise GitError("First commit %s no equal sha1 %s" % (fcm, sha1))
if parents:
return parents
return []
Expand Down
5 changes: 3 additions & 2 deletions TarSCM/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ def generate_list(self):
files = glob.glob('*.obsinfo')
if files:
for obsinfo in files:
args.obsinfo = obsinfo
self.task_list.append(copy.copy(args))
if obsinfo != '_scmsync.obsinfo':
args.obsinfo = obsinfo
self.task_list.append(copy.copy(args))
else:
# Fallback if there are no obsinfo files
self.task_list.append(args)
Expand Down
19 changes: 19 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
obs-service-tar-scm (0.10.41) unstable; urgency=medium

* update to upstream version 0.10.41

-- Frank Schreiner <[email protected]> Thu, 20 Jul 2023 15:55:12 +0200

obs-service-tar-scm (0.10.40) unstable; urgency=medium

* update to upstream version 0.10.40

-- Frank Schreiner <[email protected]> Tue, 18 Jul 2023 14:08:09 +0200

obs-service-tar-scm (0.10.37) unstable; urgency=medium

[ Frank Schreiner]
* update to version 0.10.37

-- Frank Schreiner <[email protected]> Tue, 13 Jun 2023 15:39:11 +0200

obs-service-tar-scm (0.10.14) unstable; urgency=medium

[ Roman Neuhauser ]
Expand Down
19 changes: 19 additions & 0 deletions dist/debian.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Format: 1.0
Source: obs-service-tar-scm
Version: 0.10.36
Provides: obs-service-obs_scm, obs-service-tar
Binary: obs-service-tar_scm
Maintainer: Adrian Schroeter <[email protected]>
Architecture: all
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 8.0.0), python3, python3-dateutil, dh-python, python3-yaml

Package: obs-service-tar-scm
Architecture: all
Provides: obs-service-obs-scm, obs-service-tar
Depends: ${misc:Depends}, ${python3:Depends}, bzr, git, subversion, cpio, python3-dateutil, python3-yaml
Recommends: mercurial
Description: An OBS source service: fetches SCM tarballs
This is a source service for openSUSE Build Service.
It supports downloading from svn, git, hg and bzr repositories.

4 changes: 2 additions & 2 deletions dist/obs-service-tar_scm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Recommends: %{use_python}-keyrings.alt \
%define pkg_name obs-service-tar_scm
Name: %{pkg_name}%{nsuffix}
%define version_unconverted 0.10.18.1600256320.569e5be
Version: 0.10.18.1600256320.569e5be
Version: 0.10.35
Release: 0
Summary: An OBS source service: create tar ball from svn/git/hg
License: GPL-2.0-or-later
Expand All @@ -138,8 +138,8 @@ BuildRequires: %{pkg_name} = %{version}
BuildRequires: %{use_python}-keyring
BuildRequires: %{use_python}-keyrings.alt
BuildRequires: %{use_python}-six
BuildRequires: %{use_python}-unittest2
BuildRequires: bzr
BuildRequires: gpg
BuildRequires: git-core
BuildRequires: mercurial
BuildRequires: subversion
Expand Down
Binary file modified tests/fixtures/GitTests/test_find_valid_commit/fixtures.tar
Binary file not shown.
47 changes: 24 additions & 23 deletions tests/gittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ def test_submodule_update(self):
'--version', 'tag3')
tar_path = os.path.join(self.outdir,
self.basename(version='tag3') + '.tar')
tar = tarfile.open(tar_path)
submod_path = os.path.join(self.basename(version='tag3'),
submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '5')
with tarfile.open(tar_path) as tar:
submod_path = os.path.join(
self.basename(version='tag3'), submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '5')

def test_submodule_disabled_update(self):
submod_name = 'submod1'
Expand All @@ -169,9 +169,9 @@ def test_submodule_disabled_update(self):
'--version', 'tag3')
tar_path = os.path.join(self.outdir,
self.basename(version='tag3') + '.tar')
tar = tarfile.open(tar_path)
self.assertRaises(KeyError, tar.getmember, os.path.join(
self.basename(version='tag3'), submod_name, 'a'))
with tarfile.open(tar_path) as tar:
self.assertRaises(KeyError, tar.getmember, os.path.join(
self.basename(version='tag3'), submod_name, 'a'))

def test_submodule_in_other_branch(self):
submod_name = 'submod1'
Expand All @@ -185,10 +185,10 @@ def test_submodule_in_other_branch(self):
'--version', rev)
tar_path = os.path.join(self.outdir,
self.basename(version=rev) + '.tar')
tar = tarfile.open(tar_path)
submod_path = os.path.join(self.basename(version=rev),
submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '3')
with tarfile.open(tar_path) as tar:
submod_path = os.path.join(self.basename(version=rev),
submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '3')

def test_latest_submodule_in_other_branch(self): # pylint: disable=C0103
submod_name = 'submod1'
Expand All @@ -202,10 +202,10 @@ def test_latest_submodule_in_other_branch(self): # pylint: disable=C0103
'--version', rev)
tar_path = os.path.join(self.outdir,
self.basename(version=rev) + '.tar')
tar = tarfile.open(tar_path)
submod_path = os.path.join(self.basename(version=rev),
submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '5')
with tarfile.open(tar_path) as tar:
submod_path = os.path.join(
self.basename(version=rev), submod_name, 'a')
self.assertTarMemberContains(tar, submod_path, '5')

def _check_servicedata(self, expected_dirents=2, revision=2):
expected_sha1 = self.sha1s('tag%d' % revision)
Expand Down Expand Up @@ -289,12 +289,12 @@ def test_gitlab_github_files(self):
'gitlab_hub', "--versionformat", "@PARENT_TAG@")
tar_path = os.path.join(self.outdir,
self.basename(version='gitlab_hub') + '.tar')
tar = tarfile.open(tar_path)
submod_path = os.path.join(self.basename(version='gitlab_hub'))
hub_path = os.path.join(submod_path, '.github/test')
lab_path = os.path.join(submod_path, '.gitlab/test')
self.assertTarMemberContains(tar, hub_path, '')
self.assertTarMemberContains(tar, lab_path, '')
with tarfile.open(tar_path) as tar:
submod_path = os.path.join(self.basename(version='gitlab_hub'))
hub_path = os.path.join(submod_path, '.github/test')
lab_path = os.path.join(submod_path, '.gitlab/test')
self.assertTarMemberContains(tar, hub_path, '')
self.assertTarMemberContains(tar, lab_path, '')

def test_no_parent_tag(self):
fix = self.fixtures
Expand Down Expand Up @@ -439,11 +439,12 @@ def test_find_valid_commit(self):
tar_path = os.path.join(basedir, 'fixtures', cln, fnn, 'fixtures.tar')
if not os.path.isfile(tar_path):
raise AssertionError("File does not exist: %s" % tar_path)
basedir = os.path.abspath(os.path.join(os.getcwd(),'..'))
basedir = os.path.abspath(os.path.join(os.getcwd(), '..'))
org_gnupghome = os.getenv('GNUPGHOME')
os.environ["GNUPGHOME"] = os.path.join(basedir, '.gnupg')
with tarfile.open(tar_path, "r") as tar:
tar.extractall(basedir)
tar.close()

# prepare test
f_args = FakeCli()
Expand Down Expand Up @@ -556,7 +557,7 @@ def test_find_valid_commit(self):
rev = git.find_latest_signed_commit(case[0])
self.assertEqual(rev, case[1])

empty=git.merge_is_empty('181fb87')
empty = git.merge_is_empty('181fb87')
self.assertEqual(empty, 0)

if org_gnupghome:
Expand Down

0 comments on commit c8e83da

Please sign in to comment.