Compare commits

...

3 Commits

Author SHA1 Message Date
0b28839035 add version command
All checks were successful
Test suites / test-build-install (pull_request) Successful in 27s
Test suites / selftest (pull_request) Successful in 55s
Test suites / pylint (pull_request) Successful in 32s
Test suites / formatting (pull_request) Successful in 27s
Test suites / mypy (pull_request) Successful in 29s
Test suites / reuse (pull_request) Successful in 6s
2024-01-16 16:04:18 +01:00
40739fcc08 fix pylint by igoring some errors 2024-01-16 15:47:32 +01:00
98dc4a4360 clean up test workflow 2024-01-16 15:45:06 +01:00
3 changed files with 15 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
# SPDX-FileCopyrightText: 2023 DB Systel GmbH
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
#
# SPDX-License-Identifier: Apache-2.0
@@ -11,28 +12,6 @@ on:
pull_request:
jobs:
# # Test using the tool via poetry on different OSes and python versions
# test-os-python-matrix:
# runs-on: ${{ matrix.os }}
# strategy:
# max-parallel: 10
# # do not abort the whole test job if one combination in the matrix fails
# fail-fast: false
# matrix:
# python-version: ["3.9", "3.10", "3.11"]
# os: [ubuntu-20.04]
# include:
# - python-version: "3.9"
# os: macos-latest
# - python-version: "3.9"
# os: windows-latest
# steps:
# - uses: actions/checkout@v2
# - uses: ./.gitea/actions/poetrybuild
# - name: Execute seafile-mirror
# run: poetry run ossrfc --help
# Test building the package and installing it via pip3
test-build-install:
runs-on: ubuntu-latest
@@ -45,7 +24,9 @@ jobs:
- name: Install package
run: pip3 install dist/seafile_mirror-*.tar.gz
- name: Run package
run: seafile-mirror --help
run: |
seafile-mirror --version
seafile-mirror --help
# Run tool and sync a test library
selftest:
@@ -70,7 +51,7 @@ jobs:
- name: Sync the library
run: poetry run seafile-mirror -c tests -v
- name: Attempt to find expected string in library
run: grep "__ci_test_expectXXX__" tests/ci-test/testfile.txt
run: grep "__ci_test_expect__" tests/ci-test/testfile.txt
# PYLINT / BLACK / ISORT / MYPY
pylint:

View File

@@ -1,3 +1,10 @@
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
#
# SPDX-License-Identifier: Apache-2.0
"""Global init file"""
from importlib.metadata import version
__version__ = version("seafile-mirror")

View File

@@ -14,6 +14,7 @@ from time import sleep
import yaml
from . import __version__
from ._cachedb import db_read
from ._helpers import convert_bytes, findstring, get_lock
from ._seafile import (
@@ -48,9 +49,10 @@ parser.add_argument(
default=False,
help="Print and log DEBUG messages",
)
parser.add_argument("--version", action="version", version="%(prog)s " + __version__)
def main():
def main(): # pylint: disable=too-many-locals, too-many-statements
"""Main function"""
args = parser.parse_args()
# Set files depending on configdir