Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sle15 literal import #2990

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,50 @@ jobs:
if: always()
run: docker-compose -f dist/ci/docker-compose.yml down

smoke-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- registry.opensuse.org/opensuse/tumbleweed:latest
- registry.opensuse.org/opensuse/leap:15.5

container: ${{ matrix.image }}
steps:
- name: install git to checkout the repo
run: zypper -n in git

- uses: actions/checkout@v3

- name: fix the file permissions of the repository
run: chown -R $(id -un):$(id -gn) .

- name: add the openSUSE:Tools repository for Tumbleweed
if: ${{ contains(matrix.image, 'tumbleweed') }}
dcermak marked this conversation as resolved.
Show resolved Hide resolved
run: zypper -n ar https://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_Tumbleweed/openSUSE:Tools.repo

- name: add the openSUSE:Tools repository for Leap
if: ${{ contains(matrix.image, '15.5') }}
run: zypper -n ar https://download.opensuse.org/repositories/openSUSE:/Tools/15.5/openSUSE:Tools.repo

- name: install the build & runtime dependencies of openSUSE-release-tool
run: |
zypper -n --gpg-auto-import-keys refresh
zypper -n source-install openSUSE-release-tools
dcermak marked this conversation as resolved.
Show resolved Hide resolved
zypper -n install openSUSE-release-tools

- name: FIXME, install missing dependencies
run: |
zypper -n in python3-typing_extensions python3-solv python3-pika python3-openqa_client build python3-influxdb python3-bugzilla

- name: run a simple smoke test whether --help actually works
run: |
for f in $(find . -maxdepth 1 -type f -executable -print); do
# skip completely broken scripts or those without --help
[[ " ./checknewer.py ./repo2fileprovides.py ./openqa-maintenance.py ./docker_publisher.py ./publish_distro ./bs_mirrorfull ./findfileconflicts ./write_repo_susetags_file.pl ./issue-diff.py " =~ "$f" ]] || "$f" --help
done

linters:
runs-on: ubuntu-latest

Expand Down
4 changes: 4 additions & 0 deletions dist/package/openSUSE-release-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Requires: python3-pycurl
Requires: python3-python-dateutil
Requires: python3-pyxdg
Requires: python3-requests
# typing extensions are needed on SLE & Leap
%if 0%{?suse_version} <= 1500
Requires: python3-typing_extensions
%endif

# bs_mirrorfull
Requires: perl-Net-SSLeay
Expand Down
7 changes: 6 additions & 1 deletion origin-manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/python3

from typing import Literal, Optional, Tuple, Union
from typing import Optional, Tuple, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from osclib.core import devel_project_get
from osclib.core import package_source_hash
from osclib.core import package_kind
Expand Down
7 changes: 6 additions & 1 deletion osclib/comments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from datetime import datetime
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Literal, Optional, Tuple, TypedDict, Union
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Tuple, Union
try:
from typing import Literal, TypedDict
except ImportError:
from typing_extensions import Literal, TypedDict

from dateutil.parser import parse as date_parse
import re
if TYPE_CHECKING:
Expand Down
7 changes: 6 additions & 1 deletion osclib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
import re
import socket
import logging
from typing import List, Literal, Optional, Tuple, Union
from typing import List, Optional, Tuple, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from lxml import etree as ET
from urllib.error import HTTPError

Expand Down
6 changes: 5 additions & 1 deletion osclib/origin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from copy import deepcopy
import logging
from typing import Any, Dict, Generator, List, Literal, NamedTuple, Optional, Tuple, TypedDict, Union
from typing import Any, Dict, Generator, List, NamedTuple, Optional, Tuple, Union
try:
from typing import Literal, TypedDict
except ImportError:
from typing_extensions import Literal, TypedDict

from osc.core import ReviewState
from osclib.conf import Config
Expand Down
Loading