-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor using python-common-utility (#7)
- Loading branch information
1 parent
4e77bd1
commit f894d21
Showing
12 changed files
with
121 additions
and
80 deletions.
There are no files selected for viewing
Submodule .devcontainer
added at
190f80
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test and Release | ||
|
||
on: | ||
push: | ||
branches: main | ||
tags: v*.*.* | ||
|
||
pull_request: | ||
branches: [ "main" ] | ||
types: | ||
- synchronize | ||
- opened | ||
- reopened | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Build and test | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
contents: write | ||
statuses: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python-apt-dev python3-apt | ||
- name: Verify changes | ||
uses: EffectiveRange/python-verify-github-action@v1 | ||
with: | ||
coverage-threshold: '95' | ||
|
||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: test | ||
|
||
name: Publish and release | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python-apt-dev python3-apt | ||
- name: Package and publish | ||
uses: EffectiveRange/python-package-github-action@v2 | ||
with: | ||
debian-dist-type: 'fpm-deb' | ||
- name: Release | ||
uses: EffectiveRange/version-release-github-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule ".devcontainer"] | ||
path = .devcontainer | ||
url = https://github.com/EffectiveRange/devcontainer-defs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# SPDX-FileCopyrightText: 2024 Ferenc Nandor Janky <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Attila Gombos <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
from typing import Optional | ||
|
||
from apt import Cache | ||
from common_utility import IJsonLoader | ||
from context_logger import get_logger | ||
from package_downloader import IJsonLoader, PackageConfig | ||
from package_downloader import PackageConfig | ||
|
||
from package_installer import IAptInstaller, IDebInstaller, ISourceAdder | ||
|
||
|
@@ -14,8 +16,15 @@ | |
|
||
class PackageInstaller(object): | ||
|
||
def __init__(self, config_path: str, json_loader: IJsonLoader, apt_cache: Cache, apt_installer: IAptInstaller, | ||
deb_installer: IDebInstaller, source_adder: Optional[ISourceAdder] = None) -> None: | ||
def __init__( | ||
self, | ||
config_path: str, | ||
json_loader: IJsonLoader, | ||
apt_cache: Cache, | ||
apt_installer: IAptInstaller, | ||
deb_installer: IDebInstaller, | ||
source_adder: Optional[ISourceAdder] = None, | ||
) -> None: | ||
self._config_path = config_path | ||
self._json_loader = json_loader | ||
self._apt_cache = apt_cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
[pack-python] | ||
packaging = | ||
wheel | ||
fpm-deb | ||
|
||
[mypy] | ||
packages = bin,package_installer | ||
strict = True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.