diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 92c165f1..f69c8959 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - python-version: [ "3.8" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v3 @@ -46,7 +46,7 @@ jobs: strategy: matrix: - python-version: [ "3.8" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index b7cd8934..bee62848 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/.pylintrc b/.pylintrc index b65ede8a..64c48ba1 100644 --- a/.pylintrc +++ b/.pylintrc @@ -64,7 +64,12 @@ disable=I, useless-import-alias, # nice to have useless-super-delegation, # nice to have wrong-import-order, - wrong-import-position + wrong-import-position, + use-implicit-booleaness-not-comparison-to-zero, + use-implicit-booleaness-not-comparison-to-string, + unspecified-encoding, + broad-exception-raised, + consider-using-f-string [REPORTS] diff --git a/README.md b/README.md index d52a4506..c0cb8377 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ future. And Ronda service will be hosted in AWS S3. ## Prerequisites -* python 3.5+ +* python 3.9+ * git ### [Optional] Install AWS CLI tool diff --git a/charon/pkgs/indexing.py b/charon/pkgs/indexing.py index db7a8fb9..6d9c8d42 100644 --- a/charon/pkgs/indexing.py +++ b/charon/pkgs/indexing.py @@ -55,11 +55,13 @@ def __init__(self, title: str, header: str, items: Set[str]): self.items = items def generate_index_file_content(self, package_type: str) -> str: + template = None if package_type == PACKAGE_TYPE_MAVEN: template = Template(MAVEN_INDEX_TEMPLATE) elif package_type == PACKAGE_TYPE_NPM: template = Template(NPM_INDEX_TEMPLATE) - return template.render(index=self) + if template: + return template.render(index=self) def generate_indexes( diff --git a/charon/pkgs/npm.py b/charon/pkgs/npm.py index 3c183aac..2fd6bee3 100644 --- a/charon/pkgs/npm.py +++ b/charon/pkgs/npm.py @@ -485,6 +485,7 @@ def _scan_metadata_paths_from_archive( path=path, target_dir=tmp_root, is_for_upload=True, pkg_root=pkg_root, registry=registry ) + package = None if len(valid_paths) > 1: version = _scan_for_version(valid_paths[1]) package = NPMPackageMetadata(version, True) diff --git a/tox.ini b/tox.ini index 218f0a61..55e71059 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ deps = -r requirements-dev.txt commands = python3 -m pytest --cov=charon {posargs:"tests"} [testenv:pylint] -deps = pylint==2.9.6 +deps = pylint>=2.9.6 commands = python3 -m pylint charon tests [testenv:flake8]