Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
os:
- name: centos
version: 8
version: 7
python: 3
engine: docker

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
os:
- name: centos
version: 8
version: 7
python: 3
engine: docker

Expand Down
2 changes: 1 addition & 1 deletion charon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/cmd/command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/pkgs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/pkgs/indexing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions charon/pkgs/maven.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -924,7 +924,7 @@ def __hash_decorate_metadata(path: str, metadata: str) -> List[str]:

def _is_ignored(filename: str, ignore_patterns: List[str]) -> bool:
for ignored_name in STANDARD_GENERATED_IGNORES:
if ignored_name in filename:
if filename and filename.startswith(ignored_name.strip()):
logger.warning("Ignoring standard generated Maven path: %s", filename)
return True

Expand Down
2 changes: 1 addition & 1 deletion charon/pkgs/npm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/storage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/utils/archive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/utils/files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charon/utils/logs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 8 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eux
# Prepare env vars
ENGINE=${ENGINE:="podman"}
OS=${OS:="centos"}
OS_VERSION=${OS_VERSION:="8"}
OS_VERSION=${OS_VERSION:="7"}
PYTHON_VERSION=${PYTHON_VERSION:="3"}
ACTION=${ACTION:="test"}
IMAGE="$OS:$OS_VERSION"
Expand Down Expand Up @@ -33,16 +33,22 @@ function setup_charon() {
PKG_EXTRA=(dnf-plugins-core git "$PYTHON"-pylint)
BUILDDEP=(dnf builddep)
if [[ $OS == "centos" ]]; then
PKG="yum"
PKG_EXTRA=(yum-utils git "$PYTHON"-pylint)
BUILDDEP=(yum-builddep)
ENABLE_REPO=
else
ENABLE_REPO="--enablerepo=updates-testing"
fi


PIP_INST=("$PIP" install --index-url "${PYPI_INDEX:-https://pypi.org/simple}")

if [[ $OS == "centos" ]]; then
# Don't let builddep enable *-source repos since they give 404 errors
$RUN rm -f /etc/yum.repos.d/CentOS-Sources.repo
# $RUN rm -f /etc/yum.repos.d/CentOS-Linux-AppStream.repo
# $RUN rm -f /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
# This has to run *before* we try installing anything from EPEL
$RUN $PKG $ENABLE_REPO install -y epel-release
fi
Expand All @@ -66,7 +72,7 @@ function setup_charon() {
fi

# install with RPM_PY_SYS=true to avoid error caused by installing on system python
$RUN sh -c "RPM_PY_SYS=true ${PIP_INST[*]} rpm-py-installer"
#$RUN sh -c "RPM_PY_SYS=true ${PIP_INST[*]} rpm-py-installer"
# Setuptools install charon from source
$RUN $PYTHON setup.py install

Expand Down
4 changes: 3 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,7 @@
from charon.storage import PRODUCT_META_KEY, CHECKSUM_META_KEY
from tests.commons import TEST_BUCKET
from boto3_type_annotations import s3
from moto import mock_s3


SHORT_TEST_PREFIX = "ga"
Expand Down Expand Up @@ -82,6 +83,7 @@ def get_config_base(self) -> str:
return os.path.join(self.get_temp_dir(), '.charon')


@mock_s3
class PackageBaseTest(BaseTest):
def setUp(self):
super().setUp()
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pytest-cov
pytest-html
flake8
requests-mock
moto
moto==3.0.2.dev12

2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_indexing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_maven_del.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_maven_index.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_maven_meta.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_maven_upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_npm_del.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_npm_index.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_npm_meta.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_npm_upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pkgs_dryrun.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_s3client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (C) 2021 Red Hat, Inc. (https://github.com/Commonjava/charon)
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down